Package gov.nasa.pds.tools.validate.task
Interface TaskManager
-
- All Known Implementing Classes:
BlockingTaskManager
public interface TaskManagerDefines the operations of a service that can run tasks in the background. The task manager will generate events when tasks are run, paused, canceled, or complete.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancel(Task task)Requests to cancel the task.Task.StatusgetStatus(Task task)Gets the task status.voidremove(Task task)Removes a task from the task manager.voidsubmit(Task task)Submits a task to run in the background.
-
-
-
Method Detail
-
submit
void submit(Task task)
Submits a task to run in the background.- Parameters:
task- the task to run
-
remove
void remove(Task task)
Removes a task from the task manager. The task manager will attempt to cancel the task if it is running. Once a task is removed, further operations on the task using this task manager may result in exceptions.- Parameters:
task- the task to remove
-
getStatus
Task.Status getStatus(Task task)
Gets the task status.- Parameters:
task- the task- Returns:
- the task status
-
cancel
void cancel(Task task)
Requests to cancel the task.- Parameters:
task- the task to cancel
-
-