Package akka.actor

Class ActorCell

    • Method Detail

      • contextStack

        public static java.lang.ThreadLocal<scala.collection.immutable.List<ActorContext>> contextStack()
      • emptyCancellable

        public static final Cancellable emptyCancellable()
      • emptyBehaviorStack

        public static final scala.collection.immutable.List<scala.PartialFunction<java.lang.Object,​scala.runtime.BoxedUnit>> emptyBehaviorStack()
      • emptyActorRefSet

        public static final scala.collection.immutable.Set<ActorRef> emptyActorRefSet()
      • terminatedProps

        public static final Props terminatedProps()
      • undefinedUid

        public static final int undefinedUid()
      • newUid

        public static final int newUid()
      • splitNameAndUid

        public static final scala.Tuple2<java.lang.String,​java.lang.Object> splitNameAndUid​(java.lang.String name)
      • DefaultState

        public static final int DefaultState()
      • SuspendedState

        public static final int SuspendedState()
      • SuspendedWaitForChildrenState

        public static final int SuspendedWaitForChildrenState()
      • system

        public ActorSystemImpl system()
        Description copied from interface: ActorContext
        The system that the actor belongs to. Importing this member will place an implicit ActorSystem in scope.

        This method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as CompletionStage and Future callbacks.

        Specified by:
        system in interface ActorContext
        Specified by:
        system in interface Cell
        Returns:
        (undocumented)
      • self

        public InternalActorRef self()
        Description copied from interface: ActorContext
        The ActorRef representing this actor

        This method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as CompletionStage and Future callbacks.

        Specified by:
        self in interface ActorContext
        Specified by:
        self in interface Cell
        Returns:
        (undocumented)
      • props

        public final Props props()
        Description copied from interface: ActorContext
        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 CompletionStage and Future callbacks.

        Specified by:
        props in interface ActorContext
        Specified by:
        props in interface Cell
        Returns:
        (undocumented)
      • dispatcher

        public MessageDispatcher dispatcher()
        Description copied from interface: ActorContext
        Returns the dispatcher (MessageDispatcher) that is used for this Actor. Importing this member will place an implicit ExecutionContext in scope.

        This method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as CompletionStage and Future callbacks.

        Specified by:
        dispatcher in interface ActorContext
        Specified by:
        dispatcher in interface ActorRefFactory
        Returns:
        (undocumented)
      • parent

        public InternalActorRef parent()
        Description copied from interface: ActorContext
        Returns the supervising parent ActorRef.

        This method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as CompletionStage and Future callbacks.

        Specified by:
        parent in interface ActorContext
        Specified by:
        parent in interface Cell
        Returns:
        (undocumented)
      • isLocal

        public final boolean isLocal()
        Description copied from interface: Cell
        Returns true if the actor is local, i.e. if it is actually scheduled on a Thread in the current JVM when run.
        Specified by:
        isLocal in interface Cell
        Returns:
        (undocumented)
      • uid

        protected int uid()
      • actor

        public Actor actor()
      • actor_$eq

        protected void actor_$eq​(Actor a)
      • currentMessage

        public Envelope currentMessage()
      • currentMessage_$eq

        public void currentMessage_$eq​(Envelope x$1)
      • getParent

        public final InternalActorRef getParent()
        Description copied from interface: AbstractActor.ActorContext
        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 CompletionStage callbacks.

        Specified by:
        getParent in interface AbstractActor.ActorContext
        Returns:
        (undocumented)
      • getSystem

        public final ActorSystemImpl getSystem()
        Description copied from interface: AbstractActor.ActorContext
        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 CompletionStage callbacks.

        Specified by:
        getSystem in interface AbstractActor.ActorContext
        Returns:
        (undocumented)
      • getDispatcher

        public final scala.concurrent.ExecutionContextExecutor getDispatcher()
        Description copied from interface: AbstractActor.ActorContext
        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 CompletionStage and Future callbacks.

        Specified by:
        getDispatcher in interface AbstractActor.ActorContext
        Returns:
        (undocumented)
      • getSelf

        public final ActorRef getSelf()
        Description copied from interface: AbstractActor.ActorContext
        The ActorRef representing this actor

        This method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as CompletionStage and Future callbacks.

        Specified by:
        getSelf in interface AbstractActor.ActorContext
        Returns:
        (undocumented)
      • getProps

        public final Props getProps()
        Description copied from interface: AbstractActor.ActorContext
        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 CompletionStage and Future callbacks.

        Specified by:
        getProps in interface AbstractActor.ActorContext
        Returns:
        (undocumented)
      • systemInvoke

        public final void systemInvoke​(SystemMessage message)
      • invoke

        public final void invoke​(Envelope messageHandle)
      • autoReceiveMessage

        public void autoReceiveMessage​(Envelope msg)
      • receiveMessage

        public final void receiveMessage​(java.lang.Object msg)
      • sender

        public final ActorRef sender()
        Description copied from interface: ActorContext
        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 CompletionStage and Future callbacks.

        Specified by:
        sender in interface ActorContext
        Returns:
        (undocumented)
      • become

        public void become​(scala.PartialFunction<java.lang.Object,​scala.runtime.BoxedUnit> behavior,
                           boolean discardOld)
        Description copied from interface: ActorContext
        Changes the Actor's behavior to become the new 'Receive' (PartialFunction[Any, Unit]) handler. This method acts upon the behavior stack as follows:

        - if discardOld = true it will replace the top element (i.e. the current behavior) - if discardOld = false it will keep the current behavior and push the given one atop

        The 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 CompletionStage and Future callbacks.

        Specified by:
        become in interface ActorContext
        Parameters:
        behavior - (undocumented)
        discardOld - (undocumented)
      • become

        public void become​(Procedure<java.lang.Object> behavior)
        Description copied from interface: UntypedActorContext
        Changes the Actor's behavior to become the new 'Procedure' handler. Replaces the current behavior on the top of the behavior stack.
        Specified by:
        become in interface UntypedActorContext
        Parameters:
        behavior - (undocumented)
      • become

        public void become​(Procedure<java.lang.Object> behavior,
                           boolean discardOld)
        Description copied from interface: UntypedActorContext
        Changes the Actor's behavior to become the new 'Procedure' handler. This method acts upon the behavior stack as follows:

        - if discardOld = true it will replace the top element (i.e. the current behavior) - if discardOld = false it will keep the current behavior and push the given one atop

        The 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())

        Specified by:
        become in interface UntypedActorContext
        Parameters:
        behavior - (undocumented)
        discardOld - (undocumented)
      • become$default$2

        public boolean become$default$2()
      • unbecome

        public void unbecome()
        Description copied from interface: ActorContext
        Reverts the Actor behavior to the previous one on 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 CompletionStage and Future callbacks.

        Specified by:
        unbecome in interface ActorContext
      • newActor

        protected Actor newActor()
      • handleSupervise

        protected void handleSupervise​(ActorRef child,
                                       boolean async)
      • clearActorCellFields

        protected final void clearActorCellFields​(ActorCell cell)
      • clearActorFields

        protected final void clearActorFields​(Actor actorInstance,
                                              boolean recreate)
      • clazz

        protected final java.lang.Class<?> clazz​(java.lang.Object o)