|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectakka.event.japi.ScanningEventBus<E,S,C>
public abstract class ScanningEventBus<E,S,C>
See documentation for ScanningClassification
E is the Event type
S is the Subscriber type
C is the Classifier type
| Constructor Summary | |
|---|---|
ScanningEventBus()
|
|
| Method Summary | |
|---|---|
protected abstract int |
compareClassifiers(C a,
C b)
Provides a total ordering of Classifiers (think java.util.Comparator.compare) |
protected abstract int |
compareSubscribers(S a,
S b)
Provides a total ordering of Subscribers (think java.util.Comparator.compare) |
protected abstract boolean |
matches(C classifier,
E event)
Returns whether the specified Classifier matches the specified Event |
void |
publish(E event)
Publishes the specified Event to this bus |
protected abstract void |
publish(E event,
S subscriber)
Publishes the specified Event to the specified 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ScanningEventBus()
| Method Detail |
|---|
protected abstract int compareClassifiers(C a,
C b)
protected abstract int compareSubscribers(S a,
S b)
protected abstract boolean matches(C classifier,
E event)
protected abstract void publish(E event,
S subscriber)
public boolean subscribe(S subscriber,
C to)
EventBus
subscribe in interface EventBus<E,S,C>
public boolean unsubscribe(S subscriber,
C from)
EventBus
unsubscribe in interface EventBus<E,S,C>public void unsubscribe(S subscriber)
EventBus
unsubscribe in interface EventBus<E,S,C>public void publish(E event)
EventBus
publish in interface EventBus<E,S,C>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||