|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object akka.contrib.pattern.ClusterClient
public class ClusterClient
This actor is intended to be used on an external node that is not member
of the cluster. It acts like a gateway for sending messages to actors
somewhere in the cluster. From the initial contact points it will establish
a connection to a ClusterReceptionist
somewhere in the cluster. It will
monitor the connection to the receptionist and establish a new connection if
the link goes down. When looking for a new receptionist it uses fresh contact
points retrieved from previous establishment, or periodically refreshed
contacts, i.e. not necessarily the initial contact points.
You can send messages via the ClusterClient
to any actor in the cluster
that is registered in the ClusterReceptionist
.
Messages are wrapped in ClusterClient.Send
, ClusterClient.SendToAll
or ClusterClient.Publish
.
1. ClusterClient.Send
-
The message will be delivered to one recipient with a matching path, if any such
exists. If several entries match the path the message will be delivered
to one random destination. The sender of the message can specify that local
affinity is preferred, i.e. the message is sent to an actor in the same local actor
system as the used receptionist actor, if any such exists, otherwise random to any other
matching entry.
2. ClusterClient.SendToAll
-
The message will be delivered to all recipients with a matching path.
3. ClusterClient.Publish
-
The message will be delivered to all recipients Actors that have been registered as subscribers to
to the named topic.
Use the factory method props(scala.collection.immutable.Set
) to create the
Props
for the actor.
Nested Class Summary | |
---|---|
static class |
ClusterClient.Internal$
INTERNAL API |
static class |
ClusterClient.Publish
|
static class |
ClusterClient.Publish$
|
static class |
ClusterClient.Send
|
static class |
ClusterClient.Send$
|
static class |
ClusterClient.SendToAll
|
static class |
ClusterClient.SendToAll$
|
Nested classes/interfaces inherited from interface akka.actor.Actor |
---|
Actor.emptyBehavior$ |
Constructor Summary | |
---|---|
ClusterClient(scala.collection.immutable.Set<ActorSelection> initialContacts,
scala.concurrent.duration.FiniteDuration establishingGetContactsInterval,
scala.concurrent.duration.FiniteDuration refreshContactsInterval)
|
Method Summary | |
---|---|
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
active(ActorRef receptionist)
|
com.typesafe.config.Config |
config()
|
scala.collection.immutable.IndexedSeq<ActorSelection> |
contacts()
|
static Props |
defaultProps(java.util.Set<ActorSelection> initialContacts)
Java API: Factory method for ClusterClient Props with
default values. |
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
establishing()
|
DeadlineFailureDetector |
failureDetector()
|
scala.concurrent.duration.FiniteDuration |
heartbeatInterval()
|
Cancellable |
heartbeatTask()
|
void |
postStop()
User overridable callback. |
static Props |
props(scala.collection.immutable.Set<ActorSelection> initialContacts,
scala.concurrent.duration.FiniteDuration establishingGetContactsInterval,
scala.concurrent.duration.FiniteDuration refreshContactsInterval)
Scala API: Factory method for ClusterClient Props . |
static Props |
props(java.util.Set<ActorSelection> initialContacts,
scala.concurrent.duration.FiniteDuration establishingGetContactsInterval,
scala.concurrent.duration.FiniteDuration refreshContactsInterval)
Java API: Factory method for ClusterClient 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. |
scala.Option<Cancellable> |
refreshContactsTask()
|
void |
scheduleRefreshContactsTick(scala.concurrent.duration.FiniteDuration interval)
|
void |
sendGetContacts()
|
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, preStart, self, sender, supervisorStrategy, unhandled |
Methods inherited from interface akka.actor.StashSupport |
---|
actorCell, capacity, clearStash, context, enqueueFirst, mailbox, prepend, self, stash, theStash, unstash, unstashAll, unstashAll |
Methods inherited from interface akka.actor.ActorLogging |
---|
_log, log |
Constructor Detail |
---|
public ClusterClient(scala.collection.immutable.Set<ActorSelection> initialContacts, scala.concurrent.duration.FiniteDuration establishingGetContactsInterval, scala.concurrent.duration.FiniteDuration refreshContactsInterval)
Method Detail |
---|
public static Props props(scala.collection.immutable.Set<ActorSelection> initialContacts, scala.concurrent.duration.FiniteDuration establishingGetContactsInterval, scala.concurrent.duration.FiniteDuration refreshContactsInterval)
ClusterClient
Props
.
initialContacts
- (undocumented)establishingGetContactsInterval
- (undocumented)refreshContactsInterval
- (undocumented)
public static Props props(java.util.Set<ActorSelection> initialContacts, scala.concurrent.duration.FiniteDuration establishingGetContactsInterval, scala.concurrent.duration.FiniteDuration refreshContactsInterval)
ClusterClient
Props
.
initialContacts
- (undocumented)establishingGetContactsInterval
- (undocumented)refreshContactsInterval
- (undocumented)
public static Props defaultProps(java.util.Set<ActorSelection> initialContacts)
ClusterClient
Props
with
default values.
initialContacts
- (undocumented)
public com.typesafe.config.Config config()
public scala.concurrent.duration.FiniteDuration heartbeatInterval()
public DeadlineFailureDetector failureDetector()
public scala.collection.immutable.IndexedSeq<ActorSelection> contacts()
public Cancellable heartbeatTask()
public scala.Option<Cancellable> refreshContactsTask()
public void scheduleRefreshContactsTick(scala.concurrent.duration.FiniteDuration interval)
public void postStop()
Actor
postStop
in interface Actor
postStop
in interface UnrestrictedStash
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
Actor
receive
in interface Actor
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> establishing()
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> active(ActorRef receptionist)
public void sendGetContacts()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |