- java.lang.Object
 -  
      
- javax.management.NotificationBroadcasterSupport
 -  
        
- javax.management.monitor.Monitor
 -  
          
- javax.management.monitor.StringMonitor
 
 
 
 
-  
       
- 实现的所有接口
 -  
         
MBeanRegistration,MonitorMBean,StringMonitorMBean,NotificationBroadcaster,NotificationEmitter 
public class StringMonitor extends Monitor implements StringMonitorMBean
定义用于观察字符串属性值的监视器MBean。字符串监视器发送通知如下:
-  如果属性值与要比较的字符串值匹配,则发送
match notification。 通知匹配标志必须设置为true。
除非属性值与要比较的字符串值不同,否则后续匹配字符串的匹配值不会导致进一步的通知。 -  如果属性值与要比较的字符串不同,则发送
differ notification。 notifytrue标志必须设置为true。
除非属性值与要比较的字符串值匹配,否则从字符串到比较值的后续差异不会导致进一步通知。 
- 从以下版本开始:
 - 1.5
 
 
-  
        
       
-  
             
构造方法摘要
构造方法 构造器 描述 StringMonitor()默认构造函数。 
-  
             
方法摘要
所有方法 实例方法 具体的方法 弃用的方法 变量和类型 方法 描述 StringgetDerivedGauge()已过时。截至JMX 1.2,由getDerivedGauge(ObjectName)取代StringgetDerivedGauge(ObjectName object)如果此对象包含在观察到的MBeans集中,则获取指定对象的派生尺度,否则null。longgetDerivedGaugeTimeStamp()已过时。截至JMX 1.2,由getDerivedGaugeTimeStamp(ObjectName)取代longgetDerivedGaugeTimeStamp(ObjectName object)如果此对象包含在观察到的MBeans集中,则获取指定对象的派生尺度时间戳,否则0。MBeanNotificationInfo[]getNotificationInfo()返回一个NotificationInfo对象,其中包含通知的Java类的名称和字符串监视器发送的通知类型。booleangetNotifyDiffer()获取所有观察到的MBeans共有的不同通知的开/关切换值。booleangetNotifyMatch()获取所有观察到的MBeans共有的匹配通知的开/关切换值。StringgetStringToCompare()获取要与所有观察到的MBeans共同的观察属性进行比较的字符串。voidsetNotifyDiffer(boolean value)设置所有观察到的MBeans共有的不同通知的开/关切换值。voidsetNotifyMatch(boolean value)设置所有观察到的MBeans共同的匹配通知的开/关切换值。voidsetStringToCompare(String value)设置要与所有观察到的MBeans共同的观察属性进行比较的字符串。voidstart()启动字符串监视器。voidstop()停止字符串监视器。-  
               
声明方法的类 javax.management.monitor.Monitor
addObservedObject, containsObservedObject, getGranularityPeriod, getObservedAttribute, getObservedObject, getObservedObjects, isActive, postDeregister, postRegister, preDeregister, preRegister, removeObservedObject, setGranularityPeriod, setObservedAttribute, setObservedObject 
-  
               
声明方法的类 javax.management.NotificationBroadcasterSupport
addNotificationListener, handleNotification, sendNotification 
-  
               
声明方法的类 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
-  
               
声明方法的接口 javax.management.monitor.MonitorMBean
addObservedObject, containsObservedObject, getGranularityPeriod, getObservedAttribute, getObservedObject, getObservedObjects, isActive, removeObservedObject, setGranularityPeriod, setObservedAttribute, setObservedObject 
-  
               
声明方法的接口 javax.management.NotificationBroadcaster
removeNotificationListener 
-  
               
声明方法的接口 javax.management.NotificationEmitter
removeNotificationListener 
 -  
               
 
 -  
             
 
-  
        
       
-  
             
方法详细信息
-  
start
public void start()
启动字符串监视器。- Specified by:
 -  
              
start在界面MonitorMBean - Specified by:
 -  
              
start在类Monitor 
 
-  
stop
public void stop()
停止字符串监视器。- Specified by:
 -  
              
stop在界面MonitorMBean - Specified by:
 -  
              
stop在类Monitor 
 
