|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openmrs.scheduler.tasks.TaskThreadedInitializationWrapper
public class TaskThreadedInitializationWrapper
This class executes the Task.initialize method in a new thread. Extend this class if you want
your initialize(TaskDefinition) method to run in a new thread (and hence not hold up the
"startup" processes)
| Constructor Summary | |
|---|---|
TaskThreadedInitializationWrapper(Task task)
Default constructor to create this wrapper |
|
| Method Summary | |
|---|---|
void |
execute()
Executes the task defined in the task definition. |
TaskDefinition |
getTaskDefinition()
Returns the task definition associated with this task. |
void |
initialize(TaskDefinition config)
Initializes the task and sets the task definition. |
boolean |
isExecuting()
Returns true if the task is currently in its execute() method. |
void |
shutdown()
Callback method used to clean up resources used during the tasks execution. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TaskThreadedInitializationWrapper(Task task)
task - the Task to wrap around| Method Detail |
|---|
public void execute()
Task
execute in interface Taskjava.lang.InterruptedExceptionExecutes the task defined in the task definition
but waits until the initialize method has finishedpublic void initialize(TaskDefinition config)
Task
initialize in interface TaskInitializes
the task and sets the task definition. This method is non-blocking by executing in a new
thread.public TaskDefinition getTaskDefinition()
Task
getTaskDefinition in interface TaskTask.getTaskDefinition()public boolean isExecuting()
Task
isExecuting in interface TaskTask.isExecuting()public void shutdown()
Task
shutdown in interface TaskTask.shutdown()
|
OpenMRS-1.7.x | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||