| org.databene.task.Task
All known Subclasses: org.databene.task.AbstractTask,
Task | public interface Task extends Runnable(Code) | | The Task interface.
General usage is to call init() for initialization,
then once or several times the run() method for executing the task's work.
After usage, destroy() is called.
If the goal of a Task has been achieved by external influences or Task
completion, the Task may signal that it does not require further execution
by returning false in
Task.wantsToRun() .
When implementing the Task interface, you should preferably inherit from
AbstractTask , this may compensate for future interface changes.
Created: 06.07.2007 06:30:22
author: Volker Bergmann |
Method Summary | |
void | destroy() closes the task and releases all resources. | String | getTaskName() the name of the task. | void | init(Context context) initializes the task and, if necessary, stores a reference to the context. | void | run() executes the main functionality of the task. | boolean | wantsToRun() tells if the task still wants to be executed. |
destroy | void destroy()(Code) | | closes the task and releases all resources.
|
getTaskName | String getTaskName()(Code) | | the name of the task. |
init | void init(Context context)(Code) | | initializes the task and, if necessary, stores a reference to the context.
|
run | void run()(Code) | | executes the main functionality of the task.
|
wantsToRun | boolean wantsToRun()(Code) | | tells if the task still wants to be executed.
since: 0.4.0 |
|
|