JavaTM Platform
Standard Ed. 6

javax.management.modelmbean
类 ModelMBeanNotificationInfo

java.lang.Object
  继承者 javax.management.MBeanFeatureInfo
      继承者 javax.management.MBeanNotificationInfo
          继承者 javax.management.modelmbean.ModelMBeanNotificationInfo
所有已实现的接口:
Serializable, Cloneable, DescriptorAccess, DescriptorRead

public class ModelMBeanNotificationInfo
extends MBeanNotificationInfo
implements DescriptorAccess

ModelMBeanNotificationInfo 对象描述了由 ModelMBean 发出的通知。它是 MBeanNotificationInfo 的一个子类,添加了关联的 Descriptor 和 Descriptor 接口的实现

描述符中的字段定义如下,但不限于此:

name           :通知名称
descriptorType :必须为 "notification"
severity       :0-6,其中 0:未知;1:不可恢复的;
                2: 关键的,失败;3:主要的,严重的;
                4: 次要的,边缘的,错误;5:警告:
                6: 正常的、清楚的、丰富的
messageID      :消息文本的唯一键(允许转换,分析)              
messageText    :通知文本
log            :T - 记录消息 F - 不记录消息
logfile        :字符串完全限定文件名,适用于:操作系统
visibility     :1-4,其中 1:总是可见 4:几乎不可见
presentationString :允许数据呈现的 xml 格式的字符串
 
默认的描述符包含 name、descriptorType、displayName 和 severity(=6) 字段。

此类的 serialVersionUID-7445681389570207141L

从以下版本开始:
1.5
另请参见:
序列化表格

字段摘要
 
从类 javax.management.MBeanFeatureInfo 继承的字段
description, name
 
构造方法摘要
ModelMBeanNotificationInfo(ModelMBeanNotificationInfo inInfo)
          从此 ModelMBeanNotfication Object 构造新 ModelMBeanNotificationInfo 对象。
ModelMBeanNotificationInfo(String[] notifTypes, String name, String description)
          构造带有默认描述符的 ModelMBeanNotificationInfo 对象。
ModelMBeanNotificationInfo(String[] notifTypes, String name, String description, Descriptor descriptor)
          构造 ModelMBeanNotificationInfo 对象。
 
方法摘要
 Object clone()
          创建并返回新 ModelMBeanNotificationInfo,它是此 ModelMBeanNotificationInfo 的副本。
 Descriptor getDescriptor()
          返回 ModelMBeanNotificationInfo 的关联 Descriptor 的副本。
 void setDescriptor(Descriptor inDescriptor)
          设置 ModelMBeanNotificationInfo 的关联 Descriptor(完全替换)。
 String toString()
          返回包含 ModelMBeanNotificationInfo 的可读字符串。
 
从类 javax.management.MBeanNotificationInfo 继承的方法
equals, getNotifTypes, hashCode
 
从类 javax.management.MBeanFeatureInfo 继承的方法
getDescription, getName
 
从类 java.lang.Object 继承的方法
finalize, getClass, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

ModelMBeanNotificationInfo

public ModelMBeanNotificationInfo(String[] notifTypes,
                                  String name,
                                  String description)
构造带有默认描述符的 ModelMBeanNotificationInfo 对象。

参数:
notifTypes - 包含可以发送的通知类型的字符串(以点表示法)数组。
name - Notification 类的名称。
description - Notification 的可读描述。可选的。

ModelMBeanNotificationInfo

public ModelMBeanNotificationInfo(String[] notifTypes,
                                  String name,
                                  String description,
                                  Descriptor descriptor)
构造 ModelMBeanNotificationInfo 对象。

参数:
notifTypes - 包含可以发送的通知类型的字符串(以点表示法)数组。
name - Notification 类的名称。
description - Notification 的可读描述。可选的。
descriptor - 包含此 MBeanNotificationInfo 的实例的适当元数据的 Descriptor 实例。如果它为 null,则将创建默认描述符。如果描述符不包含 "displayName" 或 "severity" 字段,则以默认值将这些字段添加到描述符中。
抛出:
RuntimeOperationsException - 包装了一个 IllegalArgumentException。描述符无效,或者描述符 "name" 字段不等于参数名称,或者描述符 "DescriptorType" 字段不等于 "notification"。

ModelMBeanNotificationInfo

public ModelMBeanNotificationInfo(ModelMBeanNotificationInfo inInfo)
从此 ModelMBeanNotfication Object 构造新 ModelMBeanNotificationInfo 对象。

参数:
inInfo - 要被复制的 ModelMBeanNotificationInfo
方法详细信息

clone

public Object clone()
创建并返回新 ModelMBeanNotificationInfo,它是此 ModelMBeanNotificationInfo 的副本。

覆盖:
MBeanNotificationInfo 中的 clone
返回:
此实例的一个副本。
另请参见:
Cloneable

getDescriptor

public Descriptor getDescriptor()
返回 ModelMBeanNotificationInfo 的关联 Descriptor 的副本。

指定者:
接口 DescriptorRead 中的 getDescriptor
覆盖:
MBeanFeatureInfo 中的 getDescriptor
返回:
与 ModelMBeanNotificationInfo 对象关联的 Descriptor。
另请参见:
setDescriptor(javax.management.Descriptor)

setDescriptor

public void setDescriptor(Descriptor inDescriptor)
设置 ModelMBeanNotificationInfo 的关联 Descriptor(完全替换)。如果新 Descriptor 为 null,则关联 Descriptor 恢复为默认描述符。分配 Descriptor 之前验证它。如果新 Descriptor 无效,则抛出一个包装 IllegalArgumentException 的 RuntimeOperationsException。

指定者:
接口 DescriptorAccess 中的 setDescriptor
参数:
inDescriptor - 替换与 ModelMBeanNotification 接口关联的 Descriptor
抛出:
RuntimeOperationsException - 包装了无效 Descriptor 的 IllegalArgumentException
另请参见:
getDescriptor()

toString

public String toString()
返回包含 ModelMBeanNotificationInfo 的可读字符串。

覆盖:
MBeanNotificationInfo 中的 toString
返回:
描述此对象的字符串。

JavaTM Platform
Standard Ed. 6

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策