|
|||||||||
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
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 int |
alreadyNotified
Selected monitor errors that have already been notified. |
protected java.lang.String |
dbgTag
|
protected static int |
OBSERVED_ATTRIBUTE_ERROR_NOTIFIED
Flag denoting that a notification has occurred after changing the observed attribute. |
protected static int |
OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED
Flag denoting that a notification has occurred after changing the observed object or the observed attribute. |
protected static int |
OBSERVED_OBJECT_ERROR_NOTIFIED
Flag denoting that a notification has occurred after changing the observed object. |
protected static int |
RESET_FLAGS_ALREADY_NOTIFIED
This flag is used to reset the alreadyNotified monitor attribute. |
protected static int |
RUNTIME_ERROR_NOTIFIED
Flag denoting that a notification has occurred after changing the observed object or the observed attribute. |
protected MBeanServer |
server
Reference on the MBean server. |
Constructor Summary | |
Monitor()
|
Method Summary | |
long |
getGranularityPeriod()
Gets the granularity period (in milliseconds). |
java.lang.String |
getObservedAttribute()
Gets the attribute being observed. |
ObjectName |
getObservedObject()
Gets the object name of the object being observed. |
boolean |
isActive()
Tests whether the monitor MBean is active. |
void |
postDeregister()
Allows the monitor MBean to perform any operations needed after having been de-registered by the MBean server. |
void |
postRegister(java.lang.Boolean registrationDone)
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()
Allows the monitor MBean to perform any operations it needs before being de-registered by the MBean server. |
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
Allows the monitor MBean to perform any operations it needs before being registered in the MBean server. |
void |
setGranularityPeriod(long period)
Sets the granularity period (in milliseconds). |
void |
setObservedAttribute(java.lang.String attribute)
Sets the attribute to observe. |
void |
setObservedObject(ObjectName object)
Sets the object to observe identified by its object name. |
abstract void |
start()
Starts the monitor. |
abstract void |
stop()
Stops the monitor. |
Methods inherited from class javax.management.NotificationBroadcasterSupport |
addNotificationListener,
getNotificationInfo,
removeNotificationListener,
sendNotification |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected MBeanServer server
preRegister(MBeanServer server, ObjectName name)
protected int alreadyNotified
protected static final int RESET_FLAGS_ALREADY_NOTIFIED
alreadyNotified
monitor attribute.protected static final int OBSERVED_OBJECT_ERROR_NOTIFIED
protected static final int OBSERVED_ATTRIBUTE_ERROR_NOTIFIED
protected static final int OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED
protected static final int RUNTIME_ERROR_NOTIFIED
protected java.lang.String dbgTag
Constructor Detail |
public Monitor()
Method Detail |
public ObjectName preRegister(MBeanServer server, ObjectName name) throws java.lang.Exception
Initializes the reference to the MBean server.
server
- The MBean server in which the monitor MBean will be registered.name
- The object name of the monitor MBean.public void postRegister(java.lang.Boolean registrationDone)
Not used in this context.
registrationDone
- 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
Stops the monitor.
public void postDeregister()
Not used in this context.
public abstract void start()
public abstract void stop()
public ObjectName getObservedObject()
public void setObservedObject(ObjectName object) throws java.lang.IllegalArgumentException
object
- The object to observe.public java.lang.String getObservedAttribute()
public void setObservedAttribute(java.lang.String attribute) throws java.lang.IllegalArgumentException
attribute
- The attribute to observe.public long getGranularityPeriod()
public void setGranularityPeriod(long period) throws java.lang.IllegalArgumentException
period
- The granularity period value.public boolean isActive()
start
method is called.
It becomes inactive when the stop
method is called.true
if the monitor MBean is active, false
otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |