Package akka.actor

Class ActorRef

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ActorRef>, scala.Serializable
    Direct Known Subclasses:
    InternalActorRef

    public abstract class ActorRef
    extends java.lang.Object
    implements java.lang.Comparable<ActorRef>, scala.Serializable
    Returns the path for this actor (from this actor up to the root actor).
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ActorRef()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(ActorRef other)
      Comparison takes path and the unique id of the actor cell into account.
      boolean equals​(java.lang.Object that)
      Equals takes path and the unique id of the actor cell into account.
      void forward​(java.lang.Object message, ActorContext context)
      Forwards the message and passes the original sender actor as the sender.
      int hashCode()  
      abstract boolean isTerminated()
      INTERNAL API Is the actor shut down? The contract is that if this method returns true, then it will never be false again.
      static ActorRef noSender()  
      abstract ActorPath path()  
      void tell​(java.lang.Object msg, ActorRef sender)
      Sends the specified message to this ActorRef, i.e.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ActorRef

        public ActorRef()
    • Method Detail

      • noSender

        public static final ActorRef noSender()
      • compareTo

        public final int compareTo​(ActorRef other)
        Comparison takes path and the unique id of the actor cell into account.
        Specified by:
        compareTo in interface java.lang.Comparable<ActorRef>
        Parameters:
        other - (undocumented)
        Returns:
        (undocumented)
      • tell

        public final void tell​(java.lang.Object msg,
                               ActorRef sender)
        Sends the specified message to this ActorRef, i.e. fire-and-forget semantics, including the sender reference if possible.

        Pass ActorRef noSender or null as sender if there is nobody to reply to

        Parameters:
        msg - (undocumented)
        sender - (undocumented)
      • forward

        public void forward​(java.lang.Object message,
                            ActorContext context)
        Forwards the message and passes the original sender actor as the sender.

        Works, no matter whether originally sent with tell/'!' or ask/'?'.

        Parameters:
        message - (undocumented)
        context - (undocumented)
      • isTerminated

        public abstract boolean isTerminated()
        INTERNAL API Is the actor shut down? The contract is that if this method returns true, then it will never be false again. But you cannot rely on that it is alive if it returns false, since this by nature is a racy method.
        Returns:
        (undocumented)
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public final boolean equals​(java.lang.Object that)
        Equals takes path and the unique id of the actor cell into account.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        that - (undocumented)
        Returns:
        (undocumented)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object