|
|||||||||
| 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
This is the super class for all types of monitor MBeans and defines the common part to all monitor MBeans. Using Monitor MBeans, the observed attribute of another MBean (the observed MBean) 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
Deprecated. equivalent to alreadyNotifieds[0]. |
protected int[] |
alreadyNotifieds
Selected monitor errors that have already been notified. |
protected static int |
capacityIncrement
The amount by which the capacity of the monitor arrays are automatically incremented when size exceeds their capacity. |
protected java.lang.String |
dbgTag
This field is not required. |
(package private) java.util.ArrayList |
derivedGaugeTimeStamp
Derived gauge timestamp as Long object. |
protected int |
elementCount
Number of valid components in the list of observed objects. |
(package private) boolean |
isActive
Indicates whether this Monitor is live or dead. |
(package private) Log |
logger
Logger |
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 or the observed attribute. |
protected static int |
RESET_FLAGS_ALREADY_NOTIFIED
This flag is used to reset the alreadyNotifieds monitor attribute. |
protected static int |
RUNTIME_ERROR_NOTIFIED
Flag denoting that a notification has occurred after changing the observed object or the observed attribute. |
(package private) long |
sequenceNumber
Monitor sequence number, used when constructing MonitorNotification. |
protected MBeanServer |
server
Reference on the MBean server. |
| Fields inherited from class javax.management.NotificationBroadcasterSupport |
li |
| Constructor Summary | |
Monitor()
Default constructor |
|
| Method Summary | |
void |
addObservedObject(ObjectName object)
This method adds the specified object in the set of observed MBeans, if this object is not already present. |
boolean |
containsObservedObject(ObjectName objName)
This method tests whether the specified object is in the set of observed MBeans. |
long |
getGranularityPeriod()
This method gets the granularity period (in milliseconds). |
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. |
java.lang.String |
getObservedAttribute()
This method gets the name of the attribute being observed. |
ObjectName |
getObservedObject()
Deprecated. Replaced by getObservedObjects() |
(package private) ObjectName |
getObservedObject(int index)
Retrives the ObjectName of the object at the specified
index in the list of observed MBeans. |
ObjectName[] |
getObservedObjects()
This method returns an array containing the objects being observed. |
(package private) int |
indexOf(java.lang.Object objName)
Retrives the index of the first occurance of the monitored object in the list of observed MBeans. |
(package private) void |
insertElementAt(int[] array,
int value,
int index)
Inserts the specified value at the given index in the specified int array |
(package private) abstract void |
insertSpecificElementAt(int index)
This method will be implemented by the specific monitor classes (Counter, Gauge and String). |
boolean |
isActive()
This method tests whether the monitor MBean is active. |
(package private) boolean |
isFlagsReset(int index,
int errorType)
Checks whether the flag is been set for the specified error type |
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)
This method allows the monitor MBean to perform any operations it needs before being registered in the MBean server. |
(package private) void |
removeElementAt(int[] array,
int index)
Removes the component at the specified index from the specified int array. |
void |
removeObservedObject(ObjectName objName)
This method removes the specified object from the set of observed MBeans. |
(package private) abstract void |
removeSpecificElementAt(int index)
This method will be implemented by the specific monitor classes (Counter, Gauge and String). |
(package private) void |
resetAllAlreadyNotifiedFlags(int index)
Resets all the already notified flags |
(package private) void |
resetAlreadyNotifiedFlag(int index,
int mask)
Reset the given bits in the given element of alreadyNotifieds. |
(package private) void |
sendNotification(java.lang.String type,
long timeStamp,
java.lang.String msg,
java.lang.Object derGauge,
java.lang.Object trigger,
int index)
This method is used to create and send a monitor notification to all registered listeners for this kind of notification, by the monitor MBean. |
(package private) void |
setAlreadyNotifiedFlag(int index,
int mask)
Set the given bits in the given element of alreadyNotifieds. |
void |
setGranularityPeriod(long period)
This method sets the granularity period (in milliseconds). |
void |
setObservedAttribute(java.lang.String attribute)
This method sets the attribute being observed. |
void |
setObservedObject(ObjectName objName)
Deprecated. Replaced by addObservedObject(javax.management.ObjectName) |
abstract void |
start()
This method starts the monitor. |
abstract void |
stop()
This method stops the monitor. |
(package private) void |
updateDeprecatedAlreadyNotifiedFlag()
Update the deprecated alreadyNotified field. |
| Methods inherited from class javax.management.NotificationBroadcasterSupport |
addNotificationListener,
handleNotification,
handleNotification,
removeNotificationListener,
removeNotificationListener,
sendNotification |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected static final int capacityIncrement
protected int elementCount
protected int alreadyNotified
alreadyNotifieds[0].
protected int[] alreadyNotifieds
Selected monitor errors that have already been notified.
Each element in this array corresponds to an observed object
in the list. It contains a bit mask of the flags
OBSERVED_OBJECT_ERROR_NOTIFIED etc, indicating whether the
corresponding notification has already been sent for the MBean
being monitored.
protected MBeanServer server
preRegister(MBeanServer server, ObjectName name)transient java.util.ArrayList derivedGaugeTimeStamp
protected static final int RESET_FLAGS_ALREADY_NOTIFIED
alreadyNotifieds 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
transient boolean isActive
false.transient long sequenceNumber
Log logger
protected java.lang.String dbgTag
| Constructor Detail |
public Monitor()
| Method Detail |
public long getGranularityPeriod()
setGranularityPeriod(long)
public void setGranularityPeriod(long period)
throws java.lang.IllegalArgumentException
period - the granularity period value.getGranularityPeriod()public java.lang.String getObservedAttribute()
setObservedAttribute(java.lang.String)
public void setObservedAttribute(java.lang.String attribute)
throws java.lang.IllegalArgumentException
attribute - The attribute to be observed.getObservedAttribute()public ObjectName getObservedObject()
getObservedObjects()
null if there is no such object.setObservedObject(ObjectName)
public void setObservedObject(ObjectName objName)
throws java.lang.IllegalArgumentException
addObservedObject(javax.management.ObjectName)
object - The object to observe.getObservedObject()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.
public void addObservedObject(ObjectName object)
throws java.lang.IllegalArgumentException
object - The object to observe.public void removeObservedObject(ObjectName objName)
object - The object to remove.public boolean containsObservedObject(ObjectName objName)
object - The object to check.true if the specified object is present, false otherwise.public ObjectName[] getObservedObjects()
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 MBeanNotificationInfo[] getNotificationInfo()
abstract void insertSpecificElementAt(int index)
abstract void removeSpecificElementAt(int index)
void sendNotification(java.lang.String type,
long timeStamp,
java.lang.String msg,
java.lang.Object derGauge,
java.lang.Object trigger,
int index)
type - The notification type.timeStamp - The notification emission date.msg - The notification message.derGauge - The derived gauge.trigger - The threshold/string (depending on the monitor type) that triggered off the notification.index - The index of the observed object that triggered off the notification.
ObjectName getObservedObject(int index)
throws java.lang.ArrayIndexOutOfBoundsException
ObjectName of the object at the specified
index in the list of observed MBeans.int indexOf(java.lang.Object objName)
boolean isFlagsReset(int index,
int errorType)
void resetAllAlreadyNotifiedFlags(int index)
void updateDeprecatedAlreadyNotifiedFlag()
alreadyNotified field.
void setAlreadyNotifiedFlag(int index,
int mask)
alreadyNotifieds.
Ensure the deprecated alreadyNotified field is updated
if appropriate.
void resetAlreadyNotifiedFlag(int index,
int mask)
alreadyNotifieds.
Ensure the deprecated alreadyNotified field is updated
if appropriate.
void insertElementAt(int[] array,
int value,
int index)
void removeElementAt(int[] array,
int index)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||