Package org.opennms.core.tasks
Interface Task
-
- All Known Implementing Classes:
AbstractTask,AsyncTask,BatchTask,ContainerTask,Phase,Phase.PhaseMethod,SequenceTask,SyncTask
public interface TaskBaseTask- Version:
- $Id: $
- Author:
- brozow
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTask.State
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TaskCoordinatorgetCoordinator()getCoordinatorTaskMonitorgetMonitor()getMonitorvoidschedule()This is called to add the task to the queue of tasks that can be considered to be runnablevoidwaitFor()Wait for this task to complete.booleanwaitFor(long timeout, TimeUnit unit)Wait for this task to complete or until a timeout occurs.
-
-
-
Method Detail
-
getCoordinator
TaskCoordinator getCoordinator()
getCoordinator
- Returns:
- a
TaskCoordinatorobject.
-
getMonitor
TaskMonitor getMonitor()
getMonitor
- Returns:
- a
TaskMonitorobject.
-
schedule
void schedule()
This is called to add the task to the queue of tasks that can be considered to be runnable
-
waitFor
void waitFor() throws InterruptedException, ExecutionExceptionWait for this task to complete. The current thread will block until this task has been completed.- Throws:
InterruptedException- if any.ExecutionException- if any.
-
waitFor
boolean waitFor(long timeout, TimeUnit unit) throws InterruptedExceptionWait for this task to complete or until a timeout occurs. If the timeout elapses, then false is returned.- Parameters:
timeout- a long.unit- aTimeUnitobject.- Throws:
InterruptedException- if any.
-
-