Rice Pastry API

rice.selector
Class TimerTask

java.lang.Object
  extended by rice.selector.TimerTask
All Implemented Interfaces:
java.lang.Comparable<TimerTask>, Cancellable, CancellableTask
Direct Known Subclasses:
DeliveryTimerTask, DirectTimerTask, LivenessTransportLayerImpl.DeadChecker, MagicNumberTransportLayer.VerifyHeaderReceiver, PartitionHandler, ScheduledMessage, TimerWeakHashMap.HardLinkTimerTask

public abstract class TimerTask
extends java.lang.Object
implements java.lang.Comparable<TimerTask>, CancellableTask

Author:
Jeff Hoye

Field Summary
protected  boolean cancelled
           
protected  boolean fixedRate
           
protected  int period
          If period is positive, task will be rescheduled.
protected  SelectorManager selector
           
protected  int seq
           
 
Constructor Summary
TimerTask()
           
 
Method Summary
 boolean cancel()
           
 int compareTo(TimerTask arg0)
           
 boolean execute(TimeSource ts)
          Returns true if should re-insert.
 boolean isCancelled()
           
abstract  void run()
           
 long scheduledExecutionTime()
           
protected  void setNextExecutionTime(long l)
           
 void setSelectorManager(SelectorManager selector)
          Makes the cancel operation remove the task from the queue as well.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cancelled

protected boolean cancelled

seq

protected int seq

selector

protected SelectorManager selector

period

protected int period
If period is positive, task will be rescheduled.


fixedRate

protected boolean fixedRate
Constructor Detail

TimerTask

public TimerTask()
Method Detail

run

public abstract void run()
Specified by:
run in interface CancellableTask

execute

public boolean execute(TimeSource ts)
Returns true if should re-insert.

Returns:

cancel

public boolean cancel()
Specified by:
cancel in interface Cancellable
Returns:
true if it was cancelled, false if it was already complete, or cancelled.

scheduledExecutionTime

public long scheduledExecutionTime()
Specified by:
scheduledExecutionTime in interface CancellableTask

compareTo

public int compareTo(TimerTask arg0)
Specified by:
compareTo in interface java.lang.Comparable<TimerTask>

isCancelled

public boolean isCancelled()

setSelectorManager

public void setSelectorManager(SelectorManager selector)
Makes the cancel operation remove the task from the queue as well.

Parameters:
timerQueue - that we are enqueued on

setNextExecutionTime

protected void setNextExecutionTime(long l)

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection