Package org.opennms.core.tasks
Class SyncTask
- java.lang.Object
-
- org.opennms.core.tasks.AbstractTask
-
- org.opennms.core.tasks.SyncTask
-
- All Implemented Interfaces:
Task
public class SyncTask extends AbstractTask
SyncTask- Version:
- $Id: $
- Author:
- brozow
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opennms.core.tasks.Task
Task.State
-
-
Constructor Summary
Constructors Constructor Description SyncTask(TaskCoordinator coordinator, ContainerTask<?> parent, java.lang.Runnable action)
Constructor for SyncTask.SyncTask(TaskCoordinator coordinator, ContainerTask<?> parent, java.lang.Runnable action, java.lang.String preferredExecutor)
Constructor for SyncTask.
-
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
getPreferredExecutor()
getPreferredExecutorvoid
setPreferredExecutor(java.lang.String preferredExecutor)
setPreferredExecutorjava.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
-
SyncTask
public SyncTask(TaskCoordinator coordinator, ContainerTask<?> parent, java.lang.Runnable action)
Constructor for SyncTask.
- Parameters:
coordinator
- aTaskCoordinator
object.parent
- aContainerTask
object.action
- aRunnable
object.
-
SyncTask
public SyncTask(TaskCoordinator coordinator, ContainerTask<?> parent, java.lang.Runnable action, java.lang.String preferredExecutor)
Constructor for SyncTask.
- Parameters:
coordinator
- aTaskCoordinator
object.parent
- aContainerTask
object.action
- aRunnable
object.preferredExecutor
- aString
object.
-
-
Method Detail
-
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
-
getPreferredExecutor
public java.lang.String getPreferredExecutor()
getPreferredExecutor
- Returns:
- a
String
object.
-
setPreferredExecutor
public void setPreferredExecutor(java.lang.String preferredExecutor)
setPreferredExecutor
- Parameters:
preferredExecutor
- aString
object.
-
toString
public java.lang.String toString()
toString
- Overrides:
toString
in classAbstractTask
- Returns:
- a
String
object.
-
-