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 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
public void submit(Task task)
Description copied from interface:TaskManagerSubmits a task to run in the background.- Specified by:
submitin interfaceTaskManager- Parameters:
task- the task to run
-
remove
public void remove(Task task)
Description copied from interface:TaskManagerRemoves 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:
removein interfaceTaskManager- Parameters:
task- the task to remove
-
getStatus
public Task.Status getStatus(Task task)
Description copied from interface:TaskManagerGets the task status.- Specified by:
getStatusin interfaceTaskManager- Parameters:
task- the task- Returns:
- the task status
-
cancel
public void cancel(Task task)
Description copied from interface:TaskManagerRequests to cancel the task.- Specified by:
cancelin interfaceTaskManager- Parameters:
task- the task to cancel
-
-