Class GigaSpacesFaultDetectionHandler
- All Implemented Interfaces:
FaultDetectionHandler
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:
3Description:
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:
longDefault:
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)
-
Nested Class Summary
Nested classes/interfaces inherited from class com.j_spaces.core.cluster.startup.AbstractFaultDetectionHandler
AbstractFaultDetectionHandler.ServiceMonitor -
Field Summary
FieldsFields inherited from class com.j_spaces.core.cluster.startup.AbstractFaultDetectionHandler
config, configArgs, DEFAULT_RETRY_COUNT, DEFAULT_RETRY_TIMEOUT, proxy, RETRY_COUNT_KEY, RETRY_TIMEOUT_KEY, retryCount, retryTimeout, serviceMonitor, terminating -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidmonitor()Get the class which implements the ServiceMonitorvoidOverride the monitor method to ensure a non-clustered proxy is usedvoidsetConfiguration(String[] configArgs) Set configuration attributes for the FaultDetectionHandler.Methods inherited from class com.j_spaces.core.cluster.startup.AbstractFaultDetectionHandler
getName, notifyListeners, register, terminate
-
Field Details
-
INVOCATION_DELAY_KEY
- See Also:
-
-
Constructor Details
-
GigaSpacesFaultDetectionHandler
public GigaSpacesFaultDetectionHandler()
-
-
Method Details
-
setConfiguration
Description copied from interface:FaultDetectionHandlerSet 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
Override the monitor method to ensure a non-clustered proxy is used- Specified by:
monitorin interfaceFaultDetectionHandler- Overrides:
monitorin classAbstractFaultDetectionHandler- Parameters:
proxy- The service that the FaultDetectionHandler will monitor, must not benullserviceID- An Object representing a unique service identifier for the service being monitored, must not benull- Throws:
Exception- If there are abnormal conditions encounteredNullPointerException- if required parameters arenull- See Also:
-
FaultDetectionHandler.monitor(java.lang.Object, java.lang.Object, net.jini.lookup.LookupCache)
-
monitor
Get the class which implements the ServiceMonitor- Specified by:
monitorin classAbstractFaultDetectionHandler- Throws:
Exception
-
getSpaceProxy
-