Package gov.nasa.pds.tools.validate.task
Class BlockingTaskManager
- java.lang.Object
-
- gov.nasa.pds.tools.validate.task.BlockingTaskManager
-
- All Implemented Interfaces:
TaskManager
public class BlockingTaskManager extends Object implements TaskManager
Implements a simple task manager suitable for non-Swing applications that runs a task as soon as it is submitted and does not return until the task is complete.
-
-
Constructor Summary
Constructors Constructor Description BlockingTaskManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel(Task task)
Requests to cancel the task.Task.Status
getStatus(Task task)
Gets the task status.void
remove(Task task)
Removes a task from the task manager.void
submit(Task task)
Submits a task to run in the background.
-
-
-
Method Detail
-
submit
public void submit(Task task)
Description copied from interface:TaskManager
Submits a task to run in the background.- Specified by:
submit
in interfaceTaskManager
- Parameters:
task
- the task to run
-
remove
public void remove(Task task)
Description copied from interface:TaskManager
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.- Specified by:
remove
in interfaceTaskManager
- Parameters:
task
- the task to remove
-
getStatus
public Task.Status getStatus(Task task)
Description copied from interface:TaskManager
Gets the task status.- Specified by:
getStatus
in interfaceTaskManager
- Parameters:
task
- the task- Returns:
- the task status
-
cancel
public void cancel(Task task)
Description copied from interface:TaskManager
Requests to cancel the task.- Specified by:
cancel
in interfaceTaskManager
- Parameters:
task
- the task to cancel
-
-