java.lang.Object
javax.management.NotificationBroadcasterSupport
javax.management.monitor.Monitor
javax.management.monitor.StringMonitor
- All Implemented Interfaces:
- MBeanRegistration,- MonitorMBean,- StringMonitorMBean,- NotificationBroadcaster,- NotificationEmitter
Defines a monitor MBean designed to observe the values of a string
 attribute.
 
A string monitor sends notifications as follows:
-  if the attribute value matches the string to compare value,
      a match notificationis sent. The notify match flag must be set totrue.
 Subsequent matchings of the string to compare values do not cause further notifications unless the attribute value differs from the string to compare value.
-  if the attribute value differs from the string to compare value,
      a differ notificationis sent. The notify differ flag must be set totrue.
 Subsequent differences from the string to compare value do not cause further notifications unless the attribute value matches the string to compare value.
- Since:
- 1.5
- 
Field SummaryFields declared in class javax.management.monitor.MonitoralreadyNotified, 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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionDeprecated.getDerivedGauge(ObjectName object) Gets the derived gauge of the specified object, if this object is contained in the set of observed MBeans, ornullotherwise.longDeprecated.As of JMX 1.2, replaced bygetDerivedGaugeTimeStamp(ObjectName)longgetDerivedGaugeTimeStamp(ObjectName object) Gets the derived gauge timestamp of the specified object, if this object is contained in the set of observed MBeans, or0otherwise.Returns aNotificationInfoobject containing the name of the Java class of the notification and the notification types sent by the string monitor.booleanGets the differing notification's on/off switch value common to all observed MBeans.booleanGets the matching notification's on/off switch value common to all observed MBeans.Gets the string to compare with the observed attribute common to all observed MBeans.voidsetNotifyDiffer(boolean value) Sets the differing notification's on/off switch value common to all observed MBeans.voidsetNotifyMatch(boolean value) Sets the matching notification's on/off switch value common to all observed MBeans.voidsetStringToCompare(String value) Sets the string to compare with the observed attribute common to all observed MBeans.voidstart()Starts the string monitor.voidstop()Stops the string monitor.Methods declared in class javax.management.monitor.MonitoraddObservedObject, containsObservedObject, getGranularityPeriod, getObservedAttribute, getObservedObject, getObservedObjects, isActive, postDeregister, postRegister, preDeregister, preRegister, removeObservedObject, setGranularityPeriod, setObservedAttribute, setObservedObjectMethods declared in class javax.management.NotificationBroadcasterSupportaddNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotificationMethods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods declared in interface javax.management.monitor.MonitorMBeanaddObservedObject, containsObservedObject, getGranularityPeriod, getObservedAttribute, getObservedObject, getObservedObjects, isActive, removeObservedObject, setGranularityPeriod, setObservedAttribute, setObservedObject
- 
Constructor Details- 
StringMonitorpublic StringMonitor()Default constructor.
 
- 
- 
Method Details- 
startpublic void start()Starts the string monitor.- Specified by:
- startin interface- MonitorMBean
- Specified by:
- startin class- Monitor
 
- 
stoppublic void stop()Stops the string monitor.- Specified by:
- stopin interface- MonitorMBean
- Specified by:
- stopin class- Monitor
 
- 
getDerivedGaugeGets the derived gauge of the specified object, if this object is contained in the set of observed MBeans, ornullotherwise.- Specified by:
- getDerivedGaugein interface- StringMonitorMBean
- Parameters:
- object- the name of the MBean whose derived gauge is required.
- Returns:
- The derived gauge of the specified object.
 
- 
getDerivedGaugeTimeStampGets the derived gauge timestamp of the specified object, if this object is contained in the set of observed MBeans, or0otherwise.- Specified by:
- getDerivedGaugeTimeStampin interface- StringMonitorMBean
- Parameters:
- object- the name of the object whose derived gauge timestamp is to be returned.
- Returns:
- The derived gauge timestamp of the specified object.
 
- 
getDerivedGaugeDeprecated.As of JMX 1.2, replaced bygetDerivedGauge(ObjectName)Returns the derived gauge of the first object in the set of observed MBeans.- Specified by:
- getDerivedGaugein interface- StringMonitorMBean
- Returns:
- The derived gauge.
 
- 
getDerivedGaugeTimeStampDeprecated.As of JMX 1.2, replaced bygetDerivedGaugeTimeStamp(ObjectName)Gets the derived gauge timestamp of the first object in the set of observed MBeans.- Specified by:
- getDerivedGaugeTimeStampin interface- StringMonitorMBean
- Returns:
- The derived gauge timestamp.
 
- 
getStringToCompareGets the string to compare with the observed attribute common to all observed MBeans.- Specified by:
- getStringToComparein interface- StringMonitorMBean
- Returns:
- The string value.
- See Also:
 
- 
setStringToCompareSets the string to compare with the observed attribute common to all observed MBeans.- Specified by:
- setStringToComparein interface- StringMonitorMBean
- Parameters:
- value- The string value.
- Throws:
- IllegalArgumentException- The specified string to compare is null.
- See Also:
 
- 
getNotifyMatchpublic boolean getNotifyMatch()Gets the matching notification's on/off switch value common to all observed MBeans.- Specified by:
- getNotifyMatchin interface- StringMonitorMBean
- Returns:
- trueif the string monitor notifies when matching the string to compare,- falseotherwise.
- See Also:
 
- 
setNotifyMatchpublic void setNotifyMatch(boolean value) Sets the matching notification's on/off switch value common to all observed MBeans.- Specified by:
- setNotifyMatchin interface- StringMonitorMBean
- Parameters:
- value- The matching notification's on/off switch value.
- See Also:
 
- 
getNotifyDifferpublic boolean getNotifyDiffer()Gets the differing notification's on/off switch value common to all observed MBeans.- Specified by:
- getNotifyDifferin interface- StringMonitorMBean
- Returns:
- trueif the string monitor notifies when differing from the string to compare,- falseotherwise.
- See Also:
 
- 
setNotifyDifferpublic void setNotifyDiffer(boolean value) Sets the differing notification's on/off switch value common to all observed MBeans.- Specified by:
- setNotifyDifferin interface- StringMonitorMBean
- Parameters:
- value- The differing notification's on/off switch value.
- See Also:
 
- 
getNotificationInfoReturns aNotificationInfoobject containing the name of the Java class of the notification and the notification types sent by the string monitor.- Specified by:
- getNotificationInfoin interface- NotificationBroadcaster
- Returns:
- the array of possible notifications.
 
 
- 
getDerivedGauge(ObjectName)