ostore.dispatch
Class TSink
java.lang.Object
|
+--seda.sandStorm.core.SimpleSink
|
+--ostore.dispatch.TSink
- All Implemented Interfaces:
- ProfilableIF, SinkIF
- public class TSink
- extends SimpleSink
TSink is an efficient implementation of a Sink. TSink sends events
directly to a stage's Sink rather than through a Classifier.
- Author:
- Aqeel Mahesri
Constructor Summary |
TSink(String stagename,
Classifier classifier)
Constructs a new TSink for the stage given as an argument. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEBUG
public static final boolean DEBUG
tag
public static final String tag
mySinkIF
protected SinkIF mySinkIF
TSink
public TSink(String stagename,
Classifier classifier)
throws NoSuchStageException
- Constructs a new
TSink
for the stage given as an argument.
When the requesting stage has the TSink
for the
given stage, it will be able to pass events directly instead of
invoking this Classifier
, which should be more
efficient.
- Parameters:
String
- stagename Name of the stage whose TSink is requested
subscribeNotify
public void subscribeNotify(Filter filter,
SinkIF sink,
Integer priority)
- Notifies all
TSinks
that a SinkIF
has
subscribed to a certain type of event via the Classifier
.
The TSink
class stores the event type so that any events
of this type are enqueued via the Classifier
and reach
the stages that need to listen to them.
There is one significant limitation. If someone subscribes to a
subclass of a message type, then all of the supertypes of the message
type should also be marked as subscribed. This is currently not the
case; if anyone has a TSink receiving messages with a supertype that
is subscribed to, the subscribee will not receive the messages.
- Parameters:
sink
- The SinkIF
to addfilter
- The Filter
to use.priority
- The Filter
's priority
unsubscribeNotify
public static void unsubscribeNotify(SinkIF sink)
- Notifies all
TSinks
that a SinkIF
has been
unsubscribed from the Classifier
.
- Parameters:
sink
- The SinkIF
that is being unsubscribed
enqueue
public void enqueue(QueueElementIF event)
throws SinkException
- Enqueues the event in the
SinkIF
corresponding to this
TSink
's VQueue
. It also checks whether any
stages have subscribed to this type of event via the
Classifier
; in this case, the event must also be
dispatched by the Classifier
.
- Overrides:
enqueue
in class SimpleSink
- Parameters:
event
- The event which is to be sent to a queue
enqueueWOChecks
public void enqueueWOChecks(QueueElementIF event)
throws SinkException
- Enqueues the event without doing the checks.
- Parameters:
event
- The event which is to be sent to a queue