akka.cluster
Class ClusterRemoteWatcher

java.lang.Object
  extended by akka.remote.RemoteWatcher
      extended by akka.cluster.ClusterRemoteWatcher
All Implemented Interfaces:
Actor, ActorLogging, RequiresMessageQueue<UnboundedMessageQueueSemantics>

public class ClusterRemoteWatcher
extends RemoteWatcher

INTERNAL API

Specialization of RemoteWatcher that keeps track of cluster member nodes and is responsible for watchees on cluster nodes. akka.actor.AddressTerminate is published when node is removed from cluster.

RemoteWatcher handles non-cluster nodes. ClusterRemoteWatcher will take over responsibility from RemoteWatcher if a watch is added before a node is member of the cluster and then later becomes cluster member.


Nested Class Summary
 
Nested classes/interfaces inherited from class akka.remote.RemoteWatcher
RemoteWatcher.ExpectedFirstHeartbeat, RemoteWatcher.ExpectedFirstHeartbeat$, RemoteWatcher.Heartbeat$, RemoteWatcher.HeartbeatRsp, RemoteWatcher.HeartbeatRsp$, RemoteWatcher.HeartbeatTick$, RemoteWatcher.ReapUnreachableTick$, RemoteWatcher.Rewatch, RemoteWatcher.RewatchRemote, RemoteWatcher.RewatchRemote$, RemoteWatcher.Stats, RemoteWatcher.Stats$, RemoteWatcher.UnwatchRemote, RemoteWatcher.UnwatchRemote$, RemoteWatcher.WatchRemote, RemoteWatcher.WatchRemote$
 
Nested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$
 
Constructor Summary
ClusterRemoteWatcher(FailureDetectorRegistry<Address> failureDetector, scala.concurrent.duration.FiniteDuration heartbeatInterval, scala.concurrent.duration.FiniteDuration unreachableReaperInterval, scala.concurrent.duration.FiniteDuration heartbeatExpectedResponseAfter)
           
 
Method Summary
 Cluster cluster()
           
 scala.collection.immutable.Set<Address> clusterNodes()
           
 void postStop()
          User overridable callback.
 void preStart()
          User overridable callback.
static Props props(FailureDetectorRegistry<Address> failureDetector, scala.concurrent.duration.FiniteDuration heartbeatInterval, scala.concurrent.duration.FiniteDuration unreachableReaperInterval, scala.concurrent.duration.FiniteDuration heartbeatExpectedResponseAfter)
          Factory method for ClusterRemoteWatcher 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.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveClusterEvent()
           
 void takeOverResponsibility(Address address)
          When a cluster node is added this class takes over the responsibility for watchees on that node already handled by super RemoteWatcher.
 
Methods inherited from class akka.remote.RemoteWatcher
addressUids, addWatching, checkLastUnwatchOfNode, failureDetectorReaperTask, heartbeatTask, logActorForDeprecationWarning, publishAddressTerminated, quarantine, reapUnreachable, receiveHeartbeat, receiveHeartbeatRsp, remoteProvider, reWatch, rewatchRemote, scheduler, selfHeartbeatRspMsg, sendHeartbeat, terminated, triggerFirstHeartbeat, unreachable, unwatchRemote, watching, watchingNodes, watchRemote
 
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

ClusterRemoteWatcher

public ClusterRemoteWatcher(FailureDetectorRegistry<Address> failureDetector,
                            scala.concurrent.duration.FiniteDuration heartbeatInterval,
                            scala.concurrent.duration.FiniteDuration unreachableReaperInterval,
                            scala.concurrent.duration.FiniteDuration heartbeatExpectedResponseAfter)
Method Detail

props

public static Props props(FailureDetectorRegistry<Address> failureDetector,
                          scala.concurrent.duration.FiniteDuration heartbeatInterval,
                          scala.concurrent.duration.FiniteDuration unreachableReaperInterval,
                          scala.concurrent.duration.FiniteDuration heartbeatExpectedResponseAfter)
Factory method for ClusterRemoteWatcher Props.

Parameters:
failureDetector - (undocumented)
heartbeatInterval - (undocumented)
unreachableReaperInterval - (undocumented)
heartbeatExpectedResponseAfter - (undocumented)
Returns:
(undocumented)

cluster

public Cluster cluster()

clusterNodes

public scala.collection.immutable.Set<Address> clusterNodes()

preStart

public void preStart()
Description copied from interface: Actor
User overridable callback.

Is called when an Actor is started. Actors are automatically started asynchronously when created. Empty default implementation.


postStop

public void postStop()
Description copied from interface: Actor
User overridable callback.

Is called asynchronously after 'actor.stop()' is invoked. Empty default implementation.

Specified by:
postStop in interface Actor
Overrides:
postStop in class RemoteWatcher

receive

public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
Description copied from interface: Actor
This defines the initial actor behavior, it must return a partial function with the actor logic.

Specified by:
receive in interface Actor
Overrides:
receive in class RemoteWatcher
Returns:
(undocumented)

receiveClusterEvent

public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveClusterEvent()

takeOverResponsibility

public void takeOverResponsibility(Address address)
When a cluster node is added this class takes over the responsibility for watchees on that node already handled by super RemoteWatcher.

Parameters:
address - (undocumented)