public abstract class AbstractTask extends Object implements Task
Modifier and Type | Field and Description |
---|---|
protected boolean |
isExecuting |
protected TaskDefinition |
taskDefinition |
Modifier | Constructor and Description |
---|---|
protected |
AbstractTask()
Default constructor
|
protected |
AbstractTask(TaskDefinition taskDefinition)
Constructor
|
Modifier and Type | Method and Description |
---|---|
abstract void |
execute()
Executes the task defined in the task definition.
|
TaskDefinition |
getTaskDefinition()
Returns the task definition associated with this task.
|
void |
initialize(TaskDefinition definition)
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.
|
void |
startExecuting()
Callback method that tells the task that it has started executing.
|
void |
stopExecuting()
Callback method that tells the task that it has stopped executing.
|
protected boolean isExecuting
protected TaskDefinition taskDefinition
protected AbstractTask()
protected AbstractTask(TaskDefinition taskDefinition)
taskDefinition
- the task definitionpublic abstract void execute()
Task
execute
in interface Task
Task.execute()
public boolean isExecuting()
Task
isExecuting
in interface Task
Task.isExecuting()
public void initialize(TaskDefinition definition)
Task
initialize
in interface Task
Task.initialize(TaskDefinition)
public TaskDefinition getTaskDefinition()
Task
getTaskDefinition
in interface Task
Task.getTaskDefinition()
public void shutdown()
Task
shutdown
in interface Task
Task.shutdown()
public void startExecuting()
public void stopExecuting()
Copyright © 2024 OpenMRS Inc.. All rights reserved.