Class RepointableActorRef

  • All Implemented Interfaces:
    ActorRefScope, RepointableRef, ScalaActorRef,, java.lang.Comparable<ActorRef>
    Direct Known Subclasses:

    public class RepointableActorRef
    extends ActorRefWithCell
    implements RepointableRef
    This actor ref starts out with some dummy cell (by default just enqueuing messages into vectors protected by ReentrantLock), it must be initialize()&rsquo;d before it can be sent to, and it will be activate()&rsquo;d by its supervisor in response to the Supervise() message, which will replace the contained Cell with a fully functional one, transfer all messages from dummy to real queue and swap out the cell ref.
    See Also:
    Serialized Form
    • Method Detail

      • $bang

        public void $bang​(java.lang.Object message,
                          ActorRef sender)
        Description copied from interface: ScalaActorRef
        Sends a one-way asynchronous message. E.g. fire-and-forget semantics.

        If invoked from within an actor then the actor reference is implicitly passed on as the implicit 'sender' argument.

        This actor 'sender' reference is then available in the receiving actor in the 'sender()' member variable, if invoked from within an Actor. If not then no sender is available.

           actor ! message

        Specified by:
        $bang in interface ScalaActorRef
      • getChild

        public InternalActorRef getChild​(scala.collection.Iterator<java.lang.String> name)
        Description copied from class: InternalActorRef
        Obtain ActorRef by possibly traversing the actor tree or looking it up at some provider-specific location. This method shall return the end result, i.e. not only the next step in the look-up; this will typically involve recursive invocation. A path element of ".." signifies the parent, a trailing "" element must be disregarded. If the requested path does not exist, return Nobody.
        Specified by:
        getChild in class InternalActorRef
      • getSingleChild

        public InternalActorRef getSingleChild​(java.lang.String name)
        Method for looking up a single child beneath this actor. It is racy if called from the outside.
        Specified by:
        getSingleChild in class ActorRefWithCell
      • initialize

        public RepointableActorRef initialize​(boolean async)
        Initialize: make a dummy cell which holds just a mailbox, then tell our supervisor that we exist so that he can create the real Cell in handleSupervise().

        Call twice on your own peril!

        This is protected so that others can have different initialization.

      • isLocal

        public boolean isLocal()
        Description copied from class: InternalActorRef
        Scope: if this ref points to an actor which resides within the same JVM, i.e. whose mailbox is directly reachable etc.
        Specified by:
        isLocal in interface ActorRefScope
        Specified by:
        isLocal in class InternalActorRef
      • isTerminated

        public boolean isTerminated()
        Use and receive Terminated(actor). Since 2.2.
        Description copied from class: InternalActorRef
        INTERNAL API: Returns &ldquo;true&rdquo; if the actor is locally known to be terminated, &ldquo;false&rdquo; if alive or uncertain.
        Specified by:
        isTerminated in class InternalActorRef
      • lookup

        public Cell lookup()
      • newCell

        public Cell newCell​(UnstartedCell old)
        This is called by activate() to obtain the cell which is to replace the unstarted cell. The cell must be fully functional.
      • path

        public ActorPath path()
        Description copied from class: ActorRef
        Returns the path for this actor (from this actor up to the root actor).
        Specified by:
        path in class ActorRef
      • point

        public RepointableActorRef point​(boolean catchFailures)
        This method is supposed to be called by the supervisor in handleSupervise() to replace the UnstartedCell with the real one. It assumes no concurrent modification of the underlying field, though it is safe to send messages at any time.
      • props

        public Props props()
      • resume

        public void resume​(java.lang.Throwable causedByFailure)
        Specified by:
        resume in class InternalActorRef
      • swapCell

        public final Cell swapCell​(Cell next)
      • swapLookup

        public final Cell swapLookup​(Cell next)
      • writeReplace

        protected java.lang.Object writeReplace()