org.mobicents.timers
Class TimerTask

java.lang.Object
  extended by org.mobicents.timers.TimerTask
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
FaultTolerantTimerTimerTask

public abstract class TimerTask
extends java.lang.Object
implements java.lang.Runnable

The base class to implement a task to be scheduled and executed by an FaultTolerantScheduler.

Author:
martins

Constructor Summary
TimerTask(TimerTaskData data)
           
 
Method Summary
 void beforeRecover()
          Invoked before a task is recovered, after fail over, by default simply adjust start time.
 TimerTaskData getData()
          Retrieves the data associated with the task.
protected  java.util.concurrent.ScheduledFuture<?> getScheduledFuture()
          Retrieves the schedule future object that returns from the task scheduling.
protected  SetTimerAfterTxCommitRunnable getSetTimerTransactionalAction()
          Retrieves the tx action to set the timer when the tx commits, not used in a non tx environment.
abstract  void run()
          The method executed by the scheduler
protected  void setScheduledFuture(java.util.concurrent.ScheduledFuture<?> scheduledFuture)
          Sets the schedule future object that returns from the task scheduling.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimerTask

public TimerTask(TimerTaskData data)
Parameters:
data -
Method Detail

getData

public TimerTaskData getData()
Retrieves the data associated with the task.

Returns:

getSetTimerTransactionalAction

protected SetTimerAfterTxCommitRunnable getSetTimerTransactionalAction()
Retrieves the tx action to set the timer when the tx commits, not used in a non tx environment.

Returns:

getScheduledFuture

protected java.util.concurrent.ScheduledFuture<?> getScheduledFuture()
Retrieves the schedule future object that returns from the task scheduling.

Returns:

setScheduledFuture

protected void setScheduledFuture(java.util.concurrent.ScheduledFuture<?> scheduledFuture)
Sets the schedule future object that returns from the task scheduling.

Parameters:
scheduledFuture -

run

public abstract void run()
The method executed by the scheduler

Specified by:
run in interface java.lang.Runnable

beforeRecover

public void beforeRecover()
Invoked before a task is recovered, after fail over, by default simply adjust start time.



Copyright © 2009. All Rights Reserved.