public class AkkaActorGateway extends Object implements ActorGateway, Serializable
ActorGateway implementation which uses Akka to communicate with remote actors.| Constructor and Description |
|---|
AkkaActorGateway(akka.actor.ActorRef actor,
UUID leaderSessionID) |
| Modifier and Type | Method and Description |
|---|---|
akka.actor.ActorRef |
actor()
Returns
ActorRef of the target actor |
scala.concurrent.Future<Object> |
ask(Object message,
scala.concurrent.duration.FiniteDuration timeout)
Sends a message asynchronously and returns its response.
|
void |
forward(Object message,
ActorGateway sender)
Forwards a message.
|
UUID |
leaderSessionID()
Returns the leaderSessionID associated with the remote actor or null.
|
String |
path()
Returns the ActorPath of the remote instance.
|
scala.concurrent.Future<Object> |
retry(Object message,
int numberRetries,
scala.concurrent.duration.FiniteDuration timeout,
scala.concurrent.ExecutionContext executionContext)
Retries to send asynchronously a message up to numberRetries times.
|
void |
tell(Object message)
Sends a message asynchronously without a result.
|
void |
tell(Object message,
ActorGateway sender)
Sends a message asynchronously without a result with sender being the sender.
|
String |
toString() |
public AkkaActorGateway(akka.actor.ActorRef actor,
UUID leaderSessionID)
public scala.concurrent.Future<Object> ask(Object message, scala.concurrent.duration.FiniteDuration timeout)
ask in interface ActorGatewaymessage - Message to be senttimeout - Timeout until the Future is completed with an AskTimeoutExceptionpublic void tell(Object message)
tell in interface ActorGatewaymessage - Message to be sentpublic void tell(Object message, ActorGateway sender)
tell in interface ActorGatewaymessage - Message to be sentsender - Sender of the messagepublic void forward(Object message, ActorGateway sender)
forward in interface ActorGatewaymessage - Message to be sentsender - Sender of the forwarded messagepublic scala.concurrent.Future<Object> retry(Object message, int numberRetries, scala.concurrent.duration.FiniteDuration timeout, scala.concurrent.ExecutionContext executionContext)
retry in interface ActorGatewaymessage - Message to be sentnumberRetries - Number of times to retry sending the messagetimeout - Timeout for each sending attemptexecutionContext - ExecutionContext which is used to send the message multiple timespublic String path()
path in interface ActorGatewaypublic akka.actor.ActorRef actor()
ActorRef of the target actoractor in interface ActorGatewaypublic UUID leaderSessionID()
ActorGatewayleaderSessionID in interface ActorGatewayCopyright © 2014–2016 The Apache Software Foundation. All rights reserved.