|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.management.NotificationBroadcasterSupport (src) 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 java.lang.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 (src) |
server
The server this service is registered in. |
Constructor Summary | |
Monitor()
|
Method Summary | |
void |
addObservedObject(ObjectName (src) object)
Add the object name of the MBean monitored. |
boolean |
containsObservedObject(ObjectName (src) object)
Checks whether the object name is monitored. |
long |
getGranularityPeriod()
Retrieves the granularity period in milliseconds. |
java.lang.String |
getObservedAttribute()
Retrieves the name of the attribute monitored. |
ObjectName (src) |
getObservedObject()
Retrieves the object name of the MBean monitored. |
ObjectName (src) [] |
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(java.lang.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 (src) |
preRegister(MBeanServer (src) server,
ObjectName (src) objectName)
This method is called by the MBeanServer before registration takes place. |
void |
removeObservedObject(ObjectName (src) object)
Remove the object name of the MBean monitored. |
void |
setGranularityPeriod(long period)
Sets the granularity period in milliseconds. |
void |
setObservedAttribute(java.lang.String attribute)
Sets the name of the attribute monitored. |
void |
setObservedObject(ObjectName (src) object)
Sets the object name of the MBean monitored. |
abstract void |
start()
Starts the monitor. |
abstract void |
stop()
Stops the monitor. |
java.lang.String |
toString()
|
Methods inherited from class javax.management.NotificationBroadcasterSupport (src) |
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 (src) server
protected int alreadyNotified
alreadyNotifieds
[0]
protected int[] alreadyNotifieds
protected java.lang.String dbgTag
Constructor Detail |
public Monitor()
Method Detail |
public long getGranularityPeriod()
MonitorMBean (src)
The monitoring takes place once per granularity period.
getGranularityPeriod
in interface MonitorMBean (src)
public java.lang.String getObservedAttribute()
MonitorMBean (src)
getObservedAttribute
in interface MonitorMBean (src)
public ObjectName (src) getObservedObject()
MonitorMBean (src)
getObservedObject
in interface MonitorMBean (src)
public ObjectName (src) [] getObservedObjects()
MonitorMBean (src)
getObservedObjects
in interface MonitorMBean (src)
public boolean isActive()
MonitorMBean (src)
isActive
in interface MonitorMBean (src)
public void setGranularityPeriod(long period) throws java.lang.IllegalArgumentException
MonitorMBean (src)
The monitoring takes place once per granularity period.
The default value is 10 seconds.
setGranularityPeriod
in interface MonitorMBean (src)
period
- the granularity period.
java.lang.IllegalArgumentException
- when the period is not positive.public void setObservedAttribute(java.lang.String attribute) throws java.lang.IllegalArgumentException
MonitorMBean (src)
The default value is null.
setObservedAttribute
in interface MonitorMBean (src)
attribute
- the attribute monitored.
java.lang.IllegalArgumentException
- when the period is not positive.public void setObservedObject(ObjectName (src) object) throws java.lang.IllegalArgumentException
MonitorMBean (src)
The default value is null.
setObservedObject
in interface MonitorMBean (src)
object
- the object name.
java.lang.IllegalArgumentException
public void addObservedObject(ObjectName (src) object) throws java.lang.IllegalArgumentException
MonitorMBean (src)
addObservedObject
in interface MonitorMBean (src)
object
- the object name.
java.lang.IllegalArgumentException
public void removeObservedObject(ObjectName (src) object)
MonitorMBean (src)
removeObservedObject
in interface MonitorMBean (src)
object
- the object name.public boolean containsObservedObject(ObjectName (src) object)
MonitorMBean (src)
containsObservedObject
in interface MonitorMBean (src)
object
- the object name.
public abstract void start()
MonitorMBean (src)
start
in interface MonitorMBean (src)
public abstract void stop()
MonitorMBean (src)
stop
in interface MonitorMBean (src)
public java.lang.String toString()
public ObjectName (src) preRegister(MBeanServer (src) server, ObjectName (src) objectName) throws java.lang.Exception
MBeanRegistration (src)
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 (src)
java.lang.Exception
- for any error, the MBean is not registered.public void postRegister(java.lang.Boolean registrationDone)
MBeanRegistration (src)
postRegister
in interface MBeanRegistration (src)
registrationDone
- the MBeanServer passes true when the
MBean was registered, false otherwise.public void preDeregister() throws java.lang.Exception
MBeanRegistration (src)
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 (src)
java.lang.Exception
public void postDeregister()
MBeanRegistration (src)
postDeregister
in interface MBeanRegistration (src)
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |