- java.lang.Object
-
- javax.management.NotificationBroadcasterSupport
-
- javax.management.monitor.Monitor
-
- javax.management.monitor.GaugeMonitor
-
- All Implemented Interfaces:
-
MBeanRegistration,GaugeMonitorMBean,MonitorMBean,NotificationBroadcaster,NotificationEmitter
public class GaugeMonitor extends Monitor implements GaugeMonitorMBean
定义一个监视器MBean,用于观察仪表属性的值。仪表监视器观察随时间连续变化的属性。 仪表监视器发送通知如下:
- 如果属性值增加并且变得等于或大于高阈值,则发送
threshold high notification。 通知高标志必须设置为true。
除非属性值等于或小于低阈值,否则高阈值的后续交叉不会导致进一步的通知。 - 如果属性值正在减小并且变得等于或小于低阈值,则发送
threshold low notification。 通知低位标志必须设置为true。
除非属性值变得等于或大于高阈值,否则低阈值的后续交叉不会引起进一步的通知。
如果使用量规差异模式,则派生量规的值被计算为两次连续观察值的观测值之间的差值。
导出的量规值(V [t])使用以下方法计算:- V [t] =表[t] - 表[t-GP]
Byte,Integer,Short,Long,Float,Double)。- 从以下版本开始:
- 1.5
-
-
Field Summary
-
Fields inherited from 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 描述 GaugeMonitor()默认构造函数。
-
方法摘要
所有方法 接口方法 具体的方法 弃用的方法 Modifier and Type 方法 描述 NumbergetDerivedGauge()已过时。截至JMX 1.2,由getDerivedGauge(ObjectName)替代NumbergetDerivedGauge(ObjectName object)如果此对象包含在观察到的MBean集合中,则获取指定对象的派生规格,否则为null。longgetDerivedGaugeTimeStamp()已过时。截至JMX 1.2,由getDerivedGaugeTimeStamp(ObjectName)替代longgetDerivedGaugeTimeStamp(ObjectName object)如果此对象包含在观察到的MBean集合中,则获取指定对象的派生标尺时间戳,否则为0。booleangetDifferenceMode()获取所有观察到的MBean共有的差异模式标志值。NumbergetHighThreshold()获得所有观察到的MBean共有的高阈值。NumbergetLowThreshold()获得所有观察到的MBean共有的低阈值。MBeanNotificationInfo[]getNotificationInfo()返回一个NotificationInfo对象,其中包含通知的Java类的名称以及仪表监视器发送的通知类型。booleangetNotifyHigh()获取所有观察到的MBean通用的高通知开/关切换值。booleangetNotifyLow()获取所有观察到的MBean通用的低通知开/关切换值。voidsetDifferenceMode(boolean value)设置所有观察到的MBean共有的差异模式标志值。voidsetNotifyHigh(boolean value)设置所有观察到的MBean通用的高通知开/关切换值。voidsetNotifyLow(boolean value)设置所有观察到的MBean通用的低通知开/关切换值。voidsetThresholds(Number highValue, Number lowValue)设置所有观察到的MBean共有的高和低阈值。voidstart()启动量规监视器。voidstop()停止仪表监视器。-
Methods inherited from class javax.management.monitor.Monitor
addObservedObject, containsObservedObject, getGranularityPeriod, getObservedAttribute, getObservedObject, getObservedObjects, isActive, postDeregister, postRegister, preDeregister, preRegister, removeObservedObject, setGranularityPeriod, setObservedAttribute, setObservedObject
-
Methods inherited from interface javax.management.monitor.MonitorMBean
addObservedObject, containsObservedObject, getGranularityPeriod, getObservedAttribute, getObservedObject, getObservedObjects, isActive, removeObservedObject, setGranularityPeriod, setObservedAttribute, setObservedObject
-
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
-
-
-
-
方法详细信息
-
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 Number getDerivedGauge(ObjectName object)
如果此对象包含在观察到的MBean集合中,则获取指定对象的派生规格,否则为null。- Specified by:
-
getDerivedGauge在接口GaugeMonitorMBean - 参数
-
object- MBean的名称。 - 结果
- 指定对象的派生量表。
-
getDerivedGaugeTimeStamp
public long getDerivedGaugeTimeStamp(ObjectName object)
如果此对象包含在观察到的MBean集合中,则获取指定对象的派生标尺时间戳,否则为0。- Specified by:
-
getDerivedGaugeTimeStamp在接口GaugeMonitorMBean - 参数
-
object- 要返回派生标尺时间戳的对象的名称。 - 结果
- 指定对象的派生量规时间戳。
-
getDerivedGauge
@Deprecated public Number getDerivedGauge()
已过时。 截至JMX 1.2,由getDerivedGauge(ObjectName)替换返回观察到的MBean集合中第一个对象的派生规格。- Specified by:
-
getDerivedGauge在接口GaugeMonitorMBean - 结果
- 派生量规。
-
getDerivedGaugeTimeStamp
@Deprecated public long getDerivedGaugeTimeStamp()
已过时。 截至JMX 1.2,由getDerivedGaugeTimeStamp(ObjectName)替代获取观察到的MBean集合中第一个对象的派生标尺时间戳。- Specified by:
-
getDerivedGaugeTimeStamp在接口GaugeMonitorMBean - 结果
- 派生标尺时间戳。
-
getHighThreshold
public Number getHighThreshold()
获得所有观察到的MBean共有的高阈值。- Specified by:
-
getHighThreshold在接口GaugeMonitorMBean - 结果
- 高阈值。
- 另请参见:
-
setThresholds(java.lang.Number, java.lang.Number)
-
getLowThreshold
public Number getLowThreshold()
获得所有观察到的MBean共有的低阈值。- Specified by:
-
getLowThreshold在接口GaugeMonitorMBean - 结果
- 低阈值。
- 另请参见:
-
setThresholds(java.lang.Number, java.lang.Number)
-
setThresholds
public void setThresholds(Number highValue, Number lowValue) throws IllegalArgumentException
设置所有观察到的MBean共有的高和低阈值。- Specified by:
-
setThresholds在接口GaugeMonitorMBean - 参数
-
highValue- 高阈值。 -
lowValue- 低阈值。 - 异常
-
IllegalArgumentException- 指定的高/低阈值为零或低阈值大于高阈值或高阈值,低阈值不是相同类型。 - 另请参见:
-
getHighThreshold(),getLowThreshold()
-
getNotifyHigh
public boolean getNotifyHigh()
获取所有观察到的MBean通用的高通知开/关切换值。- Specified by:
-
getNotifyHigh在接口GaugeMonitorMBean - 结果
-
true如果仪表监视器在超过高阈值时通知,否则为false。 - 另请参见:
-
setNotifyHigh(boolean)
-
setNotifyHigh
public void setNotifyHigh(boolean value)
设置所有观察到的MBean通用的高通知开/关切换值。- Specified by:
-
setNotifyHigh在接口GaugeMonitorMBean - 参数
-
value- 高通知的开/关开关值。 - 另请参见:
-
getNotifyHigh()
-
getNotifyLow
public boolean getNotifyLow()
获取所有观察到的MBean通用的低通知开/关切换值。- Specified by:
-
getNotifyLow在接口GaugeMonitorMBean - 结果
-
true如果仪表监视器在超过低阈值时通知,否则为false。 - 另请参见:
-
setNotifyLow(boolean)
-
setNotifyLow
public void setNotifyLow(boolean value)
设置所有观察到的MBean通用的低通知开/关切换值。- Specified by:
-
setNotifyLow在接口GaugeMonitorMBean - 参数
-
value- 低通知的开/关开关值。 - 另请参见:
-
getNotifyLow()
-
getDifferenceMode
public boolean getDifferenceMode()
获取所有观察到的MBean共有的差异模式标志值。- Specified by:
-
getDifferenceMode在接口GaugeMonitorMBean - 结果
-
true如果使用差分模式,false否则。 - 另请参见:
-
setDifferenceMode(boolean)
-
setDifferenceMode
public void setDifferenceMode(boolean value)
设置所有观察到的MBean共有的差异模式标志值。- Specified by:
-
setDifferenceMode在接口GaugeMonitorMBean - 参数
-
value- 差异模式标志值。 - 另请参见:
-
getDifferenceMode()
-
getNotificationInfo
public MBeanNotificationInfo[] getNotificationInfo()
返回一个NotificationInfo对象,其中包含通知的Java类的名称以及量规监视器发送的通知类型。- Specified by:
-
getNotificationInfo在接口NotificationBroadcaster - 重写:
-
getNotificationInfo在NotificationBroadcasterSupport - 结果
- 可能通知的数组。
-
-