planetj.util
Class CMTimerTask

java.lang.Object
  |
  +--java.util.TimerTask
        |
        +--planetj.util.CMTimerTask
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
DataEngineTimerTask

public abstract class CMTimerTask
extends TimerTask


Method Summary
 void addListener(ITaskListener pTaskListener)
          Adds a listener of this timer task.
 TaskEvent getNewTaskEvent()
          Returns a TaskEvent object to used when notifying listerns when the task starts and completes.
 TaskEvent getTaskEvent()
          Returns the TaskEvent object used when notifying listerns when the task starts and completes.
abstract  void performTask()
          The action to be performed by this task.
 void postTask()
          Any logic to be carried out after this task starts.
 void preTask()
          Any logic to be carried out before this task starts.
 void removeListener(ITaskListener pTaskListener)
          Removes a listener of this timer task.
 void run()
          Sets up, performs, and resets the task.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addListener

public void addListener(ITaskListener pTaskListener)
Adds a listener of this timer task.


getNewTaskEvent

public TaskEvent getNewTaskEvent()
Returns a TaskEvent object to used when notifying listerns when the task starts and completes. Subclass which use there own unique TaskEvent object need to override this method inorder to create there unique TaskEvents. This method is called everytime a task starts.

Returns:
TaskEvent

getTaskEvent

public TaskEvent getTaskEvent()
Returns the TaskEvent object used when notifying listerns when the task starts and completes.

Returns:
TaskEvent

performTask

public abstract void performTask()
                          throws Exception
The action to be performed by this task.

Exception

postTask

public void postTask()
              throws Exception
Any logic to be carried out after this task starts.

Exception

preTask

public void preTask()
             throws Exception
Any logic to be carried out before this task starts.

Exception

removeListener

public void removeListener(ITaskListener pTaskListener)
Removes a listener of this timer task.


run

public final void run()
Sets up, performs, and resets the task.

Specified by:
run in interface Runnable
Specified by:
run in class TimerTask