public class ModelMBeanInfoSupport extends MBeanInfo implements ModelMBeanInfo
java资源希望能够实例化ModelMBean MBeanServer creatembean方法的使用。资源建立了ModelMBeanInfo和描述符为ModelMBean实例。属性和操作通过ModelMBean ModelMBeanInfo暴露可从MBean,连接器/适配器像其他MBeans。通过描述,在托管的应用价值和方法可以被定义和映射到的ModelMBean属性和操作。这个映射可以定义在一个文件或程序在运行时动态的发展过程中。
这是每个ModelMBean MBeanServer实例化成为可控的:它的属性和操作成为远程访问连接,通过MBeanServer连接器/适配器。一个java对象不能注册MBeanServer除非是JMX兼容MBean。通过实例化一个ModelMBean,资源保证MBean是有效的。mbeanexception和runtimeoperationsexception必须扔在每个公共方法。这使得包装从分布式通信异常(RMI、EJB、等)
这个班的serialVersionUID是-1935722590756516193L。
| Constructor and Description |
|---|
ModelMBeanInfoSupport(ModelMBeanInfo mbi)
构建ModelMBeanInfoSupport是给定ModelMBeanInfo重复。
|
ModelMBeanInfoSupport(String className, String description, ModelMBeanAttributeInfo[] attributes, ModelMBeanConstructorInfo[] constructors, ModelMBeanOperationInfo[] operations, ModelMBeanNotificationInfo[] notifications)
创建一个modelmbeaninfosupport与所提供的信息,但该描述符是一个默认的。
|
ModelMBeanInfoSupport(String className, String description, ModelMBeanAttributeInfo[] attributes, ModelMBeanConstructorInfo[] constructors, ModelMBeanOperationInfo[] operations, ModelMBeanNotificationInfo[] notifications, Descriptor mbeandescriptor)
创建一个与所提供的信息,给出了参数的广义modelmbeaninfosupport。
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
返回此实例的浅克隆。
|
ModelMBeanAttributeInfo |
getAttribute(String inName)
返回请求的名称modelmbeanattributeinfo。
|
ModelMBeanConstructorInfo |
getConstructor(String inName)
返回请求的名字的modelmbeanconstructorinfo。
|
Descriptor |
getDescriptor()
得到这个mbeaninfo描述符。
|
Descriptor |
getDescriptor(String inDescriptorName)
返回由名称所请求的描述符。
|
Descriptor |
getDescriptor(String inDescriptorName, String inDescriptorType)
返回的名称和descriptortype请求描述符。
|
Descriptor[] |
getDescriptors(String inDescriptorType)
返回一个描述符阵列组成的所有描述符的类型indescriptortype ModelMBeanInfo。
|
Descriptor |
getMBeanDescriptor()
返回的描述符包含MBean ModelMBean宽政策。
|
ModelMBeanNotificationInfo |
getNotification(String inName)
返回请求的名称modelmbeannotificationinfo。
|
ModelMBeanOperationInfo |
getOperation(String inName)
返回请求的名称modelmbeanoperationinfo。
|
void |
setDescriptor(Descriptor inDescriptor, String inDescriptorType)
集描述为ModelMBean型indescriptortype信息阵。
|
void |
setDescriptors(Descriptor[] inDescriptors)
添加或更换在ModelMBeanInfo描述符。
|
void |
setMBeanDescriptor(Descriptor inMBeanDescriptor)
集ModelMBean的描述符。
|
equals, getAttributes, getClassName, getConstructors, getDescription, getNotifications, getOperations, hashCode, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitgetAttributes, getClassName, getConstructors, getDescription, getNotifications, getOperationspublic ModelMBeanInfoSupport(ModelMBeanInfo mbi)
ModelMBeanAttributeInfo[]等)进行克隆。该方法主要是对修改返回的实例的描述通过
setDescriptor不影响原来的对象描述符。
mbi - ModelMBeanInfo实例的创建初始化ModelMBeanInfo。
public ModelMBeanInfoSupport(String className, String description, ModelMBeanAttributeInfo[] attributes, ModelMBeanConstructorInfo[] constructors, ModelMBeanOperationInfo[] operations, ModelMBeanNotificationInfo[] notifications)
className - MBean类名
description - ModelMBean人类可读的描述
attributes阵列具有modelmbeanattributeinfo对象描述符
constructors阵列具有modelmbeanconstructorinfo对象描述符
operations阵列具有modelmbeanoperationinfo对象描述符
notifications阵列具有modelmbeannotificationinfo对象描述符
public ModelMBeanInfoSupport(String className, String description, ModelMBeanAttributeInfo[] attributes, ModelMBeanConstructorInfo[] constructors, ModelMBeanOperationInfo[] operations, ModelMBeanNotificationInfo[] notifications, Descriptor mbeandescriptor)
className - MBean类名
description - ModelMBean人类可读的描述
attributes阵列具有modelmbeanattributeinfo对象描述符
constructors阵列具有modelmbeanconstructorinfo对象描述符
operations阵列具有modelmbeanoperationinfo对象描述符
notifications阵列具有modelmbeannotificationinfo对象描述符
mbeandescriptor描述符作为含MBean的广泛政策mbeandescriptor。如果描述符是空的,将构造一个默认的描述符。默认的描述是:名称= className,descriptortype =“MBean,DisplayName = className,persistpolicy =“从不”,日志=“F”,知名度=“1”。如果描述符不包含所有这些字段,则在这些默认值中添加丢失的字段。
RuntimeOperationsException包无效描述符传递参数时。(看到一个有效的MBean描述符的定义
getMBeanDescriptor)
public Object clone()
ModelMBeanAttributeInfo[]等)进行克隆。该方法主要是对修改的克隆通过
setDescriptor描述符不影响原来的对象描述符。
clone 接口
ModelMBeanInfo
clone 方法重写,继承类
MBeanInfo
Cloneable
public Descriptor[] getDescriptors(String inDescriptorType) throws MBeanException, RuntimeOperationsException
ModelMBeanInfo
getDescriptors 接口
ModelMBeanInfo
inDescriptorType值descriptortype场必须设置为描述符被退回。必须“MBean”、“属性”、“操作”、“构造函数”或“通知”。如果它是空的或空的,那么所有类型将被返回。
MBeanException套分布式通信异常。
RuntimeOperationsException -包装时在参数descriptortype不是一个:“MBean”、“属性”、“操作”、“建设者”、“通知”,空。
ModelMBeanInfo.setDescriptors(javax.management.Descriptor[])
public void setDescriptors(Descriptor[] inDescriptors) throws MBeanException, RuntimeOperationsException
ModelMBeanInfo
setDescriptors 接口
ModelMBeanInfo
inDescriptors -被设置在ModelMBeanInfo描述符。列表的空元素将被忽略。所有的描述符的名称必须和descriptortype领域。
MBeanException套分布式通信异常。
RuntimeOperationsException包为空或无效描述符IllegalArgumentException。
ModelMBeanInfo.getDescriptors(java.lang.String)
public Descriptor getDescriptor(String inDescriptorName) throws MBeanException, RuntimeOperationsException
inDescriptorName -描述符的名字。
MBeanException套分布式通信异常。
RuntimeOperationsException包空的名字时。
setDescriptor(javax.management.Descriptor, java.lang.String)
public Descriptor getDescriptor(String inDescriptorName, String inDescriptorType) throws MBeanException, RuntimeOperationsException
ModelMBeanInfo
getDescriptor 接口
ModelMBeanInfo
inDescriptorName -描述符的名字。
inDescriptorType -描述符请求类型。如果这是空的或空的,那么所有类型都被搜索。有效的类型的MBean ','属性','构造函数'操作',和'通知'。此值将等于在描述符,返回“descriptortype”字段。
MBeanException套分布式通信异常。
RuntimeOperationsException包为空描述符名称或空的或无效的类型时。类型必须是“管理”、“属性”、“建设者”、“操作”,或“通知”。
ModelMBeanInfo.setDescriptor(javax.management.Descriptor, java.lang.String)
public void setDescriptor(Descriptor inDescriptor, String inDescriptorType) throws MBeanException, RuntimeOperationsException
ModelMBeanInfo
setDescriptor 接口
ModelMBeanInfo
inDescriptor的描述符被设置在ModelMBean。它不能为空。所有的描述符的名称必须和descriptortype领域。
inDescriptorType的描述符被设置的类型。如果这是零那么描述符中的descriptortype场用。如果指定此值必须在描述中descriptortype字段集。必须“MBean”、“属性”、“建设者”、“操作”,或“通知”。
MBeanException套分布式通信异常。
RuntimeOperationsException包非法或空参数或者广义的名称字段不在相应的mbeanattributeinfo或mbeanconstructorinfo或mbeannotificationinfo或mbeanoperationinfo发现时。
ModelMBeanInfo.getDescriptor(java.lang.String, java.lang.String)
public ModelMBeanAttributeInfo getAttribute(String inName) throws MBeanException, RuntimeOperationsException
ModelMBeanInfo
getAttribute 接口
ModelMBeanInfo
inName - ModelMBeanAttributeInfo的名字取得。如果这个名字没有modelmbeanattributeinfo存在返回。
MBeanException套分布式通信异常。
RuntimeOperationsException包为空属性的名字时。
public ModelMBeanOperationInfo getOperation(String inName) throws MBeanException, RuntimeOperationsException
ModelMBeanInfo
getOperation 接口
ModelMBeanInfo
inName - ModelMBeanOperationInfo的名字取得。如果这个名字没有modelmbeanoperationinfo存在返回。
MBeanException套分布式通信异常。
RuntimeOperationsException包为空操作名称IllegalArgumentException。
public ModelMBeanConstructorInfo getConstructor(String inName) throws MBeanException, RuntimeOperationsException
inName -构造函数的名字。
MBeanException套分布式通信异常。
RuntimeOperationsException包的一个空的构造函数的名字时。
public ModelMBeanNotificationInfo getNotification(String inName) throws MBeanException, RuntimeOperationsException
ModelMBeanInfo
getNotification 接口
ModelMBeanInfo
inName - ModelMBeanNotificationInfo的名字取得。如果这个名字没有modelmbeannotificationinfo存在返回。
MBeanException套分布式通信异常。
RuntimeOperationsException包为空通知名IllegalArgumentException。
public Descriptor getDescriptor()
MBeanInfo
getDescriptor 接口
DescriptorRead
getDescriptor 方法重写,继承类
MBeanInfo
public Descriptor getMBeanDescriptor() throws MBeanException
ModelMBeanInfo
返回的描述符包含MBean ModelMBean宽政策。这个描述符包含关于持久MBean和默认策略和缓存元数据。
描述符中的字段被定义,但不限于以下几个字段。请注意,当此表中的类型是数字时,也可以使用一个长的十进制表示形式的字符串。
| Name | Type | Meaning |
|---|---|---|
| name | String | MBean name. |
| descriptorType | String | Must be "mbean". |
| displayName | String | Name of MBean to be used in displays. |
| persistPolicy | String | One of: OnUpdate|OnTimer|NoMoreOftenThan|OnUnregister|Always|Never. See the section "MBean Descriptor Fields" in the JMX specification document. |
| persistLocation | String | The fully qualified directory name where the MBean should be persisted (if appropriate). |
| persistFile | String | File name into which the MBean should be persisted. |
| persistPeriod | Number | Frequency of persist cycle in seconds, for OnTime and NoMoreOftenThan PersistPolicy |
| currencyTimeLimit | Number | How long cached value is valid: <0 never, =0 always, >0 seconds. |
| log | String | t: log all notifications, f: log no notifications. |
| logfile | String | Fully qualified filename to log events to. |
| visibility | Number | 1-4 where 1: always visible 4: rarely visible. |
| export | String | Name to be used to export/expose this MBean so that it is findable by other JMX Agents. |
| presentationString | String | XML formatted string to allow presentation of data to be associated with the MBean. |
默认的描述是:名称= className,descriptortype =“MBean,DisplayName = className,persistpolicy =“从不”,日志=“F”,可视为“1”如果描述不包含所有的这些领域,他们将加入这些默认值。
注:由于在本规范的早期版本不一致,建议不要使用负数或零值currencyTimeLimit。显示缓存的值是永远有效,省略currencyTimeLimit场。为了表示它始终是有效的,为这个字段使用一个非常大的数字。
getMBeanDescriptor 接口
ModelMBeanInfo
MBeanException套分布式通信异常。
ModelMBeanInfo.setMBeanDescriptor(javax.management.Descriptor)
public void setMBeanDescriptor(Descriptor inMBeanDescriptor) throws MBeanException, RuntimeOperationsException
ModelMBeanInfo
getMBeanDescriptor javadoc。
setMBeanDescriptor 接口
ModelMBeanInfo
inMBeanDescriptor的描述符集。
MBeanException套分布式通信异常。
RuntimeOperationsException包描述符无效时。
ModelMBeanInfo.getMBeanDescriptor()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.