|
|||||||||||
| 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
Defines the common part to all monitor MBeans. A monitor MBean monitors values of an attribute in an observed MBean. The observed attribute is monitored at intervals specified by the granularity period. A gauge value (derived gauge) is derived from the values of the observed attribute.
| Field Summary | |
protected java.util.Map |
observedObjects
|
| Constructor Summary | |
Monitor()
|
|
| Method Summary | |
protected void |
_start()
|
protected void |
_stop()
|
abstract void |
addObservedObject(ObjectName objectName)
Adds the specified object in the set of observed MBeans. |
boolean |
containsObservedObject(ObjectName objectName)
Tests whether the specified object is in the set of observed MBeans. |
protected abstract void |
doMonitor(ObjectName observedObject,
java.lang.Object value)
|
long |
getGranularityPeriod()
Gets the granularity period (in milliseconds). |
protected javax.management.monitor.MonitorData |
getMonitorData(ObjectName observedObject)
|
java.lang.String |
getObservedAttribute()
Gets the attribute being observed. |
ObjectName[] |
getObservedObjects()
Returns an array containing the objects being observed. |
boolean |
isActive()
Tests if the monitor MBean is active. |
void |
postDeregister()
Allows the MBean to perform any operations needed after having been de-registered in the MBean server. |
void |
postRegister(java.lang.Boolean value)
Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed. |
void |
preDeregister()
Allows the MBean to perform any operations it needs before being de-registered by the MBean server. |
ObjectName |
preRegister(MBeanServer mbeanserver,
ObjectName objectname)
Allows the MBean to perform any operations it needs before being registered in the MBean server. |
void |
removeObservedObject(ObjectName objectName)
Removes the specified object from the set of observed MBeans. |
protected void |
sendNotification(java.lang.String type,
long timeStamp,
java.lang.String message,
java.lang.Object derivedValue,
java.lang.Object trigger,
ObjectName observedObject)
|
void |
setGranularityPeriod(long period)
Sets the granularity period (in milliseconds). |
void |
setObservedAttribute(java.lang.String attribute)
Sets the attribute to observe. |
abstract void |
start()
|
abstract void |
stop()
|
| Methods inherited from class javax.management.NotificationBroadcasterSupport |
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Map observedObjects
| Constructor Detail |
public Monitor()
| Method Detail |
public ObjectName preRegister(MBeanServer mbeanserver,
ObjectName objectname)
throws java.lang.Exception
MBeanRegistration
preRegister in interface MBeanRegistrationmbeanserver - The MBean server in which the MBean will be registered.objectname - The object name of the MBean.
java.lang.Exception - This exception should be caught by the MBean server and re-thrown
as an MBeanRegistrationException.public void postRegister(java.lang.Boolean value)
MBeanRegistration
postRegister in interface MBeanRegistrationvalue - Indicates whether or not the MBean has been successfully registered in
the MBean server. The value false means that the registration phase has failed.
public void preDeregister()
throws java.lang.Exception
MBeanRegistration
preDeregister in interface MBeanRegistrationjava.lang.Exception - This exception should be caught by the MBean server and re-thrown
as an MBeanRegistrationException.public void postDeregister()
MBeanRegistration
postDeregister in interface MBeanRegistration
public abstract void addObservedObject(ObjectName objectName)
throws java.lang.IllegalArgumentException
MonitorMBean
addObservedObject in interface MonitorMBeanobjectName - The object to observe.
java.lang.IllegalArgumentException - the specified object is null.public ObjectName[] getObservedObjects()
MonitorMBean
getObservedObjects in interface MonitorMBeanpublic boolean containsObservedObject(ObjectName objectName)
MonitorMBean
containsObservedObject in interface MonitorMBeanobjectName - The object to check.
true if the specified object is in the set, false otherwise.public void removeObservedObject(ObjectName objectName)
MonitorMBean
removeObservedObject in interface MonitorMBeanobjectName - The object to remove.public java.lang.String getObservedAttribute()
MonitorMBean
getObservedAttribute in interface MonitorMBeanMonitorMBean.setObservedAttribute(java.lang.String)
public void setObservedAttribute(java.lang.String attribute)
throws java.lang.IllegalArgumentException
MonitorMBean
setObservedAttribute in interface MonitorMBeanattribute - The attribute to observe.
java.lang.IllegalArgumentExceptionMonitorMBean.getObservedAttribute()public long getGranularityPeriod()
MonitorMBean
getGranularityPeriod in interface MonitorMBeanMonitorMBean.setGranularityPeriod(long)
public void setGranularityPeriod(long period)
throws java.lang.IllegalArgumentException
MonitorMBean
setGranularityPeriod in interface MonitorMBeanperiod - The granularity period.
java.lang.IllegalArgumentException - The granularity
period is less than or equal to zero.MonitorMBean.getGranularityPeriod()public boolean isActive()
MonitorMBean
isActive in interface MonitorMBeantrue if the monitor MBean is active, false otherwise.public abstract void start()
public abstract void stop()
protected void sendNotification(java.lang.String type,
long timeStamp,
java.lang.String message,
java.lang.Object derivedValue,
java.lang.Object trigger,
ObjectName observedObject)
protected void _start()
protected void _stop()
protected javax.management.monitor.MonitorData getMonitorData(ObjectName observedObject)
protected abstract void doMonitor(ObjectName observedObject,
java.lang.Object value)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||