ostore.dispatch
Class Classifier.DefaultTimerCB

java.lang.Object
  |
  +--ostore.dispatch.Classifier.DefaultTimerCB
All Implemented Interfaces:
Classifier.TimerCB
Enclosing class:
Classifier

protected class Classifier.DefaultTimerCB
extends Object
implements Classifier.TimerCB

The default implementation of TimerCB, which uses seda.sandStorm.core.ssTimers to store and trigger events.


Field Summary
protected  SinkIF _sink
          A SinkIF onto which the events will be enqueued.
 
Constructor Summary
Classifier.DefaultTimerCB(SinkIF sink)
          Creates a new DefaultTimerCB which will enqueue events onto a specified sink
 
Method Summary
 void cancel(Object token)
          Cancels an event previously scheduled.
 Object schedule(long millis, QueueElementIF event)
          dispatches a specified event some time in the future.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_sink

protected SinkIF _sink
A SinkIF onto which the events will be enqueued. Presumably a Classifier.

Constructor Detail

Classifier.DefaultTimerCB

public Classifier.DefaultTimerCB(SinkIF sink)
Creates a new DefaultTimerCB which will enqueue events onto a specified sink

Parameters:
sink - The SinkIF onto which the events will be enqueued. Presumably a Classifier.
Method Detail

schedule

public Object schedule(long millis,
                       QueueElementIF event)
Description copied from interface: Classifier.TimerCB
dispatches a specified event some time in the future.

Specified by:
schedule in interface Classifier.TimerCB
Parameters:
millis - The number of milliseconds from now to dispatch the event.
event - The QueueElementIF to dispatch.
Returns:
a token to pass to cancel in order to cancel the event before it is dispatched.
See Also:
Classifier.TimerCB.cancel(java.lang.Object)

cancel

public void cancel(Object token)
Description copied from interface: Classifier.TimerCB
Cancels an event previously scheduled. If the event has already been dispatched, this method has no effect.

Specified by:
cancel in interface Classifier.TimerCB
Parameters:
token - The Object returned by schedule.
See Also:
Classifier.TimerCB.schedule(long, seda.sandStorm.api.QueueElementIF)