Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jini.rio.resources.client
Class StandardFaultDetectionHandler

    java.lang.Object
      org.jini.rio.resources.client.AbstractFaultDetectionHandler
          org.jini.rio.resources.client.StandardFaultDetectionHandler

All Implemented Interfaces:
  FaultDetectionHandler<ServiceID>

    public class StandardFaultDetectionHandler

extends AbstractFaultDetectionHandler

A StandardFaultDetectionHandler provides support necessary for a FaultDetectionHandler. The StandardFaultDetectionHandler can be used to monitor a services which implements the `org.jini.rio.core.MonitorableService` interface, as well as for services that do not implement this interface. If the service does implement the `org.jini.rio.core.MonitorableService`, the StandardFaultDetectionHandler creates a client-side lease with the service, and attempts to renew the lease based on a configurable lease duration time. If the lease cannot be renewed and all retry attempts have failed, the StandardFaultDetectionHandler will notify FaultDetectionListener instances of the failure.

Additionally, the StandardFaultDetectionHandler 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, or the service monitoring lease is between lease renewal points and the service has actually been 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 `org.jini.rio.core.MonitorableService` interface, the StandardFaultDetectionHandler will not manage a Lease, but will only create the event consumer for Lookup Service TRANSITION_MATCH_NOMATCH transitions.

Configuring StandardFaultDetectionHandler

This implementation of `StandardFaultDetectionHandler` supports the following configuration entries; where each configuration entry name is associated with the component name `org.jini.rio.resources.client.StandardFaultDetectionHandler`.

- leaseDuration

  Type: | long
  Default: | `30*1000 (30 seconds)`
  Description: | The duration of the Lease in milliseconds. The Lease renewal time will be calculated to be 75% of the LeaseTime attribute

- retryCount

  Type: | `int`
  Default: | `3`
  Description: | The number of times to retry connecting to the service when renewing the Lease. 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

- leasePreparer

  Type: | `ProxyPreparer`
  Default: | `new `BasicProxyPreparer`()`
  Description: | Preparer for the leases returned when the StandardFaultDetectionHandler invokes the monitor method of a MonitorableService

The amount of time it takes for the StandardFaultDetectionListener to determine service failure for a service which implements the `org.jini.rio.core.MonitorableService` interface is calculated as follows :

     ((num_retries + 1) * (connectivity_timeout)) + (retry_delay * num_retries)

Nested Class Summary

Nested classes/interfaces inherited from class org.jini.rio.resources.client.AbstractFaultDetectionHandler
`AbstractFaultDetectionHandler.ServiceMonitor`

Field Summary
`static long` | `DEFAULT_LEASE_DURATION`
`static String` | `LEASE_DURATION_KEY`

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`

Constructor Summary
`StandardFaultDetectionHandler()`

Method Summary
`protected AbstractFaultDetectionHandler.ServiceMonitor` | `getServiceMonitor()` Override parent's getServiceMonitor() method to create the ServiceLeaseManager
`void` | `setConfiguration(String[] configArgs)` Set configuration attributes for the FaultDetectionHandler.

Methods inherited from class org.jini.rio.resources.client.AbstractFaultDetectionHandler
`getName, monitor, notifyListeners, register, terminate, unregister`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_LEASE_DURATION

    public static final long DEFAULT_LEASE_DURATION

See Also:
  Constant Field Values

### LEASE_DURATION_KEY

    public static final String LEASE_DURATION_KEY

See Also:
  Constant Field Values

Constructor Detail

### StandardFaultDetectionHandler

    public StandardFaultDetectionHandler()

Method Detail

### 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[])`

### getServiceMonitor

    protected AbstractFaultDetectionHandler.ServiceMonitor getServiceMonitor()
                                                                      throws Exception

  Override parent's getServiceMonitor() method to create the ServiceLeaseManager

  Specified by:
    `getServiceMonitor` in class `AbstractFaultDetectionHandler`
  Returns:
    A ServiceMonitor
  Throws:
    `Exception` - if the ServiceMonitor cannot be created

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © Project Rio.