public class GigaSpacesFaultDetectionHandler extends AbstractFaultDetectionHandler
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
.
Type: | long |
Default: | 30*1000 (30 seconds) |
Description: | The amount of time in milliseconds to wait between IJSpace.ping() method invocations |
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 |
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 |
IJSpace
interface is calculated as follows :((num_retries + 1) * (connectivity_timeout)) + (retry_delay * num_retries)
AbstractFaultDetectionHandler.ServiceMonitor
Modifier and Type | Field and Description |
---|---|
static String |
INVOCATION_DELAY_KEY |
config, configArgs, DEFAULT_RETRY_COUNT, DEFAULT_RETRY_TIMEOUT, proxy, RETRY_COUNT_KEY, RETRY_TIMEOUT_KEY, retryCount, retryTimeout, serviceMonitor, terminating
Constructor and Description |
---|
GigaSpacesFaultDetectionHandler() |
Modifier and Type | Method and Description |
---|---|
Object |
getSpaceProxy() |
protected void |
monitor()
Get the class which implements the ServiceMonitor
|
void |
monitor(Object proxy,
ServiceID serviceID)
Override the monitor method to ensure a non-clustered proxy is used
|
void |
setConfiguration(String[] configArgs)
Set configuration attributes for the FaultDetectionHandler.
|
getName, notifyListeners, register, terminate
public static final String INVOCATION_DELAY_KEY
public void setConfiguration(String[] configArgs)
FaultDetectionHandler
configArgs
- Configuration attributes a FaultDetectionHandler will use to monitor the
service. Values are specific to a concrete instance of the
FaultDetectionHandlerFaultDetectionHandler.setConfiguration(java.lang.String[])
public void monitor(Object proxy, ServiceID serviceID) throws Exception
monitor
in interface FaultDetectionHandler
monitor
in class AbstractFaultDetectionHandler
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
Exception
- If there are abnormal conditions encounteredNullPointerException
- if required parameters are null
FaultDetectionHandler.monitor(java.lang.Object, java.lang.Object, net.jini.lookup.LookupCache)
protected void monitor() throws Exception
monitor
in class AbstractFaultDetectionHandler
Exception
public Object getSpaceProxy()
Copyright © GigaSpaces.