Class AbstractFaultDetectionHandler

java.lang.Object
com.j_spaces.core.cluster.startup.AbstractFaultDetectionHandler
All Implemented Interfaces:
FaultDetectionHandler
Direct Known Subclasses:
GigaSpacesFaultDetectionHandler

public abstract class AbstractFaultDetectionHandler extends Object implements FaultDetectionHandler
The AbstractFaultDetectionHandler provides a base class which can be extended to provide concrete FaultDetectionHandler capabilities. The basic infrastructure included in the AbstractFaultDetectionHandler includes FaultDetectionListener registration and notification, a ServiceDiscoveryListener implementation Properties that will be common across all classes which extend this class are also provided:
  • retryCount
  • retryTimeout
See Also:
  • FaultDetectionHandler
  • FaultDetectionListener
  • Field Details

    • DEFAULT_RETRY_COUNT

      public static final int DEFAULT_RETRY_COUNT
      See Also:
    • DEFAULT_RETRY_TIMEOUT

      public static final long DEFAULT_RETRY_TIMEOUT
      See Also:
    • RETRY_COUNT_KEY

      public static final String RETRY_COUNT_KEY
      See Also:
    • RETRY_TIMEOUT_KEY

      public static final String RETRY_TIMEOUT_KEY
      See Also:
    • proxy

      protected Object proxy
      Object that can be used to communicate to the service
    • retryCount

      protected int retryCount
    • retryTimeout

      protected long retryTimeout
    • terminating

      protected boolean terminating
      Flag to indicate the utility is terminating
    • configArgs

      protected String[] configArgs
      Configuration arguments
    • config

      protected Configuration config
      A Configuration object
    • serviceMonitor

      Class which provides service monitoring
  • Constructor Details

    • AbstractFaultDetectionHandler

      public AbstractFaultDetectionHandler()
  • Method Details

    • register

      public void register(FaultDetectionListener listener)
      Description copied from interface: FaultDetectionHandler
      Register a FaultDetectionListener
      Specified by:
      register in interface FaultDetectionHandler
      Parameters:
      listener - The FaultDetectionListener to register
      See Also:
      • FaultDetectionHandler.register(org.jini.rio.core.FaultDetectionListener)
    • monitor

      public void monitor(Object proxy, ServiceID serviceID) throws Exception
      Description copied from interface: FaultDetectionHandler
      Begin monitoring the service
      Specified by:
      monitor in interface FaultDetectionHandler
      Parameters:
      proxy - The service that the FaultDetectionHandler will monitor, must not be null
      serviceID - An Object representing a unique service identifier for the service being monitored, must not be null
      Throws:
      Exception - If there are abnormal conditions encountered
      NullPointerException - if required parameters are null
      See Also:
      • FaultDetectionHandler.monitor(java.lang.Object, java.lang.Object, net.jini.lookup.LookupCache)
    • monitor

      protected abstract void monitor() throws Exception
      Get the class which implements the ServiceMonitor
      Throws:
      Exception
    • terminate

      public void terminate()
      Description copied from interface: FaultDetectionHandler
      Terminate the FaultDetectionHandler
      Specified by:
      terminate in interface FaultDetectionHandler
      See Also:
      • FaultDetectionHandler.terminate()
    • notifyListeners

      protected void notifyListeners()
      Notify FaultDetectionListener instances the service has been removed
    • getName

      protected String getName(Entry[] attrs)
      Get the first Name.name from the attribute collection set