Interface AbstractActor.ActorContext
- 
- All Superinterfaces:
- ActorContext,- ActorRefFactory,- ClassicActorContextProvider
 - Enclosing class:
- AbstractActor
 
 public static interface AbstractActor.ActorContext extends ActorContext The actor context - the view of the actor cell from the actor. Exposes contextual information for the actor and the current message.Not intended for public inheritance/implementation 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbecome(AbstractActor.Receive behavior)Changes the Actor's behavior to become the new 'Receive' handler.voidbecome(AbstractActor.Receive behavior, boolean discardOld)Changes the Actor's behavior to become the new 'Receive' handler.voidcancelReceiveTimeout()Cancel the sending of receive timeout notifications.java.util.Optional<ActorRef>findChild(java.lang.String name)Returns a reference to the named child if it exists.java.lang.Iterable<ActorRef>getChildren()Returns an unmodifiable Java Collection containing the linked actorsscala.concurrent.ExecutionContextExecutorgetDispatcher()Returns the dispatcher (MessageDispatcher) that is used for this Actor.ActorRefgetParent()Returns the supervisor of this actor.PropsgetProps()Retrieve the Props which were used to create this actor.java.time.DurationgetReceiveTimeout()Gets the current receive timeout.ActorRefgetSelf()The ActorRef representing this actorActorRefgetSender()Returns the sender 'ActorRef' of the current message.ActorSystemgetSystem()Returns the system this actor is running in.voidsetReceiveTimeout(java.time.Duration timeout)Defines the inactivity timeout after which the sending of apekko.actor.ReceiveTimeoutmessage is triggered.- 
Methods inherited from interface org.apache.pekko.actor.ActorContextbecome, become, child, children, dispatcher, parent, props, receiveTimeout, self, sender, setReceiveTimeout, system, unbecome, unwatch, watch, watchWith, writeObject
 - 
Methods inherited from interface org.apache.pekko.actor.ActorRefFactoryactorOf, actorOf, actorSelection, actorSelection, guardian, lookupRoot, provider, stop, systemImpl
 - 
Methods inherited from interface org.apache.pekko.actor.ClassicActorContextProviderclassicActorContext
 
- 
 
- 
- 
- 
Method Detail- 
becomevoid become(AbstractActor.Receive behavior) Changes the Actor's behavior to become the new 'Receive' handler. Replaces the current behavior on the top of the behavior stack.*Warning*: This method is not thread-safe and must not be accessed from threads other than the ordinary actor message processing thread, such as CompletionStagecallbacks.
 - 
becomevoid become(AbstractActor.Receive behavior, boolean discardOld) Changes the Actor's behavior to become the new 'Receive' handler. This method acts upon the behavior stack as follows:- if discardOld = trueit will replace the top element (i.e. the current behavior) - ifdiscardOld = falseit will keep the current behavior and push the given one atopThe default of replacing the current behavior on the stack has been chosen to avoid memory leaks in case client code is written without consulting this documentation first (i.e. always pushing new behaviors and never issuing an unbecome())*Warning*: This method is not thread-safe and must not be accessed from threads other than the ordinary actor message processing thread, such as CompletionStagecallbacks.
 - 
cancelReceiveTimeoutvoid cancelReceiveTimeout() Cancel the sending of receive timeout notifications.
 - 
findChildjava.util.Optional<ActorRef> findChild(java.lang.String name) Returns a reference to the named child if it exists.*Warning*: This method is not thread-safe and must not be accessed from threads other than the ordinary actor message processing thread, such as CompletionStagecallbacks.
 - 
getChildrenjava.lang.Iterable<ActorRef> getChildren() Returns an unmodifiable Java Collection containing the linked actors*Warning*: This method is not thread-safe and must not be accessed from threads other than the ordinary actor message processing thread, such as CompletionStagecallbacks.
 - 
getDispatcherscala.concurrent.ExecutionContextExecutor getDispatcher() Returns the dispatcher (MessageDispatcher) that is used for this Actor.This method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as CompletionStageandFuturecallbacks.
 - 
getParentActorRef getParent() Returns the supervisor of this actor.Same as parent().This method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as CompletionStagecallbacks.
 - 
getPropsProps getProps() Retrieve the Props which were used to create this actor.This method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as CompletionStageandFuturecallbacks.
 - 
getReceiveTimeoutjava.time.Duration getReceiveTimeout() Gets the current receive timeout. When specified, the receive method should be able to handle apekko.actor.ReceiveTimeoutmessage.*Warning*: This method is not thread-safe and must not be accessed from threads other than the ordinary actor message processing thread, such as CompletionStageandFuturecallbacks.
 - 
getSelfActorRef getSelf() The ActorRef representing this actorThis method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as CompletionStageandFuturecallbacks.
 - 
getSenderActorRef getSender() Returns the sender 'ActorRef' of the current message.*Warning*: This method is not thread-safe and must not be accessed from threads other than the ordinary actor message processing thread, such as CompletionStageandFuturecallbacks.
 - 
getSystemActorSystem getSystem() Returns the system this actor is running in.Same as system()This method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as CompletionStagecallbacks.
 - 
setReceiveTimeoutvoid setReceiveTimeout(java.time.Duration timeout) Defines the inactivity timeout after which the sending of apekko.actor.ReceiveTimeoutmessage is triggered. When specified, the receive function should be able to handle apekko.actor.ReceiveTimeoutmessage. 1 millisecond is the minimum supported timeout.Please note that the receive timeout might fire and enqueue the ReceiveTimeoutmessage 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.Undefinedto switch off this feature.Messages marked with NotInfluenceReceiveTimeoutwill not reset the timer. This can be useful whenReceiveTimeoutshould be fired by external inactivity but not influenced by internal activity, e.g. scheduled tick messages.*Warning*: This method is not thread-safe and must not be accessed from threads other than the ordinary actor message processing thread, such as CompletionStageandFuturecallbacks.
 
- 
 
-