public abstract class LookupEventBus<E,S,C> extends java.lang.Object implements EventBus<E,S,C>
LookupClassification
E is the Event type
S is the Subscriber type
C is the Classifier typeConstructor and Description |
---|
LookupEventBus() |
Modifier and Type | Method and Description |
---|---|
protected abstract C |
classify(E event)
Returns the Classifier associated with the given Event
|
protected abstract int |
compareSubscribers(S a,
S b)
Provides a total ordering of Subscribers (think java.util.Comparator.compare)
|
protected abstract int |
mapSize()
This is a size hint for the number of Classifiers you expect to have (use powers of 2)
|
void |
publish(E event)
Publishes the specified Event to this bus
|
protected abstract void |
publish(E event,
S subscriber)
Publishes the given Event to the given Subscriber
|
boolean |
subscribe(S subscriber,
C to)
Attempts to register the subscriber to the specified Classifier
|
void |
unsubscribe(S subscriber)
Attempts to deregister the subscriber from all Classifiers it may be subscribed to
|
boolean |
unsubscribe(S subscriber,
C from)
Attempts to deregister the subscriber from the specified Classifier
|
protected abstract int mapSize()
protected abstract int compareSubscribers(S a, S b)
a
- (undocumented)b
- (undocumented)protected abstract C classify(E event)
event
- (undocumented)protected abstract void publish(E event, S subscriber)
event
- (undocumented)subscriber
- (undocumented)public boolean subscribe(S subscriber, C to)
EventBus
public boolean unsubscribe(S subscriber, C from)
EventBus
unsubscribe
in interface EventBus<E,S,C>
subscriber
- (undocumented)from
- (undocumented)public void unsubscribe(S subscriber)
EventBus
unsubscribe
in interface EventBus<E,S,C>
subscriber
- (undocumented)