javax.management.monitor
类 StringMonitor

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。

字符串监视器将根据以下情况发送通知:

  • 如果属性值与要比较的字符串值匹配,则发送一个匹配通知。必须将 notify match 标志设置为 true
    除非属性值与要比较的字符串值不同,否则要比较值的后续字符串匹配不会引起更多的通知。
  • 如果属性值与要比较的字符串的值不同,则发送一个不同通知。必须将 notify differ 标志设置为 true
    除非属性值与要比较的字符串的值匹配,否则要比较值的字符串后续差别不会引起更多的通知。

从以下版本开始:
1.5

字段摘要
 
从类 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
 
构造方法摘要
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 的共同 observed 属性进行比较的字符串。
 voidsetNotifyDiffer(boolean value)
          设置所有观察到的 MBeans 共同的不同通知的开/关切换值。
 voidsetNotifyMatch(boolean value)
          设置所有观察到的 MBeans 共同的匹配通知的开/关切换值。
 voidsetStringToCompare(String value)
          设置要与所有观察到的 MBeans 的共同 observed 属性进行比较的字符串。
 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, removeNotificationListener, removeNotificationListener, 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
 

构造方法详细信息

StringMonitor

public StringMonitor()
默认构造方法。

方法详细信息

start

public void start()
启动字符串监视器。

指定者:
接口 MonitorMBean 中的 start
指定者:
Monitor 中的 start

stop

public void stop()
停止字符串监视器。

指定者:
接口 MonitorMBean 中的 stop
指定者:
Monitor 中的 stop

getDerivedGauge

public String getDerivedGauge(ObjectName object)
如果指定的对象包含在观察到的 MBeans 集中,则获取此对象的派生的尺度,否则将为 null

指定者:
接口 StringMonitorMBean 中的 getDerivedGauge
参数:
object - 需要其派生尺度的 MBean 的名称。
返回:
指定对象的派生尺度。

getDerivedGaugeTimeStamp

public long getDerivedGaugeTimeStamp(ObjectName object)
如果指定的对象包含在观察到的 MBeans 集中,则获取此对象的派生尺度的时间戳,否则将为 0

指定者:
接口 StringMonitorMBean 中的 getDerivedGaugeTimeStamp
参数:
object - 将返回其派生尺度时间戳的对象的名称。
返回:
指定对象的派生尺度时间戳。

getDerivedGauge

@Deprecated
public String getDerivedGauge()
已过时。 从 JMX 1.2 开始,由 getDerivedGauge(ObjectName) 取代

返回观察到的 MBeans 集中第一个对象的派生尺度。

指定者:
接口 StringMonitorMBean 中的 getDerivedGauge
返回:
派生的尺度。

getDerivedGaugeTimeStamp

@Deprecated
public long getDerivedGaugeTimeStamp()
已过时。 从 JMX 1.2 开始,由 getDerivedGaugeTimeStamp(ObjectName) 取代

获取观察到的 MBeans 集中第一个对象的派生尺度时间戳。

指定者:
接口 StringMonitorMBean 中的 getDerivedGaugeTimeStamp
返回:
派生尺度时间戳。