|
XMOJO 5 API Docs | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.management.NotificationBroadcasterSupport | +--javax.management.monitor.Monitor | +--javax.management.monitor.CounterMonitor
This class defines a monitor MBean designed to observe the values of a
counter attribute. Counter attributes are those types whose value is always
positive or null and they can only be incremented. The counter monitor is
used to observe values of attribute whose type should be of integer i.e.
(Byte
, Integer
, Short
, Long
).
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:
Fields inherited from class javax.management.monitor.Monitor |
alreadyNotified, dgbTag, OBSERVED_ATTRIBUTE_ERROR_NOTIFIED, OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED, OBSERVED_OBJECT_ERROR_NOTIFIED, RESET_FLAGS_ALREADY_NOTIFIED, RUNTIME_ERROR_NOTIFIED, server |
Constructor Summary | |
CounterMonitor()
Default Constructor. |
Method Summary | |
java.lang.Number |
getDerivedGauge()
This method gets the value of the derived gauge. |
long |
getDerivedGaugeTimeStamp()
This method gets the value of the derived gauge time stamp.The derived gauge time stamp is the value(in the nearest miliseconds) when the notification was triggered. |
boolean |
getDifferenceMode()
This method gets the value of the difference mode. |
java.lang.Number |
getModulus()
This method gets the modulus value of monitor. |
MBeanNotificationInfo[] |
getNotificationInfo()
This method returns a NotificationInfo object containing the name of the Java class of the notification and the notification types sent by the counter monitor. |
boolean |
getNotify()
This method gets the notification's on/off switch value. |
java.lang.Number |
getOffset()
This method gets the offset value. |
java.lang.Number |
getThreshold()
This method gets the value of the threshold. |
void |
postDeregister()
This method allows the monitor MBean to perform any operations needed after having been de-registered by the MBean server. |
void |
postRegister(java.lang.Boolean registrationDone)
This method allows the monitor MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed. |
void |
preDeregister()
This method allows the monitor MBean to perform any operations it needs before being de-registered by the MBean server. |
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
Overriding the preRegister() of MBeanRegistration interface to store the ObjectName locally. |
void |
setDifferenceMode(boolean value)
This method sets the state of the difference mode. |
void |
setModulus(java.lang.Number value)
This method sets the modulus value of the monitor. |
void |
setNotify(boolean value)
This method sets the notification's on/off switch value. |
void |
setOffset(java.lang.Number value)
This method sets the value of the offset. |
void |
setThreshold(java.lang.Number value)
This method sets the value of the threshold.Threshold is the maximum value of that the attribute can reach. |
void |
start()
This method starts the counter monitor. |
void |
stop()
This method stops the counter monitor. |
Methods inherited from class javax.management.monitor.Monitor |
getGranularityPeriod, getObservedAttribute, getObservedObject, isActive, setGranularityPeriod, setObservedAttribute, setObservedObject |
Methods inherited from class javax.management.NotificationBroadcasterSupport |
addNotificationListener, 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 |
getGranularityPeriod, getObservedAttribute, getObservedObject, isActive, setGranularityPeriod, setObservedAttribute, setObservedObject |
Constructor Detail |
public CounterMonitor()
Method Detail |
public java.lang.Number getDerivedGauge()
getDerivedGauge
in interface CounterMonitorMBean
public long getDerivedGaugeTimeStamp()
getDerivedGaugeTimeStamp
in interface CounterMonitorMBean
public boolean getDifferenceMode()
getDifferenceMode
in interface CounterMonitorMBean
public void setDifferenceMode(boolean value)
setDifferenceMode
in interface CounterMonitorMBean
value
- boolean value representing the state of the difference mode.public java.lang.Number getModulus()
getModulus
in interface CounterMonitorMBean
public void setModulus(java.lang.Number value) throws java.lang.IllegalArgumentException
setModulus
in interface CounterMonitorMBean
value
- An instance of java.lang.Number representing the modulus
value for the derived gauge .java.lang.IllegalArgumentException
- - The specified modulus is
null or the modulus value is less than zero.public boolean getNotify()
getNotify
in interface CounterMonitorMBean
public void setNotify(boolean value)
setNotify
in interface CounterMonitorMBean
value
- boolean value to set the sate of the notifications On/Off Switch.public java.lang.Number getOffset()
getOffset
in interface CounterMonitorMBean
public void setOffset(java.lang.Number value) throws java.lang.IllegalArgumentException
setOffset
in interface CounterMonitorMBean
value
- An instance of java.lang.Number giving the value offset.java.lang,IllegalArgumentException
- - The specified offset is
null or the offset value is less than zero.public java.lang.Number getThreshold()
getThreshold
in interface CounterMonitorMBean
public void setThreshold(java.lang.Number value) throws java.lang.IllegalArgumentException
setThreshold
in interface CounterMonitorMBean
value
- An instance of java.lang.Number which is the value of the threshold.public void start()
start
in interface MonitorMBean
start
in class Monitor
public void stop()
stop
in interface MonitorMBean
stop
in class Monitor
public ObjectName preRegister(MBeanServer server, ObjectName name) throws java.lang.Exception
preRegister
in class Monitor
javax.management.monitor.Monitor
server
- - The MBean server in which the monitor MBean will be registered.name
- - The object name of the monitor MBean.-
- java.lang.Exception.public void preDeregister() throws java.lang.Exception
preDeregister
in class Monitor
javax.management.monitor.Monitor
This
- operation throws java.lang.Exceptionpublic void postRegister(java.lang.Boolean registrationDone)
postRegister
in class Monitor
registrationDone
- If registration is done it is true otherwise falsepublic void postDeregister()
postDeregister
in class Monitor
public MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo
in class Monitor
|
XMOJO 5 API Docs | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |