|
|||||||||||
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
The monitor service.
Revisions:
20020319 Adrian Brock:
Field Summary | |
protected int |
alreadyNotified
Deprecated. use alreadyNotifieds [0] |
protected int[] |
alreadyNotifieds
The errors that have already been notified. |
protected static int |
capacityIncrement
The amount by which arrays are incremented. |
protected String |
dbgTag
Deprecated. No replacement. |
protected int |
elementCount
The number of valid elements in the arrays. |
protected static int |
OBSERVED_ATTRIBUTE_ERROR_NOTIFIED
An observed attribute error has been notified. |
protected static int |
OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED
An observed attribute type error has been notified. |
protected static int |
OBSERVED_OBJECT_ERROR_NOTIFIED
An observed object error has been notified. |
protected static int |
RESET_FLAGS_ALREADY_NOTIFIED
Used to reset errors in alreadyNotified . |
protected static int |
RUNTIME_ERROR_NOTIFIED
An observed attribute type error has been notified. |
protected MBeanServer |
server
The server this service is registered in. |
Constructor Summary | |
Monitor()
|
Method Summary | |
void |
addObservedObject(ObjectName object)
Add the object name of the MBean monitored. |
boolean |
containsObservedObject(ObjectName object)
Checks whether the object name is monitored. |
long |
getGranularityPeriod()
Retrieves the granularity period in milliseconds. |
String |
getObservedAttribute()
Retrieves the name of the attribute monitored. |
ObjectName |
getObservedObject()
Retrieves the object name of the MBean monitored. |
ObjectName[] |
getObservedObjects()
Retrieves the object names of the MBeans monitored. |
boolean |
isActive()
Tests whether this monitoring service is active. |
void |
postDeregister()
This method is called by the MBeanServer after deregistration takes place. |
void |
postRegister(Boolean registrationDone)
This method is called by the MBeanServer after registration takes place or when registration fails. |
void |
preDeregister()
This method is called by the MBeanServer before deregistration takes place. |
ObjectName |
preRegister(MBeanServer server,
ObjectName objectName)
This method is called by the MBeanServer before registration takes place. |
void |
removeObservedObject(ObjectName object)
Remove the object name of the MBean monitored. |
void |
setGranularityPeriod(long period)
Sets the granularity period in milliseconds. |
void |
setObservedAttribute(String attribute)
Sets the name of the attribute monitored. |
void |
setObservedObject(ObjectName object)
Sets the object name of the MBean monitored. |
abstract void |
start()
Starts the monitor. |
abstract void |
stop()
Stops the monitor. |
String |
toString()
|
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, wait, wait, wait |
Field Detail |
protected static final int capacityIncrement
protected static final int RESET_FLAGS_ALREADY_NOTIFIED
alreadyNotified
.
protected static final int RUNTIME_ERROR_NOTIFIED
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 int elementCount
protected MBeanServer server
protected int alreadyNotified
alreadyNotifieds
[0]
protected int[] alreadyNotifieds
protected String dbgTag
Constructor Detail |
public Monitor()
Method Detail |
public long getGranularityPeriod()
MonitorMBean
The monitoring takes place once per granularity period.
getGranularityPeriod
in interface MonitorMBean
public String getObservedAttribute()
MonitorMBean
getObservedAttribute
in interface MonitorMBean
public ObjectName getObservedObject()
MonitorMBean
getObservedObject
in interface MonitorMBean
public ObjectName[] getObservedObjects()
MonitorMBean
getObservedObjects
in interface MonitorMBean
public boolean isActive()
MonitorMBean
isActive
in interface MonitorMBean
public void setGranularityPeriod(long period) throws IllegalArgumentException
MonitorMBean
The monitoring takes place once per granularity period.
The default value is 10 seconds.
setGranularityPeriod
in interface MonitorMBean
period
- the granularity period.
IllegalArgumentException
- when the period is not positive.public void setObservedAttribute(String attribute) throws IllegalArgumentException
MonitorMBean
The default value is null.
setObservedAttribute
in interface MonitorMBean
attribute
- the attribute monitored.
IllegalArgumentException
- when the period is not positive.public void setObservedObject(ObjectName object) throws IllegalArgumentException
MonitorMBean
The default value is null.
setObservedObject
in interface MonitorMBean
object
- the object name.
IllegalArgumentException
public void addObservedObject(ObjectName object) throws IllegalArgumentException
MonitorMBean
addObservedObject
in interface MonitorMBean
object
- the object name.
IllegalArgumentException
public void removeObservedObject(ObjectName object)
MonitorMBean
removeObservedObject
in interface MonitorMBean
object
- the object name.public boolean containsObservedObject(ObjectName object)
MonitorMBean
containsObservedObject
in interface MonitorMBean
object
- the object name.
public abstract void start()
MonitorMBean
start
in interface MonitorMBean
public abstract void stop()
MonitorMBean
stop
in interface MonitorMBean
public String toString()
public ObjectName preRegister(MBeanServer server, ObjectName objectName) throws Exception
MBeanRegistration
The MBean can stop the registration by throwing an exception.The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.
preRegister
in interface MBeanRegistration
Exception
- for any error, the MBean is not registered.public void postRegister(Boolean registrationDone)
MBeanRegistration
postRegister
in interface MBeanRegistration
registrationDone
- the MBeanServer passes true when the
MBean was registered, false otherwise.public void preDeregister() throws Exception
MBeanRegistration
The MBean can throw an exception, this will stop the deregistration. The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.
preDeregister
in interface MBeanRegistration
Exception
public void postDeregister()
MBeanRegistration
postDeregister
in interface MBeanRegistration
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |