Package org.opennms.core.tasks
Interface Task
-
- All Known Implementing Classes:
AbstractTask
,AsyncTask
,BatchTask
,ContainerTask
,Phase
,Phase.PhaseMethod
,SequenceTask
,SyncTask
public interface Task
BaseTask- Version:
- $Id: $
- Author:
- brozow
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Task.State
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TaskCoordinator
getCoordinator()
getCoordinatorTaskMonitor
getMonitor()
getMonitorvoid
schedule()
This is called to add the task to the queue of tasks that can be considered to be runnablevoid
waitFor()
Wait for this task to complete.boolean
waitFor(long timeout, java.util.concurrent.TimeUnit unit)
Wait for this task to complete or until a timeout occurs.
-
-
-
Method Detail
-
getCoordinator
TaskCoordinator getCoordinator()
getCoordinator
- Returns:
- a
TaskCoordinator
object.
-
getMonitor
TaskMonitor getMonitor()
getMonitor
- Returns:
- a
TaskMonitor
object.
-
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 java.lang.InterruptedException, java.util.concurrent.ExecutionException
Wait for this task to complete. The current thread will block until this task has been completed.- Throws:
java.lang.InterruptedException
- if any.java.util.concurrent.ExecutionException
- if any.
-
waitFor
boolean waitFor(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
Wait for this task to complete or until a timeout occurs. If the timeout elapses, then false is returned.- Parameters:
timeout
- a long.unit
- aTimeUnit
object.- Throws:
java.lang.InterruptedException
- if any.
-
-