|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--javax.management.NotificationBroadcasterSupport
|
+--javax.management.monitor.Monitor
|
+--javax.management.monitor.CounterMonitor
Defines a monitor MBean designed to observe the values of a counter attribute.
A counter monitor sends a threshold notification
when the value of the counter reaches or exceeds a threshold known as the comparison level.
The notify flag must be set to true.
In addition, an offset mechanism enables particular counting intervals to be detected.
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, that is 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 can wrap around its maximum value, the modulus needs to be specified. The modulus is the value at which the counter is reset to zero.
If the counter difference mode is used, 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, 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:
Byte, Integer, Short, Long).
| Field Summary |
| Fields inherited from class javax.management.monitor.Monitor |
observedObjects |
| Constructor Summary | |
CounterMonitor()
|
|
| Method Summary | |
void |
addObservedObject(ObjectName objectName)
Adds the specified object in the set of observed MBeans. |
protected void |
doMonitor(ObjectName observedObject,
java.lang.Object value)
|
java.lang.Number |
getDerivedGauge(ObjectName observedObjectName)
Gets the derived gauge for the specified MBean. |
long |
getDerivedGaugeTimeStamp(ObjectName observedObjectName)
Gets the derived gauge timestamp for the specified MBean. |
boolean |
getDifferenceMode()
Gets the difference mode flag value. |
java.lang.Number |
getInitThreshold()
Gets the initial threshold value common to all observed objects. |
java.lang.Number |
getModulus()
Gets the modulus value. |
MBeanNotificationInfo[] |
getNotificationInfo()
Returns a NotificationInfo object contaning the name of the Java class of the notification and the notification types sent. |
boolean |
getNotify()
Gets the notification's on/off switch value. |
java.lang.Number |
getOffset()
Gets the offset value. |
java.lang.Number |
getThreshold(ObjectName observedObjectName)
Gets the threshold value for the specified MBean. |
void |
setDifferenceMode(boolean value)
Sets the difference mode flag value. |
void |
setInitThreshold(java.lang.Number value)
Sets the initial threshold value common to all observed MBeans. |
void |
setModulus(java.lang.Number value)
Sets the modulus value. |
void |
setNotify(boolean value)
Sets the notification's on/off switch value. |
void |
setOffset(java.lang.Number value)
Sets the offset value. |
void |
start()
|
void |
stop()
|
| Methods inherited from class javax.management.monitor.Monitor |
_start, _stop, containsObservedObject, getGranularityPeriod, getMonitorData, getObservedAttribute, getObservedObjects, isActive, postDeregister, postRegister, preDeregister, preRegister, removeObservedObject, sendNotification, setGranularityPeriod, setObservedAttribute |
| Methods inherited from class javax.management.NotificationBroadcasterSupport |
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.management.monitor.MonitorMBean |
containsObservedObject, getGranularityPeriod, getObservedAttribute, getObservedObjects, isActive, removeObservedObject, setGranularityPeriod, setObservedAttribute |
| Constructor Detail |
public CounterMonitor()
| Method Detail |
public void start()
start in class Monitorpublic void stop()
stop in class Monitorpublic java.lang.Number getDerivedGauge(ObjectName observedObjectName)
CounterMonitorMBean
getDerivedGauge in interface CounterMonitorMBeanobservedObjectName - the MBean for which the derived gauge is to be returned
null otherwise.public long getDerivedGaugeTimeStamp(ObjectName observedObjectName)
CounterMonitorMBean
getDerivedGaugeTimeStamp in interface CounterMonitorMBeanobservedObjectName - the MBean for which the derived gauge timestamp is to be returned
null otherwise.public java.lang.Number getThreshold(ObjectName observedObjectName)
CounterMonitorMBean
getThreshold in interface CounterMonitorMBeanobservedObjectName - the MBean for which the threashold value is to be returned
null otherwise.public java.lang.Number getInitThreshold()
CounterMonitorMBean
getInitThreshold in interface CounterMonitorMBeanCounterMonitorMBean.setInitThreshold(java.lang.Number)
public void setInitThreshold(java.lang.Number value)
throws java.lang.IllegalArgumentException
CounterMonitorMBean
setInitThreshold in interface CounterMonitorMBeanvalue - The initial threshold value.
java.lang.IllegalArgumentException - The specified
threshold is null or the threshold value is less than zero.CounterMonitorMBean.getInitThreshold()public java.lang.Number getOffset()
CounterMonitorMBean
getOffset in interface CounterMonitorMBeanCounterMonitorMBean.setOffset(Number)
public void setOffset(java.lang.Number value)
throws java.lang.IllegalArgumentException
CounterMonitorMBean
setOffset in interface CounterMonitorMBeanvalue - The offset value.
java.lang.IllegalArgumentException - The specified
offset is null or the offset value is less than zero.CounterMonitorMBean.getOffset()public java.lang.Number getModulus()
CounterMonitorMBean
getModulus in interface CounterMonitorMBeanCounterMonitorMBean.setModulus(java.lang.Number)
public void setModulus(java.lang.Number value)
throws java.lang.IllegalArgumentException
CounterMonitorMBean
setModulus in interface CounterMonitorMBeanvalue - The modulus value.
java.lang.IllegalArgumentException - The specified
modulus is null or the modulus value is less than zero.CounterMonitorMBean.getModulus()public boolean getNotify()
CounterMonitorMBean
getNotify in interface CounterMonitorMBeantrue if the counter monitor notifies when
exceeding the threshold, false otherwise.CounterMonitorMBean.setNotify(boolean)public void setNotify(boolean value)
CounterMonitorMBean
setNotify in interface CounterMonitorMBeanvalue - The notification's on/off switch value.CounterMonitorMBean.getNotify()public boolean getDifferenceMode()
CounterMonitorMBean
getDifferenceMode in interface CounterMonitorMBeantrue if the difference mode is used,
false otherwise.CounterMonitorMBean.setDifferenceMode(boolean)public void setDifferenceMode(boolean value)
CounterMonitorMBean
setDifferenceMode in interface CounterMonitorMBeanvalue - The difference mode flag value.CounterMonitorMBean.getDifferenceMode()public MBeanNotificationInfo[] getNotificationInfo()
NotificationBroadcasterSupport
getNotificationInfo in interface NotificationBroadcastergetNotificationInfo in class NotificationBroadcasterSupport
protected void doMonitor(ObjectName observedObject,
java.lang.Object value)
doMonitor in class Monitor
public void addObservedObject(ObjectName objectName)
throws java.lang.IllegalArgumentException
MonitorMBean
addObservedObject in interface MonitorMBeanaddObservedObject in class MonitorobjectName - The object to observe.
java.lang.IllegalArgumentException - the specified object is null.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||