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.ssTimer
s to store and trigger events.
Field Summary |
protected SinkIF |
_sink
A SinkIF onto which the events will be enqueued. |
protected ssTimer |
_timer
The ssTimer which stores and triggers events. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_timer
protected ssTimer _timer
- The
ssTimer
which stores and triggers events.
_sink
protected SinkIF _sink
- A
SinkIF
onto which the events will be enqueued.
Presumably a Classifier
.
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
.
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
- Following copied from interface:
ostore.dispatch.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
schedule
d.
If the event has already been dispatched, this method has no effect.
- Specified by:
cancel
in interface Classifier.TimerCB
- Following copied from interface:
ostore.dispatch.Classifier.TimerCB
- Parameters:
token
- The Object
returned by
schedule
.- Throws:
IllegalArgumentException
- if token
is not a
token returned by the internal timer.- See Also:
Classifier.TimerCB.schedule(long, seda.sandStorm.api.QueueElementIF)