javax.management.monitor
Class StringMonitor

java.lang.Object
  |
  +--javax.management.NotificationBroadcasterSupport
        |
        +--javax.management.monitor.Monitor
              |
              +--javax.management.monitor.StringMonitor
All Implemented Interfaces:
MBeanRegistration, MonitorMBean, NotificationBroadcaster, StringMonitorMBean

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:

Author:
Young Yang

Constructor Summary
StringMonitor()
           
 
Method Summary
protected  void doMonitor(java.lang.Object value)
           
 java.lang.String getDerivedGauge()
          Gets the derived gauge.
 long getDerivedGaugeTimeStamp()
          Gets the derived gauge timestamp.
 MBeanNotificationInfo[] getNotificationInfo()
          Returns a NotificationInfo object contaning the name of the Java class of the notification and the notification types sent.
 boolean getNotifyDiffer()
          Gets the differing notification's on/off switch value.
 boolean getNotifyMatch()
          Gets the matching notification's on/off switch value.
 java.lang.String getStringToCompare()
          Gets the string to compare with the observed attribute.
 void setNotifyDiffer(boolean value)
          Sets the differing notification's on/off switch value.
 void setNotifyMatch(boolean value)
          Sets the matching notification's on/off switch value.
 void setStringToCompare(java.lang.String value)
          Sets the string to compare with the observed attribute.
 void start()
           
 void stop()
           
 
Methods inherited from class javax.management.monitor.Monitor
_start, _stop, getGranularityPeriod, getObservedAttribute, getObservedObject, isActive, postDeregister, postRegister, preDeregister, preRegister, sendNotification, setGranularityPeriod, setObservedAttribute, setObservedObject
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.management.monitor.MonitorMBean
getGranularityPeriod, getObservedAttribute, getObservedObject, isActive, setGranularityPeriod, setObservedAttribute, setObservedObject
 

Constructor Detail

StringMonitor

public StringMonitor()
Method Detail

start

public void start()
Specified by:
start in class Monitor

stop

public void stop()
Specified by:
stop in class Monitor

getDerivedGauge

public java.lang.String getDerivedGauge()
Description copied from interface: StringMonitorMBean
Gets the derived gauge.

Specified by:
getDerivedGauge in interface StringMonitorMBean
Returns:
The derived gauge.

getDerivedGaugeTimeStamp

public long getDerivedGaugeTimeStamp()
Description copied from interface: StringMonitorMBean
Gets the derived gauge timestamp.

Specified by:
getDerivedGaugeTimeStamp in interface StringMonitorMBean
Returns:
The derived gauge timestamp.

getStringToCompare

public java.lang.String getStringToCompare()
Description copied from interface: StringMonitorMBean
Gets the string to compare with the observed attribute.

Specified by:
getStringToCompare in interface StringMonitorMBean
Returns:
The string value.

setStringToCompare

public void setStringToCompare(java.lang.String value)
                        throws java.lang.IllegalArgumentException
Description copied from interface: StringMonitorMBean
Sets the string to compare with the observed attribute.

Specified by:
setStringToCompare in interface StringMonitorMBean
Parameters:
value - The string value.
Throws:
java.lang.IllegalArgumentException - The specified string to compare is null.

getNotifyMatch

public boolean getNotifyMatch()
Description copied from interface: StringMonitorMBean
Gets the matching notification's on/off switch value.

Specified by:
getNotifyMatch in interface StringMonitorMBean
Returns:
true if the string monitor notifies when matching, false otherwise.

setNotifyMatch

public void setNotifyMatch(boolean value)
Description copied from interface: StringMonitorMBean
Sets the matching notification's on/off switch value.

Specified by:
setNotifyMatch in interface StringMonitorMBean
Parameters:
value - The matching notification's on/off switch value.

getNotifyDiffer

public boolean getNotifyDiffer()
Description copied from interface: StringMonitorMBean
Gets the differing notification's on/off switch value.

Specified by:
getNotifyDiffer in interface StringMonitorMBean
Returns:
true if the string monitor notifies when differing, false otherwise.

setNotifyDiffer

public void setNotifyDiffer(boolean value)
Description copied from interface: StringMonitorMBean
Sets the differing notification's on/off switch value.

Specified by:
setNotifyDiffer in interface StringMonitorMBean
Parameters:
value - The differing notification's on/off switch value.

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
Description copied from class: NotificationBroadcasterSupport
Returns a NotificationInfo object contaning the name of the Java class of the notification and the notification types sent.

Specified by:
getNotificationInfo in interface NotificationBroadcaster
Overrides:
getNotificationInfo in class NotificationBroadcasterSupport

doMonitor

protected void doMonitor(java.lang.Object value)
Specified by:
doMonitor in class Monitor