JavaTM 2 Platform
Standard Ed. 6

javax.management.openmbean
类 OpenMBeanInfoSupport

java.lang.Object
  继承者 javax.management.MBeanInfo
      继承者 javax.management.openmbean.OpenMBeanInfoSupport
所有已实现的接口:
Serializable, Cloneable, DescriptorRead, OpenMBeanInfo

public class OpenMBeanInfoSupport
extends MBeanInfo
implements OpenMBeanInfo

OpenMBeanInfoSupport 类描述 open MBean 的管理信息:它是 MBeanInfo 的子类,并且实现了 OpenMBeanInfo 接口。注意,open MBean 的识别方式是,如果其 getMBeanInfo() 方法返回实现 OpenMBeanInfo 接口(通常为 OpenMBeanInfoSupport)的类的实例,则可识别 open MBean

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

构造方法摘要
OpenMBeanInfoSupport(String className, String description, OpenMBeanAttributeInfo[] openAttributes, OpenMBeanConstructorInfo[] openConstructors, OpenMBeanOperationInfo[] openOperations, MBeanNotificationInfo[] notifications)
          构造一个 OpenMBeanInfoSupport 实例,它使用指定的 classNamedescriptionopenAttributesopenConstructorsopenOperationsnotifications 描述 open MBeans 的类。
OpenMBeanInfoSupport(String className, String description, OpenMBeanAttributeInfo[] openAttributes, OpenMBeanConstructorInfo[] openConstructors, OpenMBeanOperationInfo[] openOperations, MBeanNotificationInfo[] notifications, Descriptor descriptor)
          构造一个 OpenMBeanInfoSupport 实例,它使用指定的 classNamedescriptionopenAttributesopenConstructorsopenOperationsnotificationsdescriptor 描述 open MBeans 的类
 
方法摘要
 boolean equals(Object obj)
          比较指定 obj 参数与此 OpenMBeanInfoSupport 实例的相等性。
 int hashCode()
          返回此 OpenMBeanInfoSupport 实例的哈希码值。
 String toString()
          返回此 OpenMBeanInfoSupport 实例的字符串表示形式。
 
从类 javax.management.MBeanInfo 继承的方法
clone, getAttributes, getClassName, getConstructors, getDescription, getDescriptor, getNotifications, getOperations
 
从类 java.lang.Object 继承的方法
finalize, getClass, notify, notifyAll, wait, wait, wait
 
从接口 javax.management.openmbean.OpenMBeanInfo 继承的方法
getAttributes, getClassName, getConstructors, getDescription, getNotifications, getOperations
 

构造方法详细信息

OpenMBeanInfoSupport

public OpenMBeanInfoSupport(String className,
                            String description,
                            OpenMBeanAttributeInfo[] openAttributes,
                            OpenMBeanConstructorInfo[] openConstructors,
                            OpenMBeanOperationInfo[] openOperations,
                            MBeanNotificationInfo[] notifications)

构造一个 OpenMBeanInfoSupport 实例,它使用指定的 classNamedescriptionopenAttributesopenConstructorsopenOperationsnotifications 描述 open MBeans 的类。

openAttributesopenConstructorsopenOperationsnotifications 数组参数是被内部复制的,因此对这些参数引用的数组的后续更改不影响此实例。

参数:
className - 此 OpenMBeanInfoSupport 实例描述的 open MBean 的完全限定的 Java 类名。
description - 此 OpenMBeanInfoSupport 实例描述的 open MBean 的可读描述。
openAttributes - 所描述的 open MBean 的公开属性的列表;必须是 MBeanAttributeInfo(通常为 OpenMBeanAttributeInfoSupport)的子类的实例组成的数组。
openConstructors - 所描述的 open MBean 的公开的公用构造方法的列表;必须是 MBeanConstructorInfo(通常为 OpenMBeanConstructorInfoSupport)的子类的实例组成的数组。
openOperations - 所描述的 open MBean 的公开操作的列表。必须是 MBeanOperationInfo(通常为 OpenMBeanOperationInfoSupport)的子类的实例组成的数组。
notifications - 所描述的 open MBean 发出的通知列表。
抛出:
ArrayStoreException - 如果 openAttributesopenConstructorsopenOperations 分别不是 MBeanAttributeInfoMBeanConstructorInfoMBeanOperationInfo 子类的实例组成的数组。

OpenMBeanInfoSupport

public OpenMBeanInfoSupport(String className,
                            String description,
                            OpenMBeanAttributeInfo[] openAttributes,
                            OpenMBeanConstructorInfo[] openConstructors,
                            OpenMBeanOperationInfo[] openOperations,
                            MBeanNotificationInfo[] notifications,
                            Descriptor descriptor)

构造一个 OpenMBeanInfoSupport 实例,它使用指定的 classNamedescriptionopenAttributesopenConstructorsopenOperationsnotificationsdescriptor 描述 open MBeans 的类

openAttributesopenConstructorsopenOperationsnotifications 数组参数是被内部复制的,因此对这些参数引用的数组的后续更改不影响此实例

参数:
className - 此 OpenMBeanInfoSupport 实例描述的 open MBean 的完全限定的 Java 类名。
description - 此 OpenMBeanInfoSupport 实例描述的 open MBean 的可读描述。
openAttributes - 所描述的 open MBean 的公开属性的列表;必须是 MBeanAttributeInfo(通常为 OpenMBeanAttributeInfoSupport)的子类的实例组成的数组。
openConstructors - 所描述的 open MBean 的公开的公用构造方法的列表;必须是 MBeanConstructorInfo(通常为 OpenMBeanConstructorInfoSupport)的子类的实例组成的数组。
openOperations - 所描述的 open MBean 的公开操作的列表。必须是 MBeanOperationInfo(通常为 OpenMBeanOperationInfoSupport)的子类的实例组成的数组。
notifications - 所描述的 open MBean 发出的通知列表。
descriptor - MBean 的描述符。此参数可以为 null,等效于空描述符。
抛出:
ArrayStoreException - 如果 openAttributesopenConstructorsopenOperations 分别不是 MBeanAttributeInfoMBeanConstructorInfoMBeanOperationInfo 子类的实例组成的数组。
从以下版本开始:
1.6
方法详细信息

equals

public boolean equals(Object obj)
比较指定 obj 参数与此 OpenMBeanInfoSupport 实例的相等性。

当且仅当下面的所有语句均为 true 时,才返回 true

这确保了此 equals 方法对作为 OpenMBeanInfo 接口的不同实现的 obj 参数正常工作。

指定者:
接口 OpenMBeanInfo 中的 equals
覆盖:
MBeanInfo 中的 equals
参数:
obj - 与此 OpenMBeanInfoSupport 实例进行相等性比较的对象;
返回:
如果指定的对象等于此 OpenMBeanInfoSupport 实例,则返回 true
另请参见:
Object.hashCode(), Hashtable

hashCode

public int hashCode()

返回此 OpenMBeanInfoSupport 实例的哈希码值。

OpenMBeanInfoSupport 实例的哈希码是在 equals 比较中使用的所有信息元素的哈希码的总和(即类名和关于属性、构造方法、操作和通知的信息,其中每个数组的 hashCode 都通过调用 new java.util.HashSet(java.util.Arrays.asList(this.getSignature)).hashCode() 来计算)。

这确保 t1.equals(t2) 意味着对于任何两个 OpenMBeanInfoSupport 实例 t1t2 而言,都存在 t1.hashCode()==t2.hashCode(),这是方法 Object.hashCode() 的通用协定所要求的。

不过请注意,根据 equals(java.lang.Object) 中的定义,实现 OpenMBeanInfo 接口的类的其他实例可能与此 OpenMBeanInfoSupport 实例相等,但是如果它的计算方法不同,可能会有不同的哈希码。

由于 OpenMBeanInfoSupport 实例是不可变的,此实例的哈希码在首次调用 hashCode 时被计算,因此对后续调用返回相同的值。

指定者:
接口 OpenMBeanInfo 中的 hashCode
覆盖:
MBeanInfo 中的 hashCode
返回:
OpenMBeanInfoSupport 实例的哈希码值
另请参见:
Object.equals(java.lang.Object), Hashtable

toString

public String toString()

返回此 OpenMBeanInfoSupport 实例的字符串表示形式。

字符串表示形式由此类(即 javax.management.openmbean.OpenMBeanInfoSupport)的名称、MBean 类名、关于所描述 MBean 的属性、构造方法、操作、通知信息的字符串表示形式以及描述符的字符串表示形式组成。

由于 OpenMBeanInfoSupport 实例是不可变的,此实例的字符串表示形式在首次调用 toString 时被计算一次,然后对后续调用返回相同的值。

指定者:
接口 OpenMBeanInfo 中的 toString
覆盖:
MBeanInfo 中的 toString
返回:
OpenMBeanInfoSupport 实例的字符串表示形式

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only