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

    java.lang.Object
      org.jini.rio.associations.AssociationMgmt

All Implemented Interfaces:
  AssociationManagement

    public class AssociationMgmt

extends Object
implements AssociationManagement

The AssociationMgmt class implements the AssociationManagement interface.

Nested Class Summary
`class` | `AssociationMgmt.AssociationHandler` The AssociationHandler handle an Association created from AssociationDescriptor.

Constructor Summary
`AssociationMgmt()` Create an AssociationMgmt instance.
`AssociationMgmt(ClassLoader cl)` Create an AssociationMgmt instance.

Method Summary
`void` | `addAssociationDescriptors(AssociationDescriptor[] aDescs)` Add an array of AssociationDescriptor to the AssociationMgmt class
`protected AssociationMgmt.AssociationHandler` | `createAssociationHandler(AssociationDescriptor aDesc)` Create an AssociationHandler
`Object[]` | `getAssociatedServices(Class serviceType)` Get all associated service instances for a service type
`protected AssociationListener<?>[]` | `getAssociationListeners()` Get all AssociationListener instances
`Association[]` | `getAssociations()` Get all Association instances
`Association[]` | `getAssociations(String opStringName)` Get all Association instances that from a specific OperationalString
`Association[]` | `getAssociations(String serviceName, String opStringName)` Get all Association instances for a service name and an optional OperationalString name
`protected String` | `getClientName()` Get the clientName
`protected Configuration` | `getConfiguration()`
`protected void` | `notifyOnBroken(Association association, Object service)` Notify listeners that the Association is broken
`protected void` | `notifyOnChange(Association association, Object service)` Notify listeners on Association change
`protected void` | `notifyOnDiscovery(Association association, Object service)` Notify listeners on discovery
`void` | `register(AssociationListener listener)` Register an AssociationListener.
`void` | `remove(AssociationListener listener)` Remove an AssociationListener
`void` | `setBackend(Object backend)` Set the PropertyDescriptor elements.
`void` | `setClientName(String clientName)` Set the name of the client that has the associations.
`void` | `setConfiguration(Configuration config)`
`void` | `setServiceBeanContainer(org.jini.rio.cybernode.ServiceBeanContainer container)` Set the ServiceBeanContainer object
`void` | `setServiceBeanContext(ServiceBeanContext context)` Set the ServiceBeanContext object for the ServiceBean
`void` | `setServiceBeanControl(ServiceBeanControl control)` Set the ServiceBeanControl object for the ServiceBean
`void` | `setUnadvertiseOnBroken(boolean unadvertiseOnBroken)` Set unadvertiseOnBroken
`void` | `terminate()` Terminate AssociationMgmt, cleaning up all connections

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

Constructor Detail

### AssociationMgmt

    public AssociationMgmt()

  Create an AssociationMgmt instance. Uses the current thread's context class loader to provide the caller/client with properly annotated proxies for associated services

### AssociationMgmt

    public AssociationMgmt(ClassLoader cl)

  Create an AssociationMgmt instance. Uses the specified class loader to provide the caller/client with properly annotated proxies for associated services, or the current thread's context class loader if cl is null.

  Parameters:
    `cl` - The class loader to provide the caller/client with properly

Method Detail

### setUnadvertiseOnBroken

    public void setUnadvertiseOnBroken(boolean unadvertiseOnBroken)

  Description copied from interface: `AssociationManagement`
  Set unadvertiseOnBroken

  Specified by:
    `setUnadvertiseOnBroken` in interface `AssociationManagement`
  Parameters:
    `unadvertiseOnBroken` - If true, and the service has an Association with a type of AssociationType.REQUIRES and the Association is broken, the AssociationManagement object will unadvertise the ServiceBean using the ServiceBean instance's ServiceBeanControl object. If false, the AssociationManagement object will not unadvertise the ServiceBean
  See Also:
    `AssociationManagement.setUnadvertiseOnBroken(boolean)`

### setServiceBeanControl

    public void setServiceBeanControl(ServiceBeanControl control)

  Description copied from interface: `AssociationManagement`
  Set the ServiceBeanControl object for the ServiceBean

  Specified by:
    `setServiceBeanControl` in interface `AssociationManagement`
  Parameters:
    `control` - The ServiceBeanControl object for the ServiceBean
  See Also:
    `AssociationManagement.setServiceBeanControl(org.jini.rio.core.ServiceBeanControl)`

### setServiceBeanContainer

    public void setServiceBeanContainer(org.jini.rio.cybernode.ServiceBeanContainer container)

  Description copied from interface: `AssociationManagement`
  Set the ServiceBeanContainer object

  Specified by:
    `setServiceBeanContainer` in interface `AssociationManagement`
  Parameters:
    `container` - The ServiceBeanContainer that the ServiceBean is running in
  See Also:
    `AssociationManagement.setServiceBeanContainer(org.jini.rio.cybernode.ServiceBeanContainer)`

### register

    public void register(AssociationListener listener)

  Description copied from interface: `AssociationManagement`
  Register an AssociationListener. The listener object will receive notifications of Association state changes. Once a listener is registered, it will be notified of all Association references discovered to date, and will be notified as Associations are discovered, changed or broken. If the parameter value duplicates (using equals) another element in the set of listeners, no action is taken. If the parameter value is null, an IllegalArgumentException is thrown

  Specified by:
    `register` in interface `AssociationManagement`
  Parameters:
    `listener` - An AssociationListener
  See Also:
    `AssociationManagement.register(org.jini.rio.core.AssociationListener)`

### remove

    public void remove(AssociationListener listener)

  Description copied from interface: `AssociationManagement`
  Remove an AssociationListener

  Specified by:
    `remove` in interface `AssociationManagement`
  Parameters:
    `listener` - An AssociationListener
  See Also:
    `AssociationManagement.remove(AssociationListener)`

### terminate

    public void terminate()

  Terminate AssociationMgmt, cleaning up all connections

  Specified by:
    `terminate` in interface `AssociationManagement`

### getAssociations

    public Association[] getAssociations(String opStringName)

  Description copied from interface: `AssociationManagement`
  Get all Association instances that from a specific OperationalString

  Specified by:
    `getAssociations` in interface `AssociationManagement`
  Parameters:
    `opStringName` - String name of the OperationalString
  Returns:
    Array of Association instances that contain the OperationalString name. If there no known associations, a zero-length array will be returned
  See Also:
    `AssociationManagement.getAssociations(String)`

### getAssociations

    public Association[] getAssociations(String serviceName,
                                         String opStringName)

  Description copied from interface: `AssociationManagement`
  Get all Association instances for a service name and an optional OperationalString name

  Specified by:
    `getAssociations` in interface `AssociationManagement`
  Parameters:
    `serviceName` - String name of the associated service, must not be null
    `opStringName` - String name of the OperationalString. If null will be ignored
  Returns:
    Array of Association instances that contain the service and optionally the OperationalString name. If there no known associations, a zero-length array will be returned
  See Also:
    `AssociationManagement.getAssociations(String,String)`

### getAssociations

    public Association[] getAssociations()

  Description copied from interface: `AssociationManagement`
  Get all Association instances

  Specified by:
    `getAssociations` in interface `AssociationManagement`
  Returns:
    Array of Association instances. A new array will be allocated each time. If there no known associations, a zero-length array will be returned
  See Also:
    `AssociationManagement.getAssociations()`

### getAssociatedServices

    public Object[] getAssociatedServices(Class serviceType)

  Description copied from interface: `AssociationManagement`
  Get all associated service instances for a service type

  Specified by:
    `getAssociatedServices` in interface `AssociationManagement`
  Parameters:
    `serviceType` - The service types to match, or null for all services
  Returns:
    Array of service instances that match the serviceType. If there no known associated service, a zero-length array will be returned
  See Also:
    `AssociationManagement.getAssociatedServices(Class)`

### setBackend

    public void setBackend(Object backend)

  Set the PropertyDescriptor elements. This will be used to inject associated services

  Parameters:
    `backend` - The backend (implementation) to use for property injection

### setClientName

    public void setClientName(String clientName)

  Set the name of the client that has the associations.

  Parameters:
    `clientName` - The name of the client that has the associations. This is used for logging and diagnostics

### setServiceBeanContext

    public void setServiceBeanContext(ServiceBeanContext context)

  Description copied from interface: `AssociationManagement`
  Set the ServiceBeanContext object for the ServiceBean

  Specified by:
    `setServiceBeanContext` in interface `AssociationManagement`
  Parameters:
    `context` - The ServiceBeanContest object for the ServiceBean
  See Also:
    `AssociationManagement.setServiceBeanContext(org.jini.rio.core.jsb.ServiceBeanContext)`

### getConfiguration

    protected Configuration getConfiguration()

### setConfiguration

    public void setConfiguration(Configuration config)

### getClientName

    protected String getClientName()

  Get the clientName

  Returns:
    The client name

### getAssociationListeners

    protected AssociationListener<?>[] getAssociationListeners()

  Get all AssociationListener instances

  Returns:
    An Array of AssociationListener instances. A new array is allocated each time. If there are no AssociationListener instances a zero-length array is returned

### createAssociationHandler

    protected AssociationMgmt.AssociationHandler createAssociationHandler(AssociationDescriptor aDesc)

  Create an AssociationHandler

  Parameters:
    `aDesc` - The AssociationDescriptor to create an AssociationHandler for
  Returns:
    An AssociationHandler for the AssociationDescriptor. A new AssociationHandler is created each time this method is called
  Throws:
    `NullPointerException` - if the AssociationDescriptor is null

### addAssociationDescriptors

    public void addAssociationDescriptors(AssociationDescriptor[] aDescs)

  Add an array of AssociationDescriptor to the AssociationMgmt class

  Parameters:
    `aDescs` - Array of AssociationDescriptor to add

### notifyOnDiscovery

    protected void notifyOnDiscovery(Association association,
                                     Object service)

  Notify listeners on discovery

  Parameters:
    `association` - The Association
    `service` - The discovered service

### notifyOnChange

    protected void notifyOnChange(Association association,
                                  Object service)

  Notify listeners on Association change

  Parameters:
    `association` - The Association
    `service` - The discovered service

### notifyOnBroken

    protected void notifyOnBroken(Association association,
                                  Object service)

  Notify listeners that the Association is broken

  Parameters:
    `association` - The Association
    `service` - The discovered service

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.