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.watch
Class WatchDataSourceRegistry

    java.lang.Object
      org.jini.rio.watch.WatchDataSourceRegistry

All Implemented Interfaces:
  WatchRegistry

    public class WatchDataSourceRegistry

extends Object
implements WatchRegistry

An implementation of a `WatchRegistry`

Field Summary
`protected Map<String,Collection<ThresholdListener>>` | `thresholdListenerTable` Table of ThresholdWatch classnames and ThresholdListener objects
`protected Vector<Watch>` | `watchRegistry` Collection of Watch instances that have been registered

Constructor Summary
`WatchDataSourceRegistry()`

Method Summary
`void` | `addThresholdListener(String id, ThresholdListener thresholdListener)` Add a ThresholdListener.
`protected void` | `associateThresholdListener(Watch watch)` This method will associate a Watch to a ThresholdListener, iff the Watch is a ThresholdWatch and the Watch objects classname is found in the table
`void` | `closeAll()` Closes all WatchDataSource instances
`void` | `deregister(Watch watch)` DeRegisters a Watch from underlying collection and closes the Watch
`WatchDataSource[]` | `fetch()` Returns an array of WatchDataSource objects which provide a reference to an implementation of WatchDataSource.
`WatchDataSource[]` | `fetch(String id)` Returns an array of WatchDataSource objects which match the input id which corresponds to a Watch identifier.
`Watch[]` | `findWatch(String id)` Returns an array of Watch objects based on the input id
`void` | `register(Watch watch)` Registers a Watch to underlying collection
`void` | `setServiceBeanContext(ServiceBeanContext context)` Set the ServiceBeanContext for the WatchRegistry

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

Field Detail

### watchRegistry

    protected final Vector<Watch> watchRegistry

  Collection of Watch instances that have been registered

### thresholdListenerTable

    protected final Map<String,Collection<ThresholdListener>> thresholdListenerTable

  Table of ThresholdWatch classnames and ThresholdListener objects

Constructor Detail

### WatchDataSourceRegistry

    public WatchDataSourceRegistry()

Method Detail

### deregister

    public void deregister(Watch watch)

  Description copied from interface: `WatchRegistry`
  DeRegisters a Watch from underlying collection and closes the Watch

  Specified by:
    `deregister` in interface `WatchRegistry`
  Parameters:
    `watch` - The Watch to deregister
  See Also:
    `WatchRegistry.deregister(Watch)`

### closeAll

    public void closeAll()

  Description copied from interface: `WatchRegistry`
  Closes all WatchDataSource instances

  Specified by:
    `closeAll` in interface `WatchRegistry`
  See Also:
    `WatchRegistry.closeAll()`

### register

    public void register(Watch watch)

  Description copied from interface: `WatchRegistry`
  Registers a Watch to underlying collection

  Specified by:
    `register` in interface `WatchRegistry`
  Parameters:
    `watch` - The Watch to register
  See Also:
    `WatchRegistry.register(Watch)`

### addThresholdListener

    public void addThresholdListener(String id,
                                     ThresholdListener thresholdListener)

  Description copied from interface: `WatchRegistry`
  Add a ThresholdListener. The ThresholdListener will be added as a ThresholdListener to any ThresholdWatch instances that match the ThresholdListener when the ThresholdWatch is registered using the `register` method

  Specified by:
    `addThresholdListener` in interface `WatchRegistry`
  Parameters:
    `id` - The identifier to match
    `thresholdListener` - The ThresholdListener to add
  See Also:
    `WatchRegistry.addThresholdListener(java.lang.String, org.jini.rio.watch.ThresholdListener)`

### associateThresholdListener

    protected void associateThresholdListener(Watch watch)

  This method will associate a Watch to a ThresholdListener, iff the Watch is a ThresholdWatch and the Watch objects classname is found in the table

  Parameters:
    `watch` - The Watch to associate

### findWatch

    public Watch[] findWatch(String id)

  Description copied from interface: `WatchRegistry`
  Returns an array of Watch objects based on the input id

  Specified by:
    `findWatch` in interface `WatchRegistry`
  Parameters:
    `id` - The watch id to match
  Returns:
    Array of Watch objects that match the input id. If there are no Watch objects that match the id, this method returns a zero-length array
  See Also:
    `WatchRegistry.findWatch(String)`

### fetch

    public WatchDataSource[] fetch()

  Description copied from interface: `WatchRegistry`
  Returns an array of WatchDataSource objects which provide a reference to an implementation of WatchDataSource.

  Specified by:
    `fetch` in interface `WatchRegistry`
  Returns:
    An array of WatchDataSource objects. If there are no WatchDataSource objects, this method returns an empty array
  See Also:
    `WatchRegistry.fetch()`

### fetch

    public WatchDataSource[] fetch(String id)

  Description copied from interface: `WatchRegistry`
  Returns an array of WatchDataSource objects which match the input

      id

  which corresponds to a

      Watch

  identifier. The WatchDataSource object(s) returned provide a reference to an implementation of WatchDataSource.

  Specified by:
    `fetch` in interface `WatchRegistry`
  Parameters:
    `id` - the watch id to match
  Returns:
    An array of WatchDataSource objects that match the id. If there are no WatchDataSource objects, this method returns an empty array
  See Also:
    `WatchRegistry.fetch(String)`

### setServiceBeanContext

    public void setServiceBeanContext(ServiceBeanContext context)

  Description copied from interface: `WatchRegistry`
  Set the ServiceBeanContext for the WatchRegistry

  Specified by:
    `setServiceBeanContext` in interface `WatchRegistry`
  Parameters:
    `context` - The `ServiceBeanContext`
  See Also:
    `WatchRegistry.setServiceBeanContext(org.jini.rio.core.jsb.ServiceBeanContext)`

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.