Rio Project 4.2 API Documentation



org.rioproject.watch
Class WatchDataSourceRegistry

java.lang.Object
  extended by org.rioproject.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  List<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... watches)
          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 a WatchDataSource that matches the input id, that corresponds to a Watch identifier.
 Watch findWatch(String id)
          Returns a Watch that matches the provided id
 void register(Watch... watches)
          Registers a Watch to underlying collection
 void removeThresholdListener(String id, ThresholdListener thresholdListener)
          Remove a ThresholdListener.
 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 List<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... watches)
Description copied from interface: WatchRegistry
DeRegisters a Watch from underlying collection and closes the Watch

Specified by:
deregister in interface WatchRegistry
Parameters:
watches - The Watch to deregister
See Also:
WatchRegistry.deregister(org.rioproject.watch.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... watches)
Description copied from interface: WatchRegistry
Registers a Watch to underlying collection

Specified by:
register in interface WatchRegistry
Parameters:
watches - The Watch to register
See Also:
WatchRegistry.register(org.rioproject.watch.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.rioproject.watch.ThresholdListener)

removeThresholdListener

public void removeThresholdListener(String id,
                                    ThresholdListener thresholdListener)
Description copied from interface: WatchRegistry
Remove a ThresholdListener. The ThresholdListener will be removed as a ThresholdListener from any ThresholdWatch instances that match the ThresholdListener

Specified by:
removeThresholdListener in interface WatchRegistry
Parameters:
id - The identifier to match
thresholdListener - The ThresholdListener to remove
See Also:
WatchRegistry.removeThresholdListener(java.lang.String, org.rioproject.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 a Watch that matches the provided id

Specified by:
findWatch in interface WatchRegistry
Parameters:
id - The watch id to match
Returns:
The first Watch that matches the input id. If there is not a matching Watch, this method returns a null
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 a WatchDataSource that matches the input
id
, that corresponds to a
Watch
identifier.

Specified by:
fetch in interface WatchRegistry
Parameters:
id - the watch id to match
Returns:
The WatchDataSource that matches the id. If there is no WatchDataSource, this method returns null
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.rioproject.core.jsb.ServiceBeanContext)

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.