com.gigaspaces.grid.space
Class GigaSpacesFaultDetectionHandler
java.lang.Object
org.jini.rio.resources.client.AbstractFaultDetectionHandler
com.gigaspaces.grid.space.GigaSpacesFaultDetectionHandler
- All Implemented Interfaces:
- org.jini.rio.core.FaultDetectionHandler
public class GigaSpacesFaultDetectionHandler
- extends org.jini.rio.resources.client.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)
Nested classes/interfaces inherited from class org.jini.rio.resources.client.AbstractFaultDetectionHandler |
org.jini.rio.resources.client.AbstractFaultDetectionHandler.ServiceMonitor |
Fields inherited from class org.jini.rio.resources.client.AbstractFaultDetectionHandler |
config, configArgs, DEFAULT_RETRY_COUNT, DEFAULT_RETRY_TIMEOUT, proxy, RETRY_COUNT_KEY, RETRY_TIMEOUT_KEY, retryCount, retryTimeout, serviceMonitor, terminating |
Method Summary |
protected org.jini.rio.resources.client.AbstractFaultDetectionHandler.ServiceMonitor |
getServiceMonitor()
Get the class which implements the ServiceMonitor |
void |
monitor(java.lang.Object proxy,
java.lang.Object id,
net.jini.lookup.LookupCache lCache)
Override the mopnitor method to ensure a non-clustered proxy is used |
void |
setConfiguration(java.lang.String[] configArgs)
|
Methods inherited from class org.jini.rio.resources.client.AbstractFaultDetectionHandler |
getName, notifyListeners, register, terminate, unregister |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INVOCATION_DELAY_KEY
public static final java.lang.String INVOCATION_DELAY_KEY
- See Also:
- Constant Field Values
GigaSpacesFaultDetectionHandler
public GigaSpacesFaultDetectionHandler()
setConfiguration
public void setConfiguration(java.lang.String[] configArgs)
- See Also:
FaultDetectionHandler.setConfiguration(java.lang.String[])
monitor
public void monitor(java.lang.Object proxy,
java.lang.Object id,
net.jini.lookup.LookupCache lCache)
throws java.lang.Exception
- Override the mopnitor method to ensure a non-clustered proxy is used
- Specified by:
monitor
in interface org.jini.rio.core.FaultDetectionHandler
- Overrides:
monitor
in class org.jini.rio.resources.client.AbstractFaultDetectionHandler
- Throws:
java.lang.Exception
getServiceMonitor
protected org.jini.rio.resources.client.AbstractFaultDetectionHandler.ServiceMonitor getServiceMonitor()
throws java.lang.Exception
- Get the class which implements the ServiceMonitor
- Specified by:
getServiceMonitor
in class org.jini.rio.resources.client.AbstractFaultDetectionHandler
- Throws:
java.lang.Exception
Copyright (c) 2007 GigaSpaces Technologies, Inc.
All Rights Reserved.