| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
StringMonitor sm = new StringMonitor();
Based on 21 examples
public class StringMonitor extends Monitor implements StringMonitorMBean
Defines a monitor MBean designed to observe the values of a string attribute.
A string monitor sends notifications as follows:
true
.
true
.
Field Summary |
---|
Fields inherited from class javax.management.monitor.Monitor |
---|
alreadyNotified, alreadyNotifieds, capacityIncrement, dbgTag, elementCount, OBSERVED_ATTRIBUTE_ERROR_NOTIFIED, OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED, OBSERVED_OBJECT_ERROR_NOTIFIED, RESET_FLAGS_ALREADY_NOTIFIED, RUNTIME_ERROR_NOTIFIED, server |
Constructor Summary | |
---|---|
Default constructor. |
Method Summary | |
---|---|
String |
Returns the derived gauge of the first object in the set of observed MBeans. |
String |
getDerivedGauge(ObjectName object) Gets the derived gauge of the specified object, if this object is contained in the set of observed MBeans, or null otherwise.
|
long |
Gets the derived gauge timestamp of the first object in the set of observed MBeans. |
long |
getDerivedGaugeTimeStamp(ObjectName object) Gets the derived gauge timestamp of the specified object, if this object is contained in the set of observed MBeans, or 0 otherwise.
|
MBeanNotificationInfo[] |
Returns a NotificationInfo object containing the name of
the Java class of the notification and the notification types sent by
the string monitor.
|
boolean |
Gets the differing notification's on/off switch value common to all observed MBeans. |
boolean |
Gets the matching notification's on/off switch value common to all observed MBeans. |
String |
Gets the string to compare with the observed attribute common to all observed MBeans. |
void |
setNotifyDiffer(boolean value) Sets the differing notification's on/off switch value common to all observed MBeans. |
void |
setNotifyMatch(boolean value) Sets the matching notification's on/off switch value common to all observed MBeans. |
void |
setStringToCompare(String value) Sets the string to compare with the observed attribute common to all observed MBeans. |
void |
start() Starts the string monitor. |
void |
stop() Stops the string monitor. |
Methods inherited from class javax.management.monitor.Monitor |
---|
addObservedObject, containsObservedObject, getGranularityPeriod, getObservedAttribute, getObservedObject, getObservedObjects, isActive, postDeregister, postRegister, preDeregister, preRegister, removeObservedObject, setGranularityPeriod, setObservedAttribute, setObservedObject, start, 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 |
Constructor Detail |
---|
public StringMonitor()
Method Detail |
---|
public synchronized String getDerivedGauge()
public synchronized String getDerivedGauge(ObjectName object)
null
otherwise.
getDerivedGauge
in class Monitor
object
- the name of the MBean whose derived gauge is required.public synchronized long getDerivedGaugeTimeStamp()
public synchronized long getDerivedGaugeTimeStamp(ObjectName object)
0
otherwise.
getDerivedGaugeTimeStamp
in class Monitor
object
- the name of the object whose derived gauge
timestamp is to be returned.public MBeanNotificationInfo[] getNotificationInfo()
NotificationInfo
object containing the name of
the Java class of the notification and the notification types sent by
the string monitor.
getNotificationInfo
in class NotificationBroadcasterSupport
public synchronized boolean getNotifyDiffer()
true
if the string monitor notifies when
differing from the string to compare, false
otherwise.public synchronized boolean getNotifyMatch()
true
if the string monitor notifies when
matching the string to compare, false
otherwise.public synchronized String getStringToCompare()
public synchronized void setNotifyDiffer(boolean value)
value
- The differing notification's on/off switch value.public synchronized void setNotifyMatch(boolean value)
value
- The matching notification's on/off switch value.public synchronized void setStringToCompare(String value) throws IllegalArgumentException
value
- The string value.IllegalArgumentException
- The specified
string to compare is null.public synchronized void start()
start
in class Monitor
public synchronized void stop()
stop
in class Monitor
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |