java.lang.Object
javax.management.NotificationBroadcasterSupport
javax.management.monitor.Monitor
javax.management.monitor.StringMonitor
- 所有已实现的接口:
-
MBeanRegistration,MonitorMBean,StringMonitorMBean,NotificationBroadcaster,NotificationEmitter
定义了一个监视器MBean,用于观察字符串属性的值。
字符串监视器发送通知如下:
- 自1.5版本起:
- 1.5
-
Field Summary
Fields declared in class 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription已弃用。getDerivedGauge(ObjectName object) 获取指定对象的派生量,如果此对象包含在观察的MBean集合中,则返回,否则返回null。long已弃用。自JMX 1.2起,已被getDerivedGaugeTimeStamp(ObjectName)取代longgetDerivedGaugeTimeStamp(ObjectName object) 获取指定对象的派生量时间戳,如果此对象包含在观察的MBean集合中,则返回,否则返回0。返回一个NotificationInfo对象,其中包含通知的Java类名称和字符串监视器发送的通知类型。boolean获取所有观察的MBean的不同通知开关值。boolean获取所有观察的MBean的匹配通知开关值。获取与所有观察的MBean的观察属性进行比较的字符串。voidsetNotifyDiffer(boolean value) 设置所有观察的MBean的不同通知开关值。voidsetNotifyMatch(boolean value) 设置所有观察的MBean的匹配通知开关值。voidsetStringToCompare(String value) 设置与所有观察的MBean的观察属性进行比较的字符串。voidstart()启动字符串监视器。voidstop()停止字符串监视器。Methods declared in class javax.management.monitor.Monitor
addObservedObject, containsObservedObject, getGranularityPeriod, getObservedAttribute, getObservedObject, getObservedObjects, isActive, postDeregister, postRegister, preDeregister, preRegister, removeObservedObject, setGranularityPeriod, setObservedAttribute, setObservedObjectMethods declared in class javax.management.NotificationBroadcasterSupport
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotificationMethods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods declared in interface javax.management.monitor.MonitorMBean
addObservedObject, containsObservedObject, getGranularityPeriod, getObservedAttribute, getObservedObject, getObservedObjects, isActive, removeObservedObject, setGranularityPeriod, setObservedAttribute, setObservedObject
-
Constructor Details
-
StringMonitor
public StringMonitor()默认构造函数。
-
-
Method Details
-
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
Deprecated.As of JMX 1.2, replaced bygetDerivedGauge(ObjectName)返回观察的MBean集合中第一个对象的派生量。- 指定者:
-
getDerivedGauge在接口StringMonitorMBean中 - 返回:
- 派生量。
-
getDerivedGaugeTimeStamp
Deprecated.As of JMX 1.2, replaced bygetDerivedGaugeTimeStamp(ObjectName)获取观察的MBean集合中第一个对象的派生量时间戳。- 指定者:
-
getDerivedGaugeTimeStamp在接口StringMonitorMBean中 - 返回:
- 派生量时间戳。
-
getStringToCompare
获取与所有观察的MBean的观察属性进行比较的字符串。- 指定者:
-
getStringToCompare在接口StringMonitorMBean中 - 返回:
- 字符串值。
- 参见:
-
setStringToCompare
设置与所有观察的MBean的观察属性进行比较的字符串。- 指定者:
-
setStringToCompare在接口StringMonitorMBean中 - 参数:
-
value- 字符串值。 - 抛出:
-
IllegalArgumentException- 指定的要比较的字符串为null。 - 参见:
-
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)取代