Package akka.actor
Class Inbox
- java.lang.Object
-
- akka.actor.Inbox
-
- Direct Known Subclasses:
Inbox$Inbox
public abstract class Inbox extends java.lang.ObjectReceive 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 aTimeoutExceptionwill be raised.
-
-
Constructor Summary
Constructors Constructor Description Inbox()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Inboxcreate(ActorSystem system)abstract ActorRefgetRef()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 anActorRef.java.lang.Objectreceive(java.time.Duration max)Receive the next message from this Inbox.abstract java.lang.Objectreceive(scala.concurrent.duration.FiniteDuration max)abstract voidsend(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 voidwatch(ActorRef target)Have the internal actor watch the target actor.
-
-
-
Method Detail
-
create
public static Inbox create(ActorSystem system)
-
receive
public abstract java.lang.Object receive(scala.concurrent.duration.FiniteDuration max) throws java.util.concurrent.TimeoutException- Throws:
java.util.concurrent.TimeoutException
-
receive
public java.lang.Object receive(java.time.Duration max) throws java.util.concurrent.TimeoutExceptionReceive 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 aTimeoutExceptionwill 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 aTerminatedmessage 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 anActorRef.- 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)
-
-