public class TaskThreadedInitializationWrapper extends 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()
Task
execute
in interface Task
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()
Copyright © 2024 OpenMRS Inc.. All rights reserved.