Package akka.remote
Class RemoteWatcher
- java.lang.Object
-
- akka.remote.RemoteWatcher
-
- All Implemented Interfaces:
Actor,ActorLogging,RequiresMessageQueue<UnboundedMessageQueueSemantics>
- Direct Known Subclasses:
ClusterRemoteWatcher
public class RemoteWatcher extends java.lang.Object implements Actor, ActorLogging, RequiresMessageQueue<UnboundedMessageQueueSemantics>
To ensure that we receive heartbeat messages from the right actor system incarnation we send Watch again for the first HeartbeatRsp (containing the system UID) and if HeartbeatRsp contains a new system UID. Terminated will be triggered if the watchee (including correct Actor UID) does not exist.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRemoteWatcher.ArteryHeartbeat$static classRemoteWatcher.ArteryHeartbeatRspstatic classRemoteWatcher.ArteryHeartbeatRsp$static classRemoteWatcher.ExpectedFirstHeartbeatstatic classRemoteWatcher.ExpectedFirstHeartbeat$static classRemoteWatcher.Heartbeat$static classRemoteWatcher.HeartbeatRspstatic classRemoteWatcher.HeartbeatRsp$static classRemoteWatcher.HeartbeatTick$static classRemoteWatcher.ReapUnreachableTick$static classRemoteWatcher.Statsstatic classRemoteWatcher.Stats$static classRemoteWatcher.UnwatchRemotestatic classRemoteWatcher.UnwatchRemote$static classRemoteWatcher.WatchRemotestatic classRemoteWatcher.WatchRemote$-
Nested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$, Actor.ignoringBehavior$
-
-
Constructor Summary
Constructors Constructor Description RemoteWatcher(FailureDetectorRegistry<Address> failureDetector, scala.concurrent.duration.FiniteDuration heartbeatInterval, scala.concurrent.duration.FiniteDuration unreachableReaperInterval, scala.concurrent.duration.FiniteDuration heartbeatExpectedResponseAfter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description scala.collection.immutable.Map<Address,java.lang.Object>addressUids()voidaddressUids_$eq(scala.collection.immutable.Map<Address,java.lang.Object> x$1)voidaddWatch(InternalActorRef watchee, InternalActorRef watcher)protected voidakka$actor$Actor$_setter_$context_$eq(ActorContext x$1)protected voidakka$actor$Actor$_setter_$self_$eq(ActorRef x$1)The 'self' field holds the ActorRef for this actor.booleanartery()ActorContextcontext()Scala API: Stores the context for this actor, including self, and sender.CancellablefailureDetectorReaperTask()HeartbeatMessageheartBeatMsg()CancellableheartbeatTask()voidpostStop()User overridable callback.static Propsprops(FailureDetectorRegistry<Address> failureDetector, scala.concurrent.duration.FiniteDuration heartbeatInterval, scala.concurrent.duration.FiniteDuration unreachableReaperInterval, scala.concurrent.duration.FiniteDuration heartbeatExpectedResponseAfter)voidpublishAddressTerminated(Address address)voidquarantine(Address address, scala.Option<java.lang.Object> uid, java.lang.String reason, boolean harmless)voidreapUnreachable()scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit>receive()Scala API: This defines the initial actor behavior, it must return a partial function with the actor logic.voidreceiveHeartbeat()voidreceiveHeartbeatRsp(long uid)RemoteActorRefProviderremoteProvider()voidremoveWatch(InternalActorRef watchee, InternalActorRef watcher)voidremoveWatchee(InternalActorRef watchee)voidreWatch(Address address)To ensure that we receive heartbeat messages from the right actor system incarnation we send Watch again for the first HeartbeatRsp (containing the system UID) and if HeartbeatRsp contains a new system UID.Schedulerscheduler()ActorRefself()The 'self' field holds the ActorRef for this actor.HeartbeatMessageselfHeartbeatRspMsg()voidsendHeartbeat()voidterminated(InternalActorRef watchee, boolean existenceConfirmed, boolean addressTerminated)voidtriggerFirstHeartbeat(Address address)scala.collection.immutable.Set<Address>unreachable()voidunreachable_$eq(scala.collection.immutable.Set<Address> x$1)voidunwatchNode(Address watcheeAddress)scala.collection.mutable.HashMap<Address,scala.collection.mutable.Set<InternalActorRef>>watcheeByNodes()scala.collection.mutable.HashMap<InternalActorRef,scala.collection.mutable.Set<InternalActorRef>>watching()scala.collection.Set<Address>watchingNodes()voidwatchNode(InternalActorRef watchee)-
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, postRestart, preRestart, preStart, sender, supervisorStrategy, unhandled
-
Methods inherited from interface akka.actor.ActorLogging
_log_$eq, log
-
-
-
-
Constructor Detail
-
RemoteWatcher
public RemoteWatcher(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)
-
context
public ActorContext context()
Description copied from interface:ActorScala API: Stores the context for this actor, including self, and sender. It is implicit to support operations such asforward.WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!
ActorContextis the Scala API.getContextreturns aAbstractActor.ActorContext, which is the Java API of the actor context.
-
self
public final ActorRef self()
Description copied from interface:ActorThe 'self' field holds the ActorRef for this actor. Can be used to send messages to itself:self ! message
-
akka$actor$Actor$_setter_$context_$eq
protected void akka$actor$Actor$_setter_$context_$eq(ActorContext x$1)
- Specified by:
akka$actor$Actor$_setter_$context_$eqin interfaceActor
-
akka$actor$Actor$_setter_$self_$eq
protected final void akka$actor$Actor$_setter_$self_$eq(ActorRef x$1)
Description copied from interface:ActorThe 'self' field holds the ActorRef for this actor. Can be used to send messages to itself:self ! message
- Specified by:
akka$actor$Actor$_setter_$self_$eqin interfaceActor- Parameters:
x$1- (undocumented)
-
scheduler
public Scheduler scheduler()
-
remoteProvider
public RemoteActorRefProvider remoteProvider()
-
artery
public boolean artery()
-
heartBeatMsg
public HeartbeatMessage heartBeatMsg()
-
selfHeartbeatRspMsg
public HeartbeatMessage selfHeartbeatRspMsg()
-
watching
public scala.collection.mutable.HashMap<InternalActorRef,scala.collection.mutable.Set<InternalActorRef>> watching()
-
watcheeByNodes
public scala.collection.mutable.HashMap<Address,scala.collection.mutable.Set<InternalActorRef>> watcheeByNodes()
-
watchingNodes
public scala.collection.Set<Address> watchingNodes()
-
unreachable
public scala.collection.immutable.Set<Address> unreachable()
-
unreachable_$eq
public void unreachable_$eq(scala.collection.immutable.Set<Address> x$1)
-
addressUids
public scala.collection.immutable.Map<Address,java.lang.Object> addressUids()
-
addressUids_$eq
public void addressUids_$eq(scala.collection.immutable.Map<Address,java.lang.Object> x$1)
-
heartbeatTask
public Cancellable heartbeatTask()
-
failureDetectorReaperTask
public Cancellable failureDetectorReaperTask()
-
postStop
public void postStop()
Description copied from interface:ActorUser overridable callback. Is called asynchronously after 'actor.stop()' is invoked. Empty default implementation.
-
receive
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
Description copied from interface:ActorScala API: This defines the initial actor behavior, it must return a partial function with the actor logic.
-
receiveHeartbeat
public void receiveHeartbeat()
-
receiveHeartbeatRsp
public void receiveHeartbeatRsp(long uid)
-
reapUnreachable
public void reapUnreachable()
-
publishAddressTerminated
public void publishAddressTerminated(Address address)
-
quarantine
public void quarantine(Address address, scala.Option<java.lang.Object> uid, java.lang.String reason, boolean harmless)
-
addWatch
public void addWatch(InternalActorRef watchee, InternalActorRef watcher)
-
watchNode
public void watchNode(InternalActorRef watchee)
-
removeWatch
public void removeWatch(InternalActorRef watchee, InternalActorRef watcher)
-
removeWatchee
public void removeWatchee(InternalActorRef watchee)
-
unwatchNode
public void unwatchNode(Address watcheeAddress)
-
terminated
public void terminated(InternalActorRef watchee, boolean existenceConfirmed, boolean addressTerminated)
-
sendHeartbeat
public void sendHeartbeat()
-
triggerFirstHeartbeat
public void triggerFirstHeartbeat(Address address)
-
reWatch
public void reWatch(Address address)
To ensure that we receive heartbeat messages from the right actor system incarnation we send Watch again for the first HeartbeatRsp (containing the system UID) and if HeartbeatRsp contains a new system UID. Terminated will be triggered if the watchee (including correct Actor UID) does not exist.- Parameters:
address- (undocumented)
-
-