|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object akka.contrib.pattern.ClusterReceptionist
public class ClusterReceptionist
ClusterClient
connects to this actor to retrieve. The ClusterReceptionist
is
supposed to be started on all nodes, or all nodes with specified role, in the cluster.
The receptionist can be started with the ClusterReceptionistExtension
or as an
ordinary actor (use the factory method props(akka.actor.ActorRef, scala.Option
).
The receptionist forwards messages from the client to the associated DistributedPubSubMediator
,
i.e. the client can send messages to any actor in the cluster that is registered in the
DistributedPubSubMediator
. Messages from the client are wrapped in
DistributedPubSubMediator.Send
, DistributedPubSubMediator.SendToAll
or DistributedPubSubMediator.Publish
with the semantics described in
DistributedPubSubMediator
.
Response messages from the destination actor are tunneled via the receptionist
to avoid inbound connections from other cluster nodes to the client, i.e.
the sender
, as seen by the destination actor, is not the client itself.
The sender
of the response messages, as seen by the client, is preserved
as the original sender, so the client can choose to send subsequent messages
directly to the actor in the cluster.
Nested Class Summary | |
---|---|
static class |
ClusterReceptionist.Internal$
INTERNAL API |
Nested classes/interfaces inherited from interface akka.actor.Actor |
---|
Actor.emptyBehavior$ |
Constructor Summary | |
---|---|
ClusterReceptionist(ActorRef pubSubMediator,
scala.Option<java.lang.String> role,
int numberOfContacts,
scala.concurrent.duration.FiniteDuration responseTunnelReceiveTimeout)
|
Method Summary | |
---|---|
Cluster |
cluster()
|
ConsistentHash<Address> |
consistentHash()
|
boolean |
matchingRole(Member m)
|
scala.collection.immutable.SortedSet<Address> |
nodes()
|
void |
postStop()
User overridable callback. |
void |
preStart()
User overridable callback. |
static Props |
props(ActorRef pubSubMediator,
scala.Option<java.lang.String> role,
int numberOfContacts,
scala.concurrent.duration.FiniteDuration responseTunnelReceiveTimeout)
Scala API: Factory method for ClusterReceptionist Props . |
static Props |
props(ActorRef pubSubMediator,
java.lang.String role)
Java API: Factory method for ClusterReceptionist Props
with default values. |
static Props |
props(ActorRef pubSubMediator,
java.lang.String role,
int numberOfContacts,
scala.concurrent.duration.FiniteDuration responseTunnelReceiveTimeout)
Java API: Factory method for ClusterReceptionist Props . |
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
receive()
This defines the initial actor behavior, it must return a partial function with the actor logic. |
ActorRef |
responseTunnel(ActorRef client)
|
int |
virtualNodesFactor()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface akka.actor.Actor |
---|
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, postRestart, preRestart, self, sender, supervisorStrategy, unhandled |
Methods inherited from interface akka.actor.ActorLogging |
---|
_log, log |
Constructor Detail |
---|
public ClusterReceptionist(ActorRef pubSubMediator, scala.Option<java.lang.String> role, int numberOfContacts, scala.concurrent.duration.FiniteDuration responseTunnelReceiveTimeout)
Method Detail |
---|
public static Props props(ActorRef pubSubMediator, scala.Option<java.lang.String> role, int numberOfContacts, scala.concurrent.duration.FiniteDuration responseTunnelReceiveTimeout)
ClusterReceptionist
Props
.
pubSubMediator
- (undocumented)role
- (undocumented)numberOfContacts
- (undocumented)responseTunnelReceiveTimeout
- (undocumented)
public static Props props(ActorRef pubSubMediator, java.lang.String role, int numberOfContacts, scala.concurrent.duration.FiniteDuration responseTunnelReceiveTimeout)
ClusterReceptionist
Props
.
pubSubMediator
- (undocumented)role
- (undocumented)numberOfContacts
- (undocumented)responseTunnelReceiveTimeout
- (undocumented)
public static Props props(ActorRef pubSubMediator, java.lang.String role)
ClusterReceptionist
Props
with default values.
pubSubMediator
- (undocumented)role
- (undocumented)
public Cluster cluster()
public scala.collection.immutable.SortedSet<Address> nodes()
public int virtualNodesFactor()
public ConsistentHash<Address> consistentHash()
public void preStart()
Actor
preStart
in interface Actor
public void postStop()
Actor
postStop
in interface Actor
public boolean matchingRole(Member m)
public ActorRef responseTunnel(ActorRef client)
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
Actor
receive
in interface Actor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |