All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.jaw.impl.agent.services.monitor.CounterMonitor
java.lang.Object
|
+----com.sun.jaw.impl.agent.services.monitor.Monitor
|
+----com.sun.jaw.impl.agent.services.monitor.CounterMonitor
- public class CounterMonitor
- extends Monitor
- implements AlarmClockListener, Serializable
This class provides a simple implementation of a counter monitor.
A counter monitor is a monitor which observes an attribute which behaves as a counter.
It has the basic property that the defined event notification is triggered when the value of the
count becomes equal to or greater than the comparison level of the threshold. In addition, an offset
mechanism is also available to allow particular counting intervals to be detected, as follows. If the
offset value is not zero, whenever the threshold is triggered by the counter value reaching a comparison
level, that comparison level is incremented by the offset value. This is regarded as taking place
instantaneously, i.e. before the count is incremented. Thus, for each level, the threshold triggers
an event notification every time the count increases by an interval equal to the offset value.
If the counter we are monitoring wraps around when it reaches its maximum value then the modulus value
needs to be set to that maximum value.
If the counter difference option is used, then the value of the derived gauge is calculated
as the difference between the observed counter values for two successive observations. If this
difference is negative then the value of the derived gauge is incremented by the value of the
modulus.
The derived gauge value (V[t]) is calculated using the following method:
- if (counter[t] - counter[t-GP]) is positive then V[t] = counter[t] - counter[t-GP]
- if (counter[t] - counter[t-GP]) is negative then V[t] = counter[t] - counter[t-GP] + MODULUS
This implementation of the counter monitor requires the observed property to be of type Integer.
- See Also:
- Monitor, GaugeMonitor
-
CounterMonitor()
-
-
getComparisonLevel()
- Returns the comparison level value.
-
getCounterDifferenceOnOff()
- Returns the counter difference on/off flag.
-
getModulusValue()
- Returns the modulus value.
-
getNotifyOnOff()
- Returns the notifications on/off switch value.
-
getOffsetValue()
- Returns the offset value.
-
getPreviousScanCounter()
- Returns the previous scan counter.
-
getPreviousScanCounterInitialisedOnOff()
- Returns the previous scan counter procedural status.
-
handleAlarmClock(AlarmClockEvent)
- This handle will be called each time the alarm-clock has exceeded its timeout.
-
performStop()
- Deactivates the
CounterMonitor service.
-
setComparisonLevel(Integer)
- Sets the comparison level value.
-
setCounterDifferenceOnOff(Boolean)
- Sets the counter difference on/off flag.
-
setModulusValue(Integer)
- Sets the modulus value.
-
setNotifyOnOff(Boolean)
- Sets the notifications on/off switch value.
-
setOffsetValue(Integer)
- Sets the offset value.
CounterMonitor
public CounterMonitor()
handleAlarmClock
public void handleAlarmClock(AlarmClockEvent e)
- This handle will be called each time the alarm-clock has exceeded its timeout.
- Overrides:
- handleAlarmClock in class Monitor
getComparisonLevel
public Integer getComparisonLevel()
- Returns the comparison level value.
setComparisonLevel
public void setComparisonLevel(Integer level)
- Sets the comparison level value.
getOffsetValue
public Integer getOffsetValue()
- Returns the offset value.
setOffsetValue
public void setOffsetValue(Integer value)
- Sets the offset value.
getNotifyOnOff
public Boolean getNotifyOnOff()
- Returns the notifications on/off switch value.
setNotifyOnOff
public void setNotifyOnOff(Boolean value)
- Sets the notifications on/off switch value.
getCounterDifferenceOnOff
public Boolean getCounterDifferenceOnOff()
- Returns the counter difference on/off flag.
setCounterDifferenceOnOff
public void setCounterDifferenceOnOff(Boolean value)
- Sets the counter difference on/off flag.
getPreviousScanCounter
public Integer getPreviousScanCounter()
- Returns the previous scan counter.
getPreviousScanCounterInitialisedOnOff
public Boolean getPreviousScanCounterInitialisedOnOff()
- Returns the previous scan counter procedural status.
getModulusValue
public Integer getModulusValue()
- Returns the modulus value.
setModulusValue
public void setModulusValue(Integer modulus)
- Sets the modulus value.
performStop
public synchronized void performStop()
- Deactivates the
CounterMonitor service.
- Overrides:
- performStop in class Monitor
All Packages Class Hierarchy This Package Previous Next Index