|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 aroundMethod Detail |
---|
public void execute()
Task
execute
in interface Task
java.lang.InterruptedException
Executes the task defined in the task definition
but waits until the initialize method has finished
public void initialize(TaskDefinition config)
Task
initialize
in interface Task
Initializes
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 Task
Task.getTaskDefinition()
public boolean isExecuting()
Task
isExecuting
in interface Task
Task.isExecuting()
public void shutdown()
Task
shutdown
in interface Task
Task.shutdown()
|
OpenMRS-1.7.x | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |