Rio Project 4.2 API Documentation



org.rioproject.watch
Class ThresholdManager

java.lang.Object
  extended by org.rioproject.watch.ThresholdManager
Direct Known Subclasses:
BoundedThresholdManager

public abstract class ThresholdManager
extends Object

The ThresholdManager is the keeper of ThresholdValues and determines when Calculable items being recorded have crossed any thresholds. A ThresholdManager provides threshold management processing, providing specific behavior that may be used to remedy the situation where a threshold has been crossed


Field Summary
protected  List<ThresholdListener> thresholdListeners
           
protected  ThresholdValues thresholdValues
          Holds value of property thresholdValues
 
Constructor Summary
ThresholdManager()
           
 
Method Summary
 void addThresholdListener(ThresholdListener listener)
          Add a Threshold listener
abstract  void checkThreshold(Calculable calculable)
          Check the threshold and determine if any action needs to occur
 void clear()
          Remove all registered ThresholdListener instances
abstract  boolean getThresholdCrossed()
          Get the type of threshold that has been crossed
 ThresholdListener[] getThresholdListeners()
          Get all registered ThresholdListener instances
 ThresholdValues getThresholdValues()
          Getter for property thresholdValues.
protected  void notifyListeners(Calculable calculable, int type)
          Notify all ThresholdListeners of a threshold being crossed
 void removeThresholdListener(ThresholdListener listener)
          Remove a ThresholdListener
 void setThresholdValues(ThresholdValues thresholdValues)
          Setter for property thresholdValues.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

thresholdListeners

protected final transient List<ThresholdListener> thresholdListeners

thresholdValues

protected ThresholdValues thresholdValues
Holds value of property thresholdValues

Constructor Detail

ThresholdManager

public ThresholdManager()
Method Detail

checkThreshold

public abstract void checkThreshold(Calculable calculable)
Check the threshold and determine if any action needs to occur

Parameters:
calculable - The Calculable to check

getThresholdCrossed

public abstract boolean getThresholdCrossed()
Get the type of threshold that has been crossed

Returns:
The type of threshold that has been crossed

getThresholdValues

public ThresholdValues getThresholdValues()
Getter for property thresholdValues.

Returns:
Value of property thresholdValues.

setThresholdValues

public void setThresholdValues(ThresholdValues thresholdValues)
Setter for property thresholdValues.

Parameters:
thresholdValues - New value of property thresholdValues.

notifyListeners

protected void notifyListeners(Calculable calculable,
                               int type)
Notify all ThresholdListeners of a threshold being crossed

Parameters:
calculable - The Calculable record
type - The type of threshold, breached or cleared

addThresholdListener

public void addThresholdListener(ThresholdListener listener)
Add a Threshold listener

Parameters:
listener - the ThresholdListener to add

removeThresholdListener

public void removeThresholdListener(ThresholdListener listener)
Remove a ThresholdListener

Parameters:
listener - the ThresholdListener to remove

getThresholdListeners

public ThresholdListener[] getThresholdListeners()
Get all registered ThresholdListener instances

Returns:
Array of ThresholdListener[]. A new array will be allocated each time this method is called. If there are no registered ThresholdListener instances, a zero-length array will be returned

clear

public void clear()
Remove all registered ThresholdListener instances


Copyright © Rio Project.

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