Class GigaSpacesFaultDetectionHandler

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

public class GigaSpacesFaultDetectionHandler extends AbstractFaultDetectionHandler
Provides support to determine the reachability of the GigaSpace service. The GigaSpacesFaultDetectionHandler can be used to monitor services which implement the com.j_spaces.core.IJSpace interface (as well as for services that do not implement this interface).

If the service does implement the com.j_spaces.core.IJSpace, interface, the GigaSpacesFaultDetectionHandler will ensure that the proxy being used is a non-clustered proxy, then invoke the IJSpace.ping() method periodically. If this method invocation returns succesfully, the service is assumed to be available. If this method invocation results in a failure, and all retry attempts have failed, the GigaSpacesFaultDetectionHandler will notify FaultDetectionListener instances of the failure.

Additionally, the GigaSpacesFaultDetectionHandler will register with Lookup Services for ServiceRegistrar.TRANSITION_MATCH_NOMATCH transitions for the service being monitored. If the service is adminstratively removed from the network, the transition will be noted and FaultDetectionListener instances will be notified of the failure.

If the service does not implement the com.j_spaces.core.IJSpace interface, the GigaSpacesFaultDetectionHandler will periodically invoke the IJSpace.ping() method, but will only create the event consumer for Lookup Service TRANSITION_MATCH_NOMATCH transitions.

Configuring GigaSpacesFaultDetectionHandler

This implementation of GigaSpacesFaultDetectionHandler supports the following configuration entries; where each configuration entry name is associated with the component name com.gigaspaces.grid.handler.GigaSpacesFaultDetectionHandler.

  • invocationDelay
    Type:
    long
    Default:
    30*1000 (30 seconds)
    Description:
    The amount of time in milliseconds to wait between IJSpace.ping() method invocations
  • retryCount
    Type:
    int
    Default:
    3
    Description:
    The number of times to retry connecting to the service when invoking the IJSpace.ping() method. If the service cannot be reached within the retry count specified the service will be determined to be unreachable
  • retryTimeout
    Type:
    long
    Default:
    1000 (1 second)
    Description:
    How long to wait between retries (in milliseconds). This value will be used between retry attempts, waiting the specified amount of time to retry

The amount of time it takes for the GigaSpacesFaultDetectionHandler to determine service failure for a service which implements the IJSpace interface is calculated as follows :
 ((num_retries + 1) * (connectivity_timeout)) + (retry_delay * num_retries)
 
  • Field Details

  • Constructor Details

    • GigaSpacesFaultDetectionHandler

      public GigaSpacesFaultDetectionHandler()
  • Method Details

    • setConfiguration

      public void setConfiguration(String[] configArgs)
      Description copied from interface: FaultDetectionHandler
      Set configuration attributes for the FaultDetectionHandler.
      Parameters:
      configArgs - Configuration attributes a FaultDetectionHandler will use to monitor the service. Values are specific to a concrete instance of the FaultDetectionHandler
      See Also:
      • FaultDetectionHandler.setConfiguration(java.lang.String[])
    • monitor

      public void monitor(Object proxy, ServiceID serviceID) throws Exception
      Override the monitor method to ensure a non-clustered proxy is used
      Specified by:
      monitor in interface FaultDetectionHandler
      Overrides:
      monitor in class AbstractFaultDetectionHandler
      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 void monitor() throws Exception
      Get the class which implements the ServiceMonitor
      Specified by:
      monitor in class AbstractFaultDetectionHandler
      Throws:
      Exception
    • getSpaceProxy

      public Object getSpaceProxy()