Package akka.pattern
Class PromiseActorRef
- java.lang.Object
-
- akka.actor.ActorRef
-
- akka.actor.InternalActorRef
-
- akka.pattern.PromiseActorRef
-
- All Implemented Interfaces:
ActorRefScope
,LocalRef
,MinimalActorRef
,ScalaActorRef
,java.io.Serializable
,java.lang.Comparable<ActorRef>
public final class PromiseActorRef extends InternalActorRef implements MinimalActorRef
Akka private optimized representation of the temporary actor spawned to receive the reply to an "ask" operation.INTERNAL API
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PromiseActorRef()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
$bang(java.lang.Object message, ActorRef sender)
Scala API: Sends a one-way asynchronous message.ActorRef
$bang$default$2(java.lang.Object message)
static PromiseActorRef
apply(ActorRefProvider provider, Timeout timeout, java.lang.Object targetName, java.lang.String messageClassName, java.lang.String refPathPrefix, ActorRef sender, scala.Function1<java.lang.String,java.lang.Throwable> onTimeout)
static ActorRef
apply$default$6()
static scala.Function1<java.lang.String,java.lang.Throwable>
apply$default$7()
scala.concurrent.Future<java.lang.Object>
ask(ActorRef actorRef, java.lang.Object message, Timeout timeout)
scala.concurrent.Future<java.lang.Object>
ask(ActorSelection actorSel, java.lang.Object message, Timeout timeout)
InternalActorRef
getParent()
Obtain parent of this ref; used by getChild for ".." paths.boolean
isTerminated()
INTERNAL API: Returns “true” if the actor is locally known to be terminated, “false” if alive or uncertain.java.lang.String
messageClassName()
void
messageClassName_$eq(java.lang.String x$1)
void
onComplete(java.lang.Object message, boolean alreadyCompleted)
void
onTimeout(Timeout timeout)
ActorPath
path()
Contract of this method: Must always return the same ActorPath, which must have been registered if we haven't been stopped yet.ActorRefProvider
provider()
Get a reference to the actor ref provider which created this ref.scala.concurrent.Promise<java.lang.Object>
result()
void
sendSystemMessage(SystemMessage message)
void
stop()
-
Methods inherited from class akka.actor.InternalActorRef
getChild, isLocal, isTemporaryRef, restart, resume, start, suspend
-
Methods inherited from class akka.actor.ActorRef
compareTo, equals, forward, hashCode, noSender, tell, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface akka.actor.MinimalActorRef
getChild, restart, resume, start, suspend, writeReplace
-
-
-
-
Method Detail
-
apply
public static PromiseActorRef apply(ActorRefProvider provider, Timeout timeout, java.lang.Object targetName, java.lang.String messageClassName, java.lang.String refPathPrefix, ActorRef sender, scala.Function1<java.lang.String,java.lang.Throwable> onTimeout)
-
apply$default$6
public static ActorRef apply$default$6()
-
apply$default$7
public static scala.Function1<java.lang.String,java.lang.Throwable> apply$default$7()
-
provider
public ActorRefProvider provider()
Description copied from class:InternalActorRef
Get a reference to the actor ref provider which created this ref.- Specified by:
provider
in classInternalActorRef
-
result
public scala.concurrent.Promise<java.lang.Object> result()
-
messageClassName
public java.lang.String messageClassName()
-
messageClassName_$eq
public void messageClassName_$eq(java.lang.String x$1)
-
getParent
public InternalActorRef getParent()
Description copied from class:InternalActorRef
Obtain parent of this ref; used by getChild for ".." paths.- Specified by:
getParent
in interfaceMinimalActorRef
- Specified by:
getParent
in classInternalActorRef
-
path
public ActorPath path()
Contract of this method: Must always return the same ActorPath, which must have been registered if we haven't been stopped yet.
-
$bang
public void $bang(java.lang.Object message, ActorRef sender)
Description copied from class:ActorRef
Scala API: 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 interfaceMinimalActorRef
- Specified by:
$bang
in interfaceScalaActorRef
- Specified by:
$bang
in classActorRef
-
sendSystemMessage
public void sendSystemMessage(SystemMessage message)
- Specified by:
sendSystemMessage
in interfaceMinimalActorRef
- Specified by:
sendSystemMessage
in classInternalActorRef
-
isTerminated
public boolean isTerminated()
Description copied from class:InternalActorRef
INTERNAL API: Returns “true” if the actor is locally known to be terminated, “false” if alive or uncertain.- Specified by:
isTerminated
in interfaceMinimalActorRef
- Specified by:
isTerminated
in classInternalActorRef
-
stop
public void stop()
- Specified by:
stop
in interfaceMinimalActorRef
- Specified by:
stop
in classInternalActorRef
-
ask
public scala.concurrent.Future<java.lang.Object> ask(ActorSelection actorSel, java.lang.Object message, Timeout timeout)
-
ask
public scala.concurrent.Future<java.lang.Object> ask(ActorRef actorRef, java.lang.Object message, Timeout timeout)
-
onComplete
public void onComplete(java.lang.Object message, boolean alreadyCompleted)
-
onTimeout
public void onTimeout(Timeout timeout)
-
$bang$default$2
public ActorRef $bang$default$2(java.lang.Object message)
- Specified by:
$bang$default$2
in interfaceMinimalActorRef
- Specified by:
$bang$default$2
in interfaceScalaActorRef
- Overrides:
$bang$default$2
in classActorRef
-
-