akka.event
Class EventStream
java.lang.Object
akka.event.EventStream
- All Implemented Interfaces:
- ActorEventBus, EventBus, LoggingBus, SubchannelClassification
public class EventStream
- extends java.lang.Object
- implements LoggingBus, SubchannelClassification
Method Summary |
protected java.lang.Class<?> |
classify(java.lang.Object event)
Returns the Classifier associated with the given Event |
static EventStream |
fromActorSystem(ActorSystem system)
|
protected void |
publish(java.lang.Object event,
ActorRef subscriber)
Publishes the given Event to the given Subscriber |
protected java.lang.Object |
subclassification()
|
boolean |
subscribe(ActorRef subscriber,
java.lang.Class<?> channel)
Attempts to register the subscriber to the specified Classifier |
void |
unsubscribe(ActorRef subscriber)
Attempts to deregister the subscriber from all Classifiers it may be subscribed to |
boolean |
unsubscribe(ActorRef subscriber,
java.lang.Class<?> channel)
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 |
EventStream
public EventStream(boolean debug)
fromActorSystem
public static EventStream fromActorSystem(ActorSystem system)
subclassification
protected java.lang.Object subclassification()
- Specified by:
subclassification
in interface SubchannelClassification
classify
protected java.lang.Class<?> classify(java.lang.Object event)
- Description copied from interface:
SubchannelClassification
- Returns the Classifier associated with the given Event
- Specified by:
classify
in interface SubchannelClassification
publish
protected void publish(java.lang.Object event,
ActorRef subscriber)
- Description copied from interface:
SubchannelClassification
- Publishes the given Event to the given Subscriber
- Specified by:
publish
in interface SubchannelClassification
subscribe
public boolean subscribe(ActorRef subscriber,
java.lang.Class<?> channel)
- Description copied from interface:
EventBus
- Attempts to register the subscriber to the specified Classifier
- Specified by:
subscribe
in interface EventBus
- Specified by:
subscribe
in interface SubchannelClassification
- Returns:
- true if successful and false if not (because it was already subscribed to that Classifier, or otherwise)
unsubscribe
public boolean unsubscribe(ActorRef subscriber,
java.lang.Class<?> channel)
- Description copied from interface:
EventBus
- Attempts to deregister the subscriber from the specified Classifier
- Specified by:
unsubscribe
in interface EventBus
- Specified by:
unsubscribe
in interface SubchannelClassification
- Returns:
- true if successful and false if not (because it wasn't subscribed to that Classifier, or otherwise)
unsubscribe
public void unsubscribe(ActorRef subscriber)
- Description copied from interface:
EventBus
- Attempts to deregister the subscriber from all Classifiers it may be subscribed to
- Specified by:
unsubscribe
in interface EventBus
- Specified by:
unsubscribe
in interface SubchannelClassification