JavaTM 2 Platform
Standard Ed. 5.0

javax.management.modelmbean
类 ModelMBeanConstructorInfo

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

public class ModelMBeanConstructorInfo
extends MBeanConstructorInfo
implements DescriptorAccess, Cloneable

ModelMBeanConstructorInfo 对象描述了 ModelMBean 的一个构造方法。它是 MBeanConstructorInfo 的一个子类,添加了关联 Descriptor 和 DescriptorAccess 接口实现。

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

name : 构造方法名称 descriptorType : 必须为 "operation" role : 必须为 "constructor" displayName : 构造方法的可读名称 visibility : 1-4,其中 1:总是可见;4:几乎不可见 presentationString : 描述如何呈现操作的 xml 格式的字符串

persistPolicy 和 currencyTimeLimit 字段对于该构造方法无效。默认的描述符包含 name、descriptorType、displayName 和 role 字段。

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

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

构造方法详细信息

ModelMBeanConstructorInfo

public ModelMBeanConstructorInfo(String description,
                                 Constructor constructorMethod)
构造带有默认描述符的 MBeanConstructorInfo 对象。

参数:
description - 构造方法的可读描述。
constructorMethod - 描述 MBean 构造方法的 java.lang.reflect.Method 对象。

ModelMBeanConstructorInfo

public ModelMBeanConstructorInfo(String description,
                                 Constructor constructorMethod,
                                 Descriptor descriptor)
构造 MBeanConstructorInfo 对象。

参数:
description - 构造方法的可读描述。
constructorMethod - 描述 ModelMBean 构造方法的 java.lang.reflect.Method 对象。
descriptor - 包含此 ModelMBeanConstructorInfo 实例的适当元数据的 Descriptor 的一个实例。如果它为 null,则将创建默认描述符。如果描述符不包含 "displayName" 字段,则以默认值将此字段添加到描述符中。
抛出:
RuntimeOperationsException - 包装一个 IllegalArgumentException。描述符无效,或者描述符 "name" 字段不等于 name 参数,或者描述符字段 "DescriptorType" 不等于 "operation",或者描述符 "role" 字段不等于 "constructor"。

ModelMBeanConstructorInfo

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

参数:
name - 构造方法名称。
description - 构造方法的可读描述。
signature - 描述构造方法参数的 MBeanParameterInfo 对象数组。

ModelMBeanConstructorInfo

public ModelMBeanConstructorInfo(String name,
                                 String description,
                                 MBeanParameterInfo[] signature,
                                 Descriptor descriptor)
构造 MBeanConstructorInfo 对象。

参数:
name - 构造方法名称。
description - 构造方法的可读描述。
signature - 描述构造方法参数的 MBeanParameterInfo 对象。
descriptor - 包含此 MBeanConstructorInfo 实例的适当元数据的 Descriptor 的一个实例。如果它为 null,则将创建默认描述符。如果描述符不包含 "displayName" 字段,则以默认值将此字段添加到描述符中。
抛出:
RuntimeOperationsException - 包装一个 IllegalArgumentException。描述符无效,或者描述符 "name" 字段不等于 name 参数,或者描述符字段 "DescriptorType" 不等于 "operation",或者描述符 "role" 字段不等于 "constructor"。
方法详细信息

clone

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

覆盖:
MBeanConstructorInfo 中的 clone
返回:
此实例的一个克隆。
另请参见:
Cloneable

getDescriptor

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

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

setDescriptor

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

指定者:
接口 DescriptorAccess 中的 setDescriptor
参数:
inDescriptor - 替换与 ModelMBeanConstructor 关联的 Descriptor。如果描述符不包含 "displayName" 字段,则以默认值将此字段添加到描述符中。
抛出:
RuntimeOperationsException - 包装一个 IllegalArgumentException。描述符无效,或者描述符 "name" 字段不等于 name 参数,或者描述符字段 "DescriptorType" 不等于 "operation",或者描述符 "role" 字段不等于 "constructor"。
另请参见:
getDescriptor()

toString

public String toString()
以可读形式返回包含 ModelMBeanConstructorInfo 全部内容的字符串。

覆盖:
Object 中的 toString
返回:
该对象的字符串表示形式。

JavaTM 2 Platform
Standard Ed. 5.0

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

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