所有类


javax.management.monitor
类 Monitor

java.lang.Object
  继承者 javax.management.NotificationBroadcasterSupport
      继承者 javax.management.monitor.Monitor
所有已实现的接口:
MBeanRegistration, MonitorMBean, NotificationBroadcaster, NotificationEmitter
直接已知子类:
CounterMonitor, GaugeMonitor, StringMonitor

public abstract class Monitor
   
   
   
   
   
extends NotificationBroadcasterSupport
implements MonitorMBean, MBeanRegistration

定义所有监视器 MBeans 的公共部分。监视器 MBean 监视所观察的 MBeans 集的共同属性值。将根据粒度周期指定的区间监视 observed 属性。尺度值(派生尺度)从 observed 属性的值中派生。

从以下版本开始:
1.5

字段摘要
protected  intalreadyNotified
          已过时。 等效于 alreadyNotifieds[0]。
protected  int[]alreadyNotifieds
          已经通知的选定监视器错误。
protected static intcapacityIncrement
          监视器数组的大小大于其容量时,容量自动递增的量。
protected  StringdbgTag
          已过时。 无替代版本。
protected  intelementCount
          被观察对象的向量中的有效组件数。
protected static intOBSERVED_ATTRIBUTE_ERROR_NOTIFIED
          表示已在更改被观察属性之后发出了通知的标志。
protected static intOBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED
          表示已在更改被观察对象或被观察属性之后发出了通知的标志。
protected static intOBSERVED_OBJECT_ERROR_NOTIFIED
          表示在更改被观察对象之后已发出通知的标志。
protected static intRESET_FLAGS_ALREADY_NOTIFIED
          此标志用来重新设置 alreadyNotifieds 监视器属性。
protected static intRUNTIME_ERROR_NOTIFIED
          表示已在更改被观察对象或被观察属性之后发出了通知的标志。
protected  MBeanServerserver
          对 MBean 服务器的引用。
 
构造方法摘要
Monitor()
           
 
方法摘要
 voidaddObservedObject(ObjectName object)
          如果尚未显示此对象,则在观察到的 MBeans 集中添加指定的对象。
 booleancontainsObservedObject(ObjectName object)
          测试指定的对象是否在所观察的 MBeans 集中。
 longgetGranularityPeriod()
          获取粒度周期(以毫秒为单位)。
 StringgetObservedAttribute()
          获取要观察的属性。
 ObjectNamegetObservedObject()
          已过时。 从 JMX 1.2 开始,由 getObservedObjects() 取代
 ObjectName[]getObservedObjects()
          返回一个包含要观察的对象的数组。
 booleanisActive()
          测试监视器 MBean 是否处于激活状态。
 voidpostDeregister()
          允许在 MBean 服务器注销监视器 MBean 之前执行所需的任何操作。
 voidpostRegister(Boolean registrationDone)
          允许在 MBean 服务器中注册监视器 MBean 后或注册失败后执行所需的任何操作。
 voidpreDeregister()
          允许在 MBean 服务器注销监视器 MBean 之前执行监视器 MBean 所需要的任何操作。
 ObjectNamepreRegister(MBeanServer server, ObjectName name)
          允许在 MBean 服务器中注册监视器 MBean 之前执行任何监视器 MBean 所需要的操作。
 voidremoveObservedObject(ObjectName object)
          从所观察的 MBeans 集中移除指定的对象。
 voidsetGranularityPeriod(long period)
          设置粒度周期(以毫秒为单位)。
 voidsetObservedAttribute(String attribute)
          设置要观察的属性。
 voidsetObservedObject(ObjectName object)
          已过时。 从 JMX 1.2 开始,由 addObservedObject(javax.management.ObjectName) 取代
abstract  voidstart()
          启动监视器。
abstract  voidstop()
          停止监视器。
 
从类 javax.management.NotificationBroadcasterSupport 继承的方法
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

capacityIncrement

protected static final int capacityIncrement
监视器数组的大小大于其容量时,容量自动递增的量。

另请参见:
常量字段值

elementCount

protected int elementCount
被观察对象的向量中的有效组件数。


alreadyNotified

@Deprecated
protected int alreadyNotified
已过时。 等效于 alreadyNotifieds[0]。
已经通知的监视器错误。


alreadyNotifieds

protected int[] alreadyNotifieds

已经通知的选定监视器错误。

此数组中的每个元素都对应于向量中的某个被观察对象。它包含标志 OBSERVED_OBJECT_ERROR_NOTIFIED 等的位掩码,表示是否已经为要监视的 MBean 发送了相应的通知。


server

protected MBeanServer server
对 MBean 服务器的引用。如果没有在 MBean 服务器中注册监视器 MBean,则此引用将为 null。在 MBean 服务器中注册监视器 MBean 之前,要先初始化此引用。

另请参见:
preRegister(MBeanServer server, ObjectName name)

RESET_FLAGS_ALREADY_NOTIFIED

protected static final int RESET_FLAGS_ALREADY_NOTIFIED
此标志用来重新设置 alreadyNotifieds 监视器属性。

另请参见:
常量字段值

OBSERVED_OBJECT_ERROR_NOTIFIED

protected static final int OBSERVED_OBJECT_ERROR_NOTIFIED
表示在更改被观察对象之后已发出通知的标志。此标志用来检查在初次发出通知时是否已在 MBean 服务器中注册了新的被观察对象。

另请参见:
常量字段值