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
-
Constructor Details
-
BlockingTaskManager
public BlockingTaskManager()
-
-
Method Details
-
submit
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
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
Description copied from interface:TaskManager
Gets the task status.- Specified by:
getStatus
in interfaceTaskManager
- Parameters:
task
- the task- Returns:
- the task status
-
cancel
Description copied from interface:TaskManager
Requests to cancel the task.- Specified by:
cancel
in interfaceTaskManager
- Parameters:
task
- the task to cancel
-