Package org.opennms.core.tasks
Class AsyncTask<T>
- java.lang.Object
-
- org.opennms.core.tasks.AbstractTask
-
- org.opennms.core.tasks.AsyncTask<T>
-
- All Implemented Interfaces:
Task
public class AsyncTask<T> extends AbstractTask
AsyncTask class.
- Version:
- $Id: $
- Author:
- ranger
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opennms.core.tasks.Task
Task.State
-
-
Constructor Summary
Constructors Constructor Description AsyncTask(TaskCoordinator coordinator, ContainerTask<?> parent, Async<T> async)
Constructor for AsyncTask.AsyncTask(TaskCoordinator coordinator, ContainerTask<?> parent, Async<T> async, Callback<T> callback)
Constructor for AsyncTask.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doSubmit()
This method submits a task to be executed and is called when all dependencies are completed for that task This method should place a runnable on an executor or submit the task in some other way so that it will run as soon as possible.java.lang.String
toString()
toString-
Methods inherited from class org.opennms.core.tasks.AbstractTask
addDependent, addPrerequisite, completeSubmit, getCoordinator, getMonitor, isScheduled, postSchedule, preSchedule, schedule, waitFor, waitFor
-
-
-
-
Constructor Detail
-
AsyncTask
public AsyncTask(TaskCoordinator coordinator, ContainerTask<?> parent, Async<T> async)
Constructor for AsyncTask.
- Type Parameters:
T
- a T object.- Parameters:
coordinator
- aTaskCoordinator
object.parent
- aContainerTask
object.async
- aAsync
object.
-
AsyncTask
public AsyncTask(TaskCoordinator coordinator, ContainerTask<?> parent, Async<T> async, Callback<T> callback)
Constructor for AsyncTask.
- Parameters:
coordinator
- aTaskCoordinator
object.parent
- aContainerTask
object.async
- aAsync
object.callback
- aCallback
object.
-
-
Method Detail
-
toString
public java.lang.String toString()
toString
- Overrides:
toString
in classAbstractTask
- Returns:
- a
String
object.
-
doSubmit
protected void doSubmit()
This method submits a task to be executed and is called when all dependencies are completed for that task This method should place a runnable on an executor or submit the task in some other way so that it will run as soon as possible. Tasks that have no processing to be done may override completeSubmit to notify the Task coordinator that the task is done.- Overrides:
doSubmit
in classAbstractTask
-
-