Rio Project 4.2 API Documentation
org.rioproject.fdh
Class AdminFaultDetectionHandler
java.lang.Object
org.rioproject.fdh.AbstractFaultDetectionHandler
org.rioproject.fdh.AdminFaultDetectionHandler
- All Implemented Interfaces:
- FaultDetectionHandler<ServiceID>
public class AdminFaultDetectionHandler
- extends AbstractFaultDetectionHandler
The AdminFaultDetectionHandler is used to monitor services that implement
the Administrable interface.
If the service implements the Administrable interface,
the AdminFaultDetectionHandler invokes the
Administrable.getAdmin() method periodically. If the
method invocation returns successfully, the service is assumed to be available. If
the method invocation results in a failure, and all retry attempts have failed,
the AdminFaultDetectionHandler will notify FaultDetectionListener instances of
the failure.
Additionally, the AdminFaultDetectionHandler 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
net.jini.admin.Administrable interface, the
AdminFaultDetectionHandler will only create the event consumer for
Lookup Service TRANSITION_MATCH_NOMATCH transitions.
Configuring AdminFaultDetectionHandler
This implementation of AdminFaultDetectionHandler supports
the following configuration entries; where each configuration entry name is
associated with the component name
org.rioproject.fdh.AdminFaultDetectionHandler.
- invocationDelay
Type:
|
long |
Default:
|
60*1000 (60 seconds) |
Description:
|
The amount of time in milliseconds to wait
between Administrable.getAdmin() method invocations |
- retryCount
Type:
|
int
|
Default:
|
3 |
Description:
|
The number of times to retry connecting to
the service when invoking the
Administrable.getAdmin() 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 AdminFaultDetectionHandler to
determine service failure for a service that implements the
Administrable interface is calculated as
follows :
((num_retries + 1) * (connectivity_timeout)) + (retry_delay * num_retries)
- Author:
- Dennis Reedy
| Fields inherited from class org.rioproject.fdh.AbstractFaultDetectionHandler |
config, configArgs, DEFAULT_RETRY_COUNT, DEFAULT_RETRY_TIMEOUT, proxy, RETRY_COUNT_KEY, RETRY_TIMEOUT_KEY, retryCount, retryTimeout, serviceMonitor, terminating |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INVOCATION_DELAY_KEY
public static final String INVOCATION_DELAY_KEY
- See Also:
- Constant Field Values
AdminFaultDetectionHandler
public AdminFaultDetectionHandler()
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[])
setInvocationDelay
public void setInvocationDelay(long invocationDelay)
getServiceMonitor
protected AbstractFaultDetectionHandler.ServiceMonitor getServiceMonitor()
throws Exception
- Get the class which implements the ServiceMonitor
- Specified by:
getServiceMonitor in class AbstractFaultDetectionHandler
- Returns:
- A ServiceMonitor
- Throws:
Exception - if the ServiceMonitor cannot be created
Copyright © 2006-2011 Rio Project. All Rights Reserved.