Package akka.actor

Class Inbox

  • Direct Known Subclasses:
    Inbox.Inbox

    public abstract class Inbox
    extends java.lang.Object
    An Inbox is an actor-like object which is interrogated from the outside. It contains an actor whose reference can be passed to other actors as usual and it can watch other actors’ lifecycle.
    • Constructor Summary

      Constructors 
      Constructor Description
      Inbox()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      static Inbox create​(ActorSystem system)
      Create a new Inbox within the given system.
      abstract ActorRef getRef()
      Obtain a reference to the internal actor, which can then for example be registered with the event stream or whatever else you may want to do with an ActorRef.
      java.lang.Object receive​(java.time.Duration max)
      Receive the next message from this Inbox.
      abstract java.lang.Object receive​(scala.concurrent.duration.FiniteDuration max)
      Receive the next message from this Inbox.
      abstract void send​(ActorRef target, java.lang.Object msg)
      Have the internal actor act as the sender of the given message which will be sent to the given target.
      abstract void watch​(ActorRef target)
      Have the internal actor watch the target actor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Inbox

        public Inbox()
    • Method Detail

      • create

        public static Inbox create​(ActorSystem system)
        Create a new Inbox within the given system.
        Parameters:
        system - (undocumented)
        Returns:
        (undocumented)
      • receive

        public abstract java.lang.Object receive​(scala.concurrent.duration.FiniteDuration max)
                                          throws java.util.concurrent.TimeoutException
        Receive the next message from this Inbox. This call will return immediately if the internal actor previously received a message, or it will block for up to the specified duration to await reception of a message. If no message is received a TimeoutException will be raised.
        Parameters:
        max - (undocumented)
        Returns:
        (undocumented)
        Throws:
        java.util.concurrent.TimeoutException
      • receive

        public java.lang.Object receive​(java.time.Duration max)
                                 throws java.util.concurrent.TimeoutException
        Receive the next message from this Inbox. This call will return immediately if the internal actor previously received a message, or it will block for up to the specified duration to await reception of a message. If no message is received a TimeoutException will be raised.
        Parameters:
        max - (undocumented)
        Returns:
        (undocumented)
        Throws:
        java.util.concurrent.TimeoutException
      • watch

        public abstract void watch​(ActorRef target)
        Have the internal actor watch the target actor. When the target actor terminates a Terminated message will be received.
        Parameters:
        target - (undocumented)
      • getRef

        public abstract ActorRef getRef()
        Obtain a reference to the internal actor, which can then for example be registered with the event stream or whatever else you may want to do with an ActorRef.
        Returns:
        (undocumented)
      • send

        public abstract void send​(ActorRef target,
                                  java.lang.Object msg)
        Have the internal actor act as the sender of the given message which will be sent to the given target. This means that should the target actor reply then those replies will be received by this Inbox.
        Parameters:
        target - (undocumented)
        msg - (undocumented)