|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.basher.impl.TaskManagerImpl
public class TaskManagerImpl
Constructor Summary | |
---|---|
TaskManagerImpl()
|
Method Summary | |
---|---|
TaskContribution |
addTask(Class taskClass,
TaskContribution... followers)
Adds a task class to the task manager. |
TaskContribution |
addTask(Object taskInstance,
TaskContribution... followers)
Adds a task instance. |
void |
addTask(TaskContribution taskContribution)
Adds a task to the system in the form of task contribution. |
void |
basherEvent(BasherEvent basherEvent)
|
TaskExecutionContext |
getNextTaskExecutionContext()
Retrieves the next task available. |
int |
getNumberOfTasks()
Retrives the count of the currently registered tasks. |
TaskContribution |
getTaskByName(String name)
Retrieves the task identified by the specified name. |
Set<TaskContribution> |
getTasks()
Retrieves all active tasks with the task manager. |
void |
initializeService()
|
void |
removeTaskExecutionContext(UUID identifier)
Removes the specified task execution context from the list of active tasks. |
void |
setEventManager(EventManager eventManager)
|
void |
setLog(org.apache.commons.logging.Log logger)
|
void |
setModuleDescriptorTaskContributions(List<ModuleDescriptorTaskContribution> moduleDescriptorTaskContributions)
|
void |
setRandomizer(Randomizer randomizer)
|
void |
setTaskConfigurationExtractor(TaskConfigurationExtractor taskConfigurationExtractor)
|
void |
setTaskCreator(TaskCreator taskCreator)
|
void |
setTaskDecorator(TaskDecorator taskDecorator)
|
void |
setTaskProviders(List<TaskProvider> taskProviders)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TaskManagerImpl()
Method Detail |
---|
public void setTaskConfigurationExtractor(TaskConfigurationExtractor taskConfigurationExtractor)
public void setTaskCreator(TaskCreator taskCreator)
public void setTaskDecorator(TaskDecorator taskDecorator)
public void setEventManager(EventManager eventManager)
public void setLog(org.apache.commons.logging.Log logger)
public void setRandomizer(Randomizer randomizer)
public void setTaskProviders(List<TaskProvider> taskProviders)
public void addTask(TaskContribution taskContribution)
TaskManager
addTask
in interface TaskManager
taskContribution
- The task contribution to addpublic TaskContribution addTask(Class taskClass, TaskContribution... followers)
TaskManager
Task to the
task manager but must provide an empty constructor (but not necessarily public).
- Specified by:
addTask
in interface TaskManager
- Parameters:
taskClass
- The task class to add. This class must either be annotated or
expose a public method named executeTask
which will be used for task execution.
If not annotated, the class may also expose any of the methods defined in Task
to
control the settings used during invocation.followers
- Followers which will be added to the task instance.
- Returns:
- The task created from adding the specified task instance
addTask
public TaskContribution addTask(Object taskInstance,
TaskContribution... followers)
- Description copied from interface:
TaskManager
- Adds a task instance. The instance does not necessarily have to implement
Task to the
task manager.
- Specified by:
addTask
in interface TaskManager
- Parameters:
taskInstance
- The task instance to add. The instance must either be annotated or
expose a public method named executeTask
which will be used for task executionfollowers
- Followers which will be added to the task instance.
- Returns:
- The task created from adding the specified task instance
getNextTaskExecutionContext
public TaskExecutionContext getNextTaskExecutionContext()
- Description copied from interface:
TaskManager
- Retrieves the next task available.
- Specified by:
getNextTaskExecutionContext
in interface TaskManager
- Returns:
- A task instance or null of no tasks are available
getTasks
public Set<TaskContribution> getTasks()
- Description copied from interface:
TaskManager
- Retrieves all active tasks with the task manager.
- Specified by:
getTasks
in interface TaskManager
- Returns:
- A list of
Task
instances.
getTaskByName
public TaskContribution getTaskByName(String name)
- Description copied from interface:
TaskManager
- Retrieves the task identified by the specified name. This will search both active and removed task lists.
- Specified by:
getTaskByName
in interface TaskManager
- Parameters:
name
- The name of the task to retrieve.
- Returns:
- The specified task or null if it can not be found
removeTaskExecutionContext
public void removeTaskExecutionContext(UUID identifier)
- Description copied from interface:
TaskManager
- Removes the specified task execution context from the list of active tasks.
- Specified by:
removeTaskExecutionContext
in interface TaskManager
- Parameters:
identifier
- The identifier of the task execution context to remove
getNumberOfTasks
public int getNumberOfTasks()
- Description copied from interface:
TaskManager
- Retrives the count of the currently registered tasks.
- Specified by:
getNumberOfTasks
in interface TaskManager
- Returns:
- The number of tasks currently registered.
setModuleDescriptorTaskContributions
public void setModuleDescriptorTaskContributions(List<ModuleDescriptorTaskContribution> moduleDescriptorTaskContributions)
initializeService
public void initializeService()
basherEvent
public void basherEvent(BasherEvent basherEvent)
- Specified by:
basherEvent
in interface BasherEventListener
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Copyright © 2006-2010 Basher Team. All Rights Reserved.