-  
getDerivedGauge
public String getDerivedGauge(ObjectName object)
如果此对象包含在观察到的MBeans集中,则获取指定对象的派生尺度,否则null。- Specified by:
 -  
              
getDerivedGauge在界面StringMonitorMBean - 参数
 -  
              
object- 需要派生尺度的MBean的名称。 - 结果
 - 指定对象的派生尺度。
 
 
-  
getDerivedGaugeTimeStamp
public long getDerivedGaugeTimeStamp(ObjectName object)
如果此对象包含在观察到的MBeans集中,则获取指定对象的派生尺度时间戳,否则0。- Specified by:
 -  
              
getDerivedGaugeTimeStamp在界面StringMonitorMBean - 参数
 -  
              
object- 要返回其派生尺度时间戳的对象的名称。 - 结果
 - 派生的指定对象的标尺时间戳。
 
 
-  
getDerivedGauge
@Deprecated public String getDerivedGauge()
Deprecated.As of JMX 1.2, replaced bygetDerivedGauge(ObjectName)返回观察到的MBeans集中第一个对象的派生尺度。- Specified by:
 -  
              
getDerivedGauge在界面StringMonitorMBean - 结果
 - 派生尺度。
 
 
-  
getDerivedGaugeTimeStamp
@Deprecated public long getDerivedGaugeTimeStamp()
Deprecated.As of JMX 1.2, replaced bygetDerivedGaugeTimeStamp(ObjectName)获取观察到的MBeans集中第一个对象的派生尺度时间戳。- Specified by:
 -  
              
getDerivedGaugeTimeStamp在界面StringMonitorMBean - 结果
 - 派生的标尺时间戳。
 
 
-  
getStringToCompare
public String getStringToCompare()
获取要与所有观察到的MBeans共同的观察属性进行比较的字符串。- Specified by:
 -  
              
getStringToCompare在界面StringMonitorMBean - 结果
 - 字符串值。
 - 另请参见:
 -  
              
setStringToCompare(java.lang.String) 
 
-  
setStringToCompare
public void setStringToCompare(String value) throws IllegalArgumentException
设置要与所有观察到的MBeans共同的观察属性进行比较的字符串。- Specified by:
 -  
              
setStringToCompare在界面StringMonitorMBean - 参数
 -  
              
value- 字符串值。 - 异常
 -  
              
IllegalArgumentException- 要比较的指定字符串为null。 - 另请参见:
 -  
              
getStringToCompare() 
 
-  
getNotifyMatch
public boolean getNotifyMatch()
获取所有观察到的MBeans共有的匹配通知的开/关切换值。- Specified by:
 -  
              
getNotifyMatch在界面StringMonitorMBean - 结果
 -  
              
true如果字符串监视器在匹配要比较的字符串时通知,否则为false。 - 另请参见:
 -  
              
setNotifyMatch(boolean) 
 
-  
setNotifyMatch
public void setNotifyMatch(boolean value)
设置所有观察到的MBeans共同的匹配通知的开/关切换值。- Specified by:
 -  
              
setNotifyMatch在界面StringMonitorMBean - 参数
 -  
              
value- 匹配通知的开/关切换值。 - 另请参见:
 -  
              
getNotifyMatch() 
 
-  
getNotifyDiffer
public boolean getNotifyDiffer()
获取所有观察到的MBeans共有的不同通知的开/关切换值。- Specified by:
 -  
              
getNotifyDiffer在界面StringMonitorMBean - 结果
 -  
              
true如果字符串监视器通知何时与要比较的字符串不同,false。 - 另请参见:
 -  
              
setNotifyDiffer(boolean) 
 
-  
setNotifyDiffer
public void setNotifyDiffer(boolean value)
设置所有观察到的MBeans共有的不同通知的开/关切换值。- Specified by:
 -  
              
setNotifyDiffer在界面StringMonitorMBean - 参数
 -  
              
value- 不同通知的开/关切换值。 - 另请参见:
 -  
              
getNotifyDiffer() 
 
-  
getNotificationInfo
public MBeanNotificationInfo[] getNotificationInfo()
返回一个NotificationInfo对象,其中包含通知的Java类的名称和字符串监视器发送的通知类型。- Specified by:
 -  
              
getNotificationInfo在界面NotificationBroadcaster - 结果
 - 可能的通知数组。
 
 
 -  
 
 -