package com.anjlab.spelling.web.services.workers; import com.anjlab.spelling.web.entities.Task; import com.anjlab.spelling.web.entities.Task.TaskType; import com.anjlab.spelling.web.services.atmosphere.WebSocketProgressMonitor; public interface Worker { public enum WorkerStatus { IDLE, RUNNING, DOWN, PAUSED } WorkerStatus getStatus(); WebSocketProgressMonitor getProgressMonitor(); void run() throws InterruptedException; Task currentTask(); boolean cancelTask(int taskId); boolean isTaskCancelled(); void checkForNewTask(); TaskType getTaskType(); void cleanup(); void onExit(); void shutdown(); boolean isShuttingDown(); void setRoutine(WorkerRoutine routine); boolean togglePaused(); }