public final class ClusterDomainEventPublisher extends java.lang.Object implements Actor, ActorLogging, RequiresMessageQueue<UnboundedMessageQueueSemantics>
Actor.emptyBehavior$, Actor.ignoringBehavior$
Constructor and Description |
---|
ClusterDomainEventPublisher() |
Modifier and Type | Method and Description |
---|---|
void |
clearState() |
ActorContext |
context()
Stores the context for this actor, including self, and sender.
|
EventStream |
eventStream() |
Gossip |
latestGossip() |
void |
postStop()
User overridable callback.
|
void |
preRestart(java.lang.Throwable reason,
scala.Option<java.lang.Object> message)
User overridable callback: '''By default it disposes of all children and then calls
postStop() .''' |
void |
publish(java.lang.Object event) |
void |
publishChanges(Gossip newGossip) |
void |
publishDiff(Gossip oldGossip,
Gossip newGossip,
scala.Function1<java.lang.Object,scala.runtime.BoxedUnit> pub) |
void |
publishInternalStats(ClusterEvent.CurrentInternalStats currentStats) |
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
receive()
This defines the initial actor behavior, it must return a partial function
with the actor logic.
|
ActorRef |
self()
The 'self' field holds the ActorRef for this actor.
|
UniqueAddress |
selfUniqueAddress() |
void |
sendCurrentClusterState(ActorRef receiver)
The current snapshot state corresponding to latest gossip
to mimic what you would have seen if you were listening to the events.
|
void |
subscribe(ActorRef subscriber,
ClusterEvent.SubscriptionInitialStateMode initMode,
scala.collection.immutable.Set<java.lang.Class<?>> to) |
void |
unsubscribe(ActorRef subscriber,
scala.Option<java.lang.Class<?>> to) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, postRestart, preStart, sender, supervisorStrategy, unhandled
log
public ActorContext context()
Actor
forward
.
WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!
ActorContext
is the Scala API. getContext
returns a
UntypedActorContext
, which is the Java API of the actor
context.
public final ActorRef self()
Actor
self ! message
public UniqueAddress selfUniqueAddress()
public Gossip latestGossip()
public void preRestart(java.lang.Throwable reason, scala.Option<java.lang.Object> message)
Actor
postStop()
.'''preRestart
in interface Actor
reason
- the Throwable that caused the restart to happenmessage
- optionally the current message the actor processed when failing, if applicable
Is called on a crashed Actor right BEFORE it is restarted to allow clean
up of resources before Actor is terminated.public void postStop()
Actor
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
Actor
public EventStream eventStream()
public void sendCurrentClusterState(ActorRef receiver)
receiver
- (undocumented)public void subscribe(ActorRef subscriber, ClusterEvent.SubscriptionInitialStateMode initMode, scala.collection.immutable.Set<java.lang.Class<?>> to)
public void unsubscribe(ActorRef subscriber, scala.Option<java.lang.Class<?>> to)
public void publishChanges(Gossip newGossip)
public void publishDiff(Gossip oldGossip, Gossip newGossip, scala.Function1<java.lang.Object,scala.runtime.BoxedUnit> pub)
public void publishInternalStats(ClusterEvent.CurrentInternalStats currentStats)
public void publish(java.lang.Object event)
public void clearState()