Package akka.cluster

Class ClusterRemoteWatcher

  • All Implemented Interfaces:
    Actor, ActorLogging, RequiresMessageQueue<UnboundedMessageQueueSemantics>

    public class ClusterRemoteWatcher
    extends RemoteWatcher

    Specialization of RemoteWatcher that keeps track of cluster member nodes and is responsible for watchees on cluster nodes. AddressTerminated 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.

    • 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

      • cluster

        public Cluster cluster()
      • clusterNodes

        public scala.collection.immutable.Set<Address> clusterNodes()
      • clusterNodes_$eq

        public void clusterNodes_$eq​(scala.collection.immutable.Set<Address> x$1)
      • 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
        postStop in class RemoteWatcher
      • receive

        public scala.PartialFunction<java.lang.Object,​scala.runtime.BoxedUnit> receive()
        Description copied from interface: Actor
        Scala API: This defines the initial actor behavior, it must return a partial function with the actor logic.
        Specified by:
        receive in interface Actor
        receive in class RemoteWatcher
      • receiveClusterEvent

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

        public void memberUp​(Member m)
      • quarantineOldIncarnation

        public void quarantineOldIncarnation​(Member newIncarnation)
      • delayedQuarantine

        public void delayedQuarantine​(Member m,
                                      MemberStatus previousStatus)
      • shouldWatch

        protected boolean shouldWatch​(InternalActorRef watchee)
        Description copied from class: RemoteWatcher
        Returns true if either has cluster or akka.remote.use-unsafe-remote-features-outside-cluster is enabled. Can be overridden when using RemoteWatcher as a superclass.
        shouldWatch in class RemoteWatcher
      • 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.