public static interface ReplicatedEntity.ActorContext
ReplicatedEntity with somewhat limited capabilities and additional functionality
specifically replicated entities.
Not for user extension.
| Modifier and Type | Method and Description |
|---|---|
akka.actor.ActorRef |
actorOf(akka.actor.Props props)
Create new actor as child of this actor and give it an automatically
generated name (currently similar to base64-encoded integer count,
reversed and with “$” prepended, may change in the future).
|
akka.actor.ActorRef |
actorOf(akka.actor.Props props,
java.lang.String name)
Create new actor as child of this actor with the given name, which must
not be null, empty or start with “$”.
|
akka.actor.ActorSelection |
actorSelection(akka.actor.ActorPath path)
Construct an
ActorSelection from the given path, which is
parsed for wildcards (these are replaced by regular expressions
internally). |
akka.actor.ActorSelection |
actorSelection(java.lang.String path)
Construct an
ActorSelection from the given path, which is
parsed for wildcards (these are replaced by regular expressions
internally). |
java.util.Optional<akka.actor.ActorRef> |
findChild(java.lang.String name)
Get the child with the given name if it exists.
|
java.lang.Iterable<akka.actor.ActorRef> |
getChildren()
Returns all supervised children; this method returns a view (i.e.
|
scala.concurrent.ExecutionContextExecutor |
getDispatcher()
Returns the dispatcher (MessageDispatcher) that is used for this Actor.
|
akka.actor.ActorRef |
getParent()
Returns the supervising parent ActorRef.
|
scala.concurrent.duration.Duration |
getReceiveTimeout()
Gets the current receive timeout.
|
akka.actor.ActorRef |
getSelf()
Commands can be sent with the
ReplicatedEntity itself with this ActorRef, or it can be passed
in reply messages. |
akka.actor.ActorRef |
getSender()
Replies can be sent with this
sender() ActorRef an ActorRef that is passed in
the command. |
akka.actor.ActorSystem |
getSystem()
The system that the actor belongs to.
|
akka.actor.TimerScheduler |
getTimers()
Start and cancel timers via the enclosed
TimerScheduler. |
void |
setReceiveTimeout(scala.concurrent.duration.Duration timeout)
Defines the inactivity timeout after which the sending of a
akka.actor.ReceiveTimeout message is triggered. |
void |
stop(akka.actor.ActorRef actor)
Stop the actor pointed to by the given
ActorRef; this is
an asynchronous operation, i.e. |
akka.actor.ActorRef |
unwatch(akka.actor.ActorRef subject)
Unregisters this actor as Monitor for the provided ActorRef.
|
akka.actor.ActorRef |
watch(akka.actor.ActorRef subject)
Registers this actor as a Monitor for the provided ActorRef.
|
akka.actor.ActorRef actorOf(akka.actor.Props props)
See Props for details on how to obtain a Props object.
props - (undocumented)akka.actor.ActorRef actorOf(akka.actor.Props props,
java.lang.String name)
InvalidActorNameException is thrown.
See Props for details on how to obtain a Props object.
props - (undocumented)name - (undocumented)akka.actor.ActorSelection actorSelection(java.lang.String path)
ActorSelection from the given path, which is
parsed for wildcards (these are replaced by regular expressions
internally). No attempt is made to verify the existence of any part of
the supplied path, it is recommended to send a message and gather the
replies in order to resolve the matching set of actors.path - (undocumented)akka.actor.ActorSelection actorSelection(akka.actor.ActorPath path)
ActorSelection from the given path, which is
parsed for wildcards (these are replaced by regular expressions
internally). No attempt is made to verify the existence of any part of
the supplied path, it is recommended to send a message and gather the
replies in order to resolve the matching set of actors.path - (undocumented)java.util.Optional<akka.actor.ActorRef> findChild(java.lang.String name)
name - (undocumented)java.lang.Iterable<akka.actor.ActorRef> getChildren()
child instead for performance reasons:
val badLookup = context.children find (_.path.name == "kid")
// should better be expressed as:
val goodLookup = context.child("kid")
scala.concurrent.ExecutionContextExecutor getDispatcher()
akka.actor.ActorRef getParent()
scala.concurrent.duration.Duration getReceiveTimeout()
akka.actor.ReceiveTimeout message.akka.actor.ActorRef getSelf()
ReplicatedEntity itself with this ActorRef, or it can be passed
in reply messages.
WARNING: It is not possible to use getSelf from the constructor of the ReplicatedEntity.
akka.actor.ActorRef getSender()
sender() ActorRef an ActorRef that is passed in
the command.akka.actor.ActorSystem getSystem()
akka.actor.TimerScheduler getTimers()
TimerScheduler.
Message handlers for timer messages can be registered with SignalHandlerBuilder.onTimer(java.lang.Class<M>, akka.persistence.multidc.javadsl.SignalHandler<M, Event, State>).void setReceiveTimeout(scala.concurrent.duration.Duration timeout)
akka.actor.ReceiveTimeout message is triggered.
Message handlers for timer messages can be registered with SignalHandlerBuilder.onReceiveTimeout(akka.persistence.multidc.javadsl.SignalHandler<akka.actor.ReceiveTimeout, Event, State>).
1 millisecond is the minimum supported timeout.
Please note that the receive timeout might fire and enqueue the ReceiveTimeout message right after
another message was enqueued; hence it is '''not guaranteed''' that upon reception of the receive
timeout there must have been an idle period beforehand as configured via this method.
Once set, the receive timeout stays in effect (i.e. continues firing repeatedly after inactivity
periods). Pass in Duration.Undefined to switch off this feature.
Messages marked with NotInfluenceReceiveTimeout will not reset the timer. This can be useful when
ReceiveTimeout should be fired by external inactivity but not influenced by internal activity,
e.g. scheduled tick messages.
timeout - (undocumented)void stop(akka.actor.ActorRef actor)
ActorRef; this is
an asynchronous operation, i.e. involves a message send.
If this method is applied to the self reference from inside an Actor
then that Actor is guaranteed to not process any further messages after
this call; please note that the processing of the current message will
continue, this method does not immediately terminate this actor.actor - (undocumented)akka.actor.ActorRef unwatch(akka.actor.ActorRef subject)
subject - (undocumented)akka.actor.ActorRef watch(akka.actor.ActorRef subject)
Terminated(subject) message when watched
actor is terminated. Register handler for the Terminated message
with CommandHandlerBuilder.onTerminated
subject - (undocumented)