public class EventStreamImpl extends java.lang.Object implements EventStream
An Akka EventStream is a pub-sub stream of events both system and user generated, where subscribers are ActorRefs and the channels are Classes and Events are any java.lang.Object. EventStreams employ SubchannelClassification, which means that if you listen to a Class, you'll receive any message that is of that type or a subtype.
The debug flag in the constructor toggles if operations on this EventStream should also be published as Debug-Events
Modifier and Type | Class and Description |
---|---|
static interface |
EventStreamImpl.Command |
static class |
EventStreamImpl.Register |
static class |
EventStreamImpl.Register$ |
class |
EventStreamImpl.SerializedStandardOutLogger |
class |
EventStreamImpl.StandardOutLogger
Actor-less logging implementation for synchronous logging to standard
output.
|
static class |
EventStreamImpl.UnregisterIfNoMoreSubscribedChannels |
static class |
EventStreamImpl.UnregisterIfNoMoreSubscribedChannels$ |
Constructor and Description |
---|
EventStreamImpl(boolean debug,
Timeout timeout) |
Modifier and Type | Method and Description |
---|---|
Logging.LogLevel |
logLevel()
Query currently set log level.
|
<T> void |
publish(T event)
Publishes the specified Event to this bus
|
void |
setLogLevel(Logging.LogLevel level)
Change log level: default loggers (i.e.
|
static RootActorPath |
StandardOutLoggerPath() |
void |
startDefaultLoggers(ActorSystemImpl<scala.runtime.Nothing$> system) |
void |
startStdoutLogger(Settings settings) |
void |
startUnsubscriber(ActorSystem<scala.runtime.Nothing$> sys)
''Must'' be called after actor system is "ready".
|
void |
stopDefaultLoggers(ActorSystem<scala.runtime.Nothing$> system) |
<T> boolean |
subscribe(ActorRef<T> subscriber,
java.lang.Class<T> channel)
Attempts to register the subscriber to the specified Classifier
|
<T> void |
unsubscribe(ActorRef<T> subscriber)
Attempts to deregister the subscriber from all Classifiers it may be subscribed to
|
<T> boolean |
unsubscribe(ActorRef<T> subscriber,
java.lang.Class<T> channel)
Attempts to deregister the subscriber from the specified Classifier
|
public EventStreamImpl(boolean debug, Timeout timeout)
public static RootActorPath StandardOutLoggerPath()
public void startUnsubscriber(ActorSystem<scala.runtime.Nothing$> sys)
sys
- (undocumented)public Logging.LogLevel logLevel()
logLevel
in interface EventStream
public void setLogLevel(Logging.LogLevel level)
NOTE: if the StandardOutLogger is configured also as normal logger, it will not participate in the automatic management of log level subscriptions!
setLogLevel
in interface EventStream
level
- (undocumented)public void startStdoutLogger(Settings settings)
public void startDefaultLoggers(ActorSystemImpl<scala.runtime.Nothing$> system)
public void stopDefaultLoggers(ActorSystem<scala.runtime.Nothing$> system)
public <T> boolean subscribe(ActorRef<T> subscriber, java.lang.Class<T> channel)
EventStream
subscribe
in interface EventStream
subscriber
- (undocumented)channel
- (undocumented)public <T> boolean unsubscribe(ActorRef<T> subscriber, java.lang.Class<T> channel)
EventStream
unsubscribe
in interface EventStream
subscriber
- (undocumented)channel
- (undocumented)public <T> void unsubscribe(ActorRef<T> subscriber)
EventStream
unsubscribe
in interface EventStream
subscriber
- (undocumented)public <T> void publish(T event)
EventStream
publish
in interface EventStream
event
- (undocumented)