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.associations
Class AssociationMgmt.AssociationHandler

    java.lang.Object
      org.jini.rio.resources.client.ServiceDiscoveryAdapter
          org.jini.rio.associations.AssociationMgmt.AssociationHandler

All Implemented Interfaces:
  ServiceDiscoveryListener, FaultDetectionListener<ServiceID>

Enclosing class:
  AssociationMgmt

    public class AssociationMgmt.AssociationHandler

extends ServiceDiscoveryAdapter
implements FaultDetectionListener<ServiceID>

The AssociationHandler handle an Association created from AssociationDescriptor.

Constructor Summary
`AssociationMgmt.AssociationHandler(AssociationDescriptor assocDesc)` Create an AssociationHandler

Method Summary
`protected void` | `decrement()` Decrement instances
`protected void` | `exec()` Begin handling the association
`Association` | `getAssociation()` Get the Association AssociationHandler
`protected void` | `increment()` Increment instances
`protected int` | `instances()` Get the number of instances
`protected void` | `notifyOnFailure(ServiceItem item)` Notify on service failure
`protected void` | `registerFaultDetectionHandler(Object service, ServiceID serviceID, FaultDetectionHandler<ServiceID> fdh)` Register a FaultDetectionHandler and have it start monitoring
`void` | `serviceAdded(ServiceDiscoveryEvent sdEvent)` Notification that a service has been discovered.
`protected void` | `serviceDiscovered(ServiceItem item)` Add a service
`void` | `serviceFailure(Object proxy, ServiceID sid)` Notify the FaultDetectionListener that the service has failed
`protected void` | `setFaultDetectionHandler(Object service, ServiceID serviceID)` Set the FaultDetectionHandler for this AssociationHandler

Methods inherited from class org.jini.rio.resources.client.ServiceDiscoveryAdapter
`serviceChanged, serviceRemoved`

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

Constructor Detail

### AssociationMgmt.AssociationHandler

    public AssociationMgmt.AssociationHandler(AssociationDescriptor assocDesc)

  Create an AssociationHandler

  Parameters:
    `assocDesc` - The AssociationDescriptor describing the attributes of the Association

Method Detail

### exec

    protected void exec()

  Begin handling the association

### serviceAdded

    public void serviceAdded(ServiceDiscoveryEvent sdEvent)

  Notification that a service has been discovered. This method will first marshall then unmarshal the discovered ServiceItem (and hence all contained classes) using the caller's classloader. Since we are using the LookupCachePool, the "original" proxy reference may have been obtained using a sibling class loader, and the proxy may not be "usable" by the caller. This method will additionally use the configured ProxyPreparer to prepare the discovered proxy. If no ProxyPreparer has been configured, the default proxy preparer (BasicProxyPreparer that does nothing but return the original proxy) is used

  Specified by:
    `serviceAdded` in interface `ServiceDiscoveryListener`
  Overrides:
    `serviceAdded` in class `ServiceDiscoveryAdapter`
  Parameters:
    `sdEvent` - The ServiceDiscoveryEvent
  See Also:
    `ServiceDiscoveryListener.serviceAdded(net.jini.lookup.ServiceDiscoveryEvent)`

### serviceDiscovered

    protected void serviceDiscovered(ServiceItem item)
                              throws Exception

  Add a service

  Parameters:
    `item` - The service being added
  Throws:
    `Exception` - if the fault detection handler cannot be attached

### serviceFailure

    public void serviceFailure(Object proxy,
                               ServiceID sid)

  Description copied from interface: `FaultDetectionListener`
  Notify the FaultDetectionListener that the service has failed

  Specified by:
    `serviceFailure` in interface `FaultDetectionListener<ServiceID>`
  Parameters:
    `proxy` - The service that has failed
    `sid` - An Object representing a unique service identifier of the service that has failed
  See Also:
    `FaultDetectionListener.serviceFailure(java.lang.Object, T)`

### notifyOnFailure

    protected void notifyOnFailure(ServiceItem item)

  Notify on service failure

  Parameters:
    `item` - The service that has failed

### instances

    protected int instances()

  Get the number of instances

  Returns:
    instance count

### increment

    protected void increment()

  Increment instances

### decrement

    protected void decrement()

  Decrement instances

### getAssociation

    public Association getAssociation()

  Get the Association AssociationHandler

  Returns:
    The Association instance for this AssociationHandler

### setFaultDetectionHandler

    protected void setFaultDetectionHandler(Object service,
                                            ServiceID serviceID)
                                     throws Exception

  Set the FaultDetectionHandler for this AssociationHandler

  Parameters:
    `service` - The Object used to comunicate to the service
    `serviceID` - Unique service identifier
  Throws:
    `Exception` - if the fault detection handler cannot be attached

### registerFaultDetectionHandler

    protected void registerFaultDetectionHandler(Object service,
                                                 ServiceID serviceID,
                                                 FaultDetectionHandler<ServiceID> fdh)
                                          throws Exception

  Register a FaultDetectionHandler and have it start monitoring

  Parameters:
    `service` - The service proxy
    `serviceID` - The service id
    `fdh` - The FaultDetectionHandler
  Throws:
    `Exception` - If error(s) occur

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.