public class TaskThreadedInitializationWrapper extends java.lang.Object implements Task
initialize(TaskDefinition) method to run in a new thread (and hence not hold up the
"startup" processes)| Constructor and Description |
|---|
TaskThreadedInitializationWrapper(Task task)
Default constructor to create this wrapper
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
public TaskThreadedInitializationWrapper(Task task)
task - the Task to wrap aroundpublic void execute()
Taskexecute in interface Taskjava.lang.InterruptedExceptionExecutes the task defined in the task definition
but waits until the initialize method has finishedpublic void initialize(TaskDefinition config)
Taskinitialize in interface TaskInitializes
the task and sets the task definition. This method is non-blocking by executing in a new
thread.public TaskDefinition getTaskDefinition()
TaskgetTaskDefinition in interface TaskTask.getTaskDefinition()public boolean isExecuting()
TaskisExecuting in interface TaskTask.isExecuting()public void shutdown()
Taskshutdown in interface TaskTask.shutdown()Copyright © 2018 OpenMRS Inc.. All Rights Reserved.