|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--seda.sandStorm.core.SimpleSink | +--ostore.dispatch.TSink
TSink is an efficient implementation of a Sink. TSink sends events directly to a stage's Sink rather than through a Classifier.
Field Summary | |
---|---|
static boolean |
DEBUG
|
protected SinkIF |
mySinkIF
|
static String |
tag
|
Constructor Summary | |
---|---|
TSink(String stagename,
Classifier classifier)
Constructs a new TSink for the stage given as an argument.
|
Method Summary | |
---|---|
void |
enqueue(QueueElementIF event)
Enqueues the event in the SinkIF corresponding to this
TSink 's VQueue . |
void |
enqueueWOChecks(QueueElementIF event)
Enqueues the event without doing the checks. |
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 .
|
static void |
unsubscribeNotify(SinkIF sink)
Notifies all TSinks that a SinkIF has been
unsubscribed from the Classifier . |
Methods inherited from class seda.sandStorm.core.SimpleSink |
---|
enqueue_abort, enqueue_commit, enqueue_lossy, enqueue_many, enqueue_prepare, getEnqueuePredicate, profileSize, setEnqueuePredicate, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final boolean DEBUG
public static final String tag
protected SinkIF mySinkIF
Constructor Detail |
public TSink(String stagename, Classifier classifier) throws NoSuchStageException
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.
stagename
- Name of the stage whose TSink is requestedclassifier
- TODOMethod Detail |
public void subscribeNotify(Filter filter, SinkIF sink, Integer priority)
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.
sink
- The SinkIF
to addfilter
- The Filter
to use.priority
- The Filter
's prioritypublic static void unsubscribeNotify(SinkIF sink)
TSinks
that a SinkIF
has been
unsubscribed from the Classifier
.
sink
- The SinkIF
that is being unsubscribedpublic void enqueue(QueueElementIF event) throws SinkException
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
.
enqueue
in interface SinkIF
enqueue
in class SimpleSink
event
- The event which is to be sent to a queue
SinkException
public void enqueueWOChecks(QueueElementIF event) throws SinkException
event
- The event which is to be sent to a queue
SinkException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |