|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.memphis.ccrg.lida.framework.initialization.InitializableImpl
edu.memphis.ccrg.lida.framework.tasks.TaskSpawnerImpl
public class TaskSpawnerImpl
Maintains a queue of running tasks and their task status. Methods to add and
cancel tasks. This implementation actually uses TaskManager to
execute the tasks.
| Constructor Summary | |
|---|---|
TaskSpawnerImpl()
This default constructor is used by the AgentXmlFactory. |
|
TaskSpawnerImpl(TaskManager tm)
Convenience constructor that sets the TaskManager |
|
| Method Summary | |
|---|---|
void |
addTask(FrameworkTask task)
Adds and runs supplied FrameworkTask. |
void |
addTasks(java.util.Collection<? extends FrameworkTask> tasks)
Adds and runs supplied FrameworkTasks. |
boolean |
cancelTask(FrameworkTask task)
Cancels specified task if it exists in this TaskSpawner
Task is removed from TaskSpawner and canceled in the TaskManager. |
boolean |
containsTask(FrameworkTask task)
Returns whether this TaskSpawner manages this task. |
java.util.Collection<FrameworkTask> |
getRunningTasks()
Deprecated. |
java.util.Collection<FrameworkTask> |
getTasks()
Returns the FrameworkTask objects controlled by this TaskSpawner. |
protected void |
processResults(FrameworkTask task)
When a FrameworkTask has completed one execution and its status is TaskStatus.FINISHED_WITH_RESULTS
this method is called to handle the results. |
void |
receiveFinishedTask(FrameworkTask task)
This method receives a task that has finished. |
void |
setTaskManager(TaskManager tm)
Set the TaskManager this TaskSpawner will use to actually run the tasks. |
| Methods inherited from class edu.memphis.ccrg.lida.framework.initialization.InitializableImpl |
|---|
containsParameter, getParam, getParameters, init, init |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface edu.memphis.ccrg.lida.framework.initialization.Initializable |
|---|
containsParameter, getParam, getParameters, init, init |
| Constructor Detail |
|---|
public TaskSpawnerImpl()
AgentXmlFactory.
TaskManager must be set using TaskSpawner.setTaskManager(TaskManager)
public TaskSpawnerImpl(TaskManager tm)
TaskManager
tm - the TaskManager to set| Method Detail |
|---|
public void setTaskManager(TaskManager tm)
TaskSpawner
setTaskManager in interface TaskSpawnertm - the TaskManager of the system.public void addTasks(java.util.Collection<? extends FrameworkTask> tasks)
TaskSpawner
addTasks in interface TaskSpawnertasks - a collection of tasks to be run.public void addTask(FrameworkTask task)
TaskSpawner
addTask in interface TaskSpawnertask - the task to add.public void receiveFinishedTask(FrameworkTask task)
TaskSpawnerTaskStatus
determines this action.
receiveFinishedTask in interface TaskSpawnertask - finished FrameworkTaskprotected void processResults(FrameworkTask task)
FrameworkTask has completed one execution and its status is TaskStatus.FINISHED_WITH_RESULTS
this method is called to handle the results.
task - the task to be processedpublic boolean cancelTask(FrameworkTask task)
TaskSpawnerTaskSpawner
Task is removed from TaskSpawner and canceled in the TaskManager.
This is only possible if the tick for which the task
is scheduled has not been reached.
cancelTask in interface TaskSpawnertask - The task to cancel.
TaskManager.cancelTask(FrameworkTask)public boolean containsTask(FrameworkTask task)
TaskSpawner
containsTask in interface TaskSpawnertask - a FrameworkTask
TaskSpawner contains a task with task's id@Deprecated public java.util.Collection<FrameworkTask> getRunningTasks()
TaskSpawnerUnmodifiableCollection that contains the FrameworkTasks in this
TaskSpawner. Tasks' TaskStatus may or may not be running.
Use TaskSpawner.getTasks() instead.
getRunningTasks in interface TaskSpawnerpublic java.util.Collection<FrameworkTask> getTasks()
TaskSpawnerFrameworkTask objects controlled by this TaskSpawner.
getTasks in interface TaskSpawnerCollection FrameworkTasks.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||