net.sourceforge.basher
Interface TaskManager

All Known Implementing Classes:
TaskManagerImpl

public interface TaskManager

Defines operations for interacting with the task manager.

Version:
1.0
Author:
Johan Lindquist

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.
 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 removeTaskExecutionContext(UUID identifier)
          Removes the specified task execution context from the list of active tasks.
 

Method Detail

addTask

void addTask(TaskContribution taskContribution)
Adds a task to the system in the form of task contribution.

Parameters:
taskContribution - The task contribution to add

addTask

TaskContribution addTask(Class taskClass,
                         TaskContribution... followers)
Adds a task class to the task manager. The class does not necessarily have to implement Task to the task manager but must provide an empty constructor (but not necessarily public).

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
Since:
1.3

addTask

TaskContribution addTask(Object taskInstance,
                         TaskContribution... followers)
Adds a task instance. The instance does not necessarily have to implement Task to the task manager.

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 execution
followers - Followers which will be added to the task instance.
Returns:
The task created from adding the specified task instance
Since:
1.3

getTasks

Set<TaskContribution> getTasks()
Retrieves all active tasks with the task manager.

Returns:
A list of Task instances.

getTaskByName

TaskContribution getTaskByName(String name)
Retrieves the task identified by the specified name. This will search both active and removed task lists.

Parameters:
name - The name of the task to retrieve.
Returns:
The specified task or null if it can not be found

getNumberOfTasks

int getNumberOfTasks()
Retrives the count of the currently registered tasks.

Returns:
The number of tasks currently registered.

getNextTaskExecutionContext

TaskExecutionContext getNextTaskExecutionContext()
Retrieves the next task available.

Returns:
A task instance or null of no tasks are available

removeTaskExecutionContext

void removeTaskExecutionContext(UUID identifier)
Removes the specified task execution context from the list of active tasks.

Parameters:
identifier - The identifier of the task execution context to remove


Copyright © 2006-2010 Basher Team. All Rights Reserved.