akka.remote
Class DefaultFailureDetectorRegistry<A>

java.lang.Object
  extended by akka.remote.DefaultFailureDetectorRegistry<A>
All Implemented Interfaces:
FailureDetectorRegistry<A>

public class DefaultFailureDetectorRegistry<A>
extends java.lang.Object
implements FailureDetectorRegistry<A>

A lock-less thread-safe implementation of FailureDetectorRegistry.


Constructor Summary
DefaultFailureDetectorRegistry(scala.Function0<FailureDetector> detectorFactory)
           
 
Method Summary
 scala.Option<FailureDetector> failureDetector(A resource)
          INTERNAL API Get the underlying FailureDetector for a resource.
 void heartbeat(A resource)
          Records a heartbeat for a resource.
 boolean isAvailable(A resource)
          Returns true if the resource is considered to be up and healthy and returns false otherwise.
 boolean isMonitoring(A resource)
          Returns true if the failure detector has received any heartbeats and started monitoring of the resource.
 void remove(A resource)
          Removes the heartbeat management for a resource.
 void reset()
          Removes all resources and any associated failure detector state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFailureDetectorRegistry

public DefaultFailureDetectorRegistry(scala.Function0<FailureDetector> detectorFactory)
Method Detail

isAvailable

public final boolean isAvailable(A resource)
Description copied from interface: FailureDetectorRegistry
Returns true if the resource is considered to be up and healthy and returns false otherwise. For unregistered resources it returns true.

Specified by:
isAvailable in interface FailureDetectorRegistry<A>

isMonitoring

public final boolean isMonitoring(A resource)
Description copied from interface: FailureDetectorRegistry
Returns true if the failure detector has received any heartbeats and started monitoring of the resource.

Specified by:
isMonitoring in interface FailureDetectorRegistry<A>

heartbeat

public final void heartbeat(A resource)
Description copied from interface: FailureDetectorRegistry
Records a heartbeat for a resource. If the resource is not yet registered (i.e. this is the first heartbeat) then it is automatially registered.

Specified by:
heartbeat in interface FailureDetectorRegistry<A>

remove

public final void remove(A resource)
Description copied from interface: FailureDetectorRegistry
Removes the heartbeat management for a resource.

Specified by:
remove in interface FailureDetectorRegistry<A>

reset

public final void reset()
Description copied from interface: FailureDetectorRegistry
Removes all resources and any associated failure detector state.

Specified by:
reset in interface FailureDetectorRegistry<A>

failureDetector

public scala.Option<FailureDetector> failureDetector(A resource)
INTERNAL API Get the underlying FailureDetector for a resource.