java.lang.Object
javax.management.NotificationBroadcasterSupport
javax.management.monitor.Monitor
javax.management.monitor.StringMonitor
- 所有已实现的接口:
MBeanRegistration
,MonitorMBean
,StringMonitorMBean
,NotificationBroadcaster
,NotificationEmitter
定义一个监视器 MBean,旨在观察字符串属性的值。
字符串监视器发送通知如下:
- 如果属性值与要比较值的字符串匹配,则发送
match notification
。通知匹配标志必须设置为true
。
用于比较值的字符串的后续匹配不会导致进一步的通知,除非属性值不同于用于比较值的字符串。 - 如果属性值与要比较值的字符串不同,则发送
differ notification
。通知差异标志必须设置为true
。
与比较值的字符串的后续差异不会引起进一步的通知,除非属性值与要比较值的字符串匹配。
- 自从:
- 1.5
-
字段摘要
-
构造方法总结
构造方法 -
方法总结
修饰符和类型方法描述已弃用。getDerivedGauge
(ObjectName object) 获取指定对象的派生规格,如果此对象包含在观察到的 MBean 集中,否则为null
。long
已弃用。从 JMX 1.2 开始,由getDerivedGaugeTimeStamp(ObjectName)
取代long
getDerivedGaugeTimeStamp
(ObjectName object) 如果此对象包含在观察到的 MBean 集合中,则获取指定对象的派生标准时间戳,否则获取0
。返回一个NotificationInfo
对象,其中包含通知的 Java 类名称和字符串监视器发送的通知类型。boolean
获取所有观察到的 MBean 共有的不同通知的开/关开关值。boolean
获取所有观察到的 MBean 共有的匹配通知的开/关开关值。获取要与所有观察到的 MBean 共有的观察到的属性进行比较的字符串。void
setNotifyDiffer
(boolean value) 设置所有观察到的 MBean 通用的不同通知的开/关开关值。void
setNotifyMatch
(boolean value) 设置所有观察到的 MBean 共有的匹配通知的开/关开关值。void
setStringToCompare
(String value) 设置字符串以与所有观察到的 MBean 共有的观察到的属性进行比较。void
start()
启动字符串监视器。void
stop()
停止字符串监视器。在类 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()启动字符串监视器。- 指定者:
start
在接口MonitorMBean
中- 指定者:
start
在类Monitor
中
-
stop
public void stop()停止字符串监视器。- 指定者:
stop
在接口MonitorMBean
中- 指定者:
stop
在类Monitor
中
-
getDerivedGauge
获取指定对象的派生规格,如果此对象包含在观察到的 MBean 集中,否则为null
。- 指定者:
getDerivedGauge
在接口StringMonitorMBean
中- 参数:
object
- 需要其派生规格的 MBean 的名称。- 返回:
- 指定对象的派生仪表。
-
getDerivedGaugeTimeStamp
如果此对象包含在观察到的 MBean 集合中,则获取指定对象的派生标准时间戳,否则获取0
。- 指定者:
getDerivedGaugeTimeStamp
在接口StringMonitorMBean
中- 参数:
object
- 要返回其派生仪表时间戳的对象的名称。- 返回:
- 指定对象的派生仪表时间戳。
-
getDerivedGauge
已弃用。从 JMX 1.2 开始,由getDerivedGauge(ObjectName)
取代返回观察到的 MBean 集合中第一个对象的派生规格。- 指定者:
getDerivedGauge
在接口StringMonitorMBean
中- 返回:
- 派生的量规。
-
getDerivedGaugeTimeStamp
已弃用。从 JMX 1.2 开始,由getDerivedGaugeTimeStamp(ObjectName)
取代获取观察到的 MBean 集合中第一个对象的派生规范时间戳。- 指定者:
getDerivedGaugeTimeStamp
在接口StringMonitorMBean
中- 返回:
- 派生的仪表时间戳。
-
getStringToCompare
获取要与所有观察到的 MBean 共有的观察到的属性进行比较的字符串。- 指定者:
getStringToCompare
在接口StringMonitorMBean
中- 返回:
- 字符串值。
- 参见:
-
setStringToCompare
设置字符串以与所有观察到的 MBean 共有的观察到的属性进行比较。- 指定者:
setStringToCompare
在接口StringMonitorMBean
中- 参数:
value
- 字符串值。- 抛出:
IllegalArgumentException
- 要比较的指定字符串为空。- 参见:
-
getNotifyMatch
public boolean getNotifyMatch()获取所有观察到的 MBean 共有的匹配通知的开/关开关值。- 指定者:
getNotifyMatch
在接口StringMonitorMBean
中- 返回:
true
如果字符串监视器在匹配要比较的字符串时通知,false
否则。- 参见:
-
setNotifyMatch
public void setNotifyMatch(boolean value) 设置所有观察到的 MBean 共有的匹配通知的开/关开关值。- 指定者:
setNotifyMatch
在接口StringMonitorMBean
中- 参数:
value
- 匹配通知的开/关开关值。- 参见:
-
getNotifyDiffer
public boolean getNotifyDiffer()获取所有观察到的 MBean 共有的不同通知的开/关开关值。- 指定者:
getNotifyDiffer
在接口StringMonitorMBean
中- 返回:
true
如果字符串监视器在与要比较的字符串不同时发出通知,false
否则。- 参见:
-
setNotifyDiffer
public void setNotifyDiffer(boolean value) 设置所有观察到的 MBean 通用的不同通知的开/关开关值。- 指定者:
setNotifyDiffer
在接口StringMonitorMBean
中- 参数:
value
- 不同通知的开/关开关值。- 参见:
-
getNotificationInfo
返回一个NotificationInfo
对象,其中包含通知的 Java 类名称和字符串监视器发送的通知类型。- 指定者:
getNotificationInfo
在接口NotificationBroadcaster
中- 返回:
- 可能通知的数组。
-
getDerivedGauge(ObjectName)
取代