org.openmrs.scheduler.tasks
Class AbstractTask

java.lang.Object
  extended by org.openmrs.scheduler.tasks.AbstractTask
All Implemented Interfaces:
Task
Direct Known Subclasses:
AlertReminderTask, CheckInternetConnectivityTask, ConceptWordUpdateTask, GenerateDataExportTask, HelloWorldTask, ProcessHL7InQueueTask, SendEmailTask, StatefulTask, TestTask

public abstract class AbstractTask
extends java.lang.Object
implements Task

Base class for all other task classes.


Field Summary
protected  boolean isExecuting
           
protected  TaskDefinition taskDefinition
           
 
Constructor Summary
protected AbstractTask()
          Default constructor
protected AbstractTask(TaskDefinition taskDefinition)
          Constructor
 
Method Summary
protected  void authenticate()
          Deprecated. this method is not used anymore. All threads are run as the Daemon user
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isExecuting

protected boolean isExecuting

taskDefinition

protected TaskDefinition taskDefinition
Constructor Detail

AbstractTask

protected AbstractTask()
Default constructor


AbstractTask

protected AbstractTask(TaskDefinition taskDefinition)
Constructor

Parameters:
taskDefinition - the task definition
Method Detail

execute

public abstract void execute()
Description copied from interface: Task
Executes the task defined in the task definition.

Specified by:
execute in interface Task
See Also:
Task.execute()

isExecuting

public boolean isExecuting()
Description copied from interface: Task
Returns true if the task is currently in its execute() method.

Specified by:
isExecuting in interface Task
Returns:
true if task is executing, false otherwise
See Also:
Task.isExecuting()

initialize

public void initialize(TaskDefinition definition)
Description copied from interface: Task
Initializes the task and sets the task definition.

Specified by:
initialize in interface Task
See Also:
Task.initialize(TaskDefinition)

getTaskDefinition

public TaskDefinition getTaskDefinition()
Description copied from interface: Task
Returns the task definition associated with this task.

Specified by:
getTaskDefinition in interface Task
Returns:
a task definition
See Also:
Task.getTaskDefinition()

shutdown

public void shutdown()
Description copied from interface: Task
Callback method used to clean up resources used during the tasks execution.

Specified by:
shutdown in interface Task
See Also:
Task.shutdown()

startExecuting

public void startExecuting()
Callback method that tells the task that it has started executing.


stopExecuting

public void stopExecuting()
Callback method that tells the task that it has stopped executing.


authenticate

@Deprecated
protected void authenticate()
Deprecated. this method is not used anymore. All threads are run as the Daemon user


OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change