public interface 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、等)
Modifier and Type | Method and Description |
---|---|
Object |
clone()
创建并返回此对象的副本。
|
ModelMBeanAttributeInfo |
getAttribute(String inName)
返回请求的名称modelmbeanattributeinfo。
|
MBeanAttributeInfo[] |
getAttributes()
返回用于管理的属性列表。
|
String |
getClassName()
返回的MBean所描述的这
MBeanInfo java类的名称。
|
MBeanConstructorInfo[] |
getConstructors()
返回的MBean的公共构造函数列表。
|
String |
getDescription()
返回一个人类的MBean可读的描述。
|
Descriptor |
getDescriptor(String inDescriptorName, String inDescriptorType)
返回的名称和descriptortype请求描述符。
|
Descriptor[] |
getDescriptors(String inDescriptorType)
返回一个描述符阵列组成的所有描述符的类型indescriptortype ModelMBeanInfo。
|
Descriptor |
getMBeanDescriptor()
返回的描述符包含MBean ModelMBean宽政策。
|
ModelMBeanNotificationInfo |
getNotification(String inName)
返回请求的名称modelmbeannotificationinfo。
|
MBeanNotificationInfo[] |
getNotifications()
返回由MBean发出的通知列表。
|
ModelMBeanOperationInfo |
getOperation(String inName)
返回请求的名称modelmbeanoperationinfo。
|
MBeanOperationInfo[] |
getOperations()
返回的MBean操作列表。
|
void |
setDescriptor(Descriptor inDescriptor, String inDescriptorType)
集描述为ModelMBean型indescriptortype信息阵。
|
void |
setDescriptors(Descriptor[] inDescriptors)
添加或更换在ModelMBeanInfo描述符。
|
void |
setMBeanDescriptor(Descriptor inDescriptor)
集ModelMBean的描述符。
|
Descriptor[] getDescriptors(String inDescriptorType) throws MBeanException, RuntimeOperationsException
inDescriptorType
值descriptortype场必须设置为描述符被退回。必须“MBean”、“属性”、“操作”、“构造函数”或“通知”。如果它是空的或空的,那么所有类型将被返回。
MBeanException
套分布式通信异常。
RuntimeOperationsException
-包装时在参数descriptortype不是一个:“MBean”、“属性”、“操作”、“建设者”、“通知”,空。
setDescriptors(javax.management.Descriptor[])
void setDescriptors(Descriptor[] inDescriptors) throws MBeanException, RuntimeOperationsException
inDescriptors
-被设置在ModelMBeanInfo描述符。列表的空元素将被忽略。所有的描述符的名称必须和descriptortype领域。
RuntimeOperationsException
包为空或无效描述符IllegalArgumentException。
MBeanException
套分布式通信异常。
getDescriptors(java.lang.String)
Descriptor getDescriptor(String inDescriptorName, String inDescriptorType) throws MBeanException, RuntimeOperationsException
inDescriptorName
-描述符的名字。
inDescriptorType
-描述符请求类型。如果这是空的或空的,那么所有类型都被搜索。有效的类型的MBean ','属性','构造函数'操作',和'通知'。此值将等于在描述符,返回“descriptortype”字段。
MBeanException
套分布式通信异常。
RuntimeOperationsException
包为空描述符名称或空的或无效的类型时。类型必须是“管理”、“属性”、“建设者”、“操作”,或“通知”。
setDescriptor(javax.management.Descriptor, java.lang.String)
void setDescriptor(Descriptor inDescriptor, String inDescriptorType) throws MBeanException, RuntimeOperationsException
inDescriptor
的描述符被设置在ModelMBean。它不能为空。所有的描述符的名称必须和descriptortype领域。
inDescriptorType
的描述符被设置的类型。如果这是零那么描述符中的descriptortype场用。如果指定此值必须在描述中descriptortype字段集。必须“MBean”、“属性”、“建设者”、“操作”,或“通知”。
RuntimeOperationsException
包非法或空参数或者广义的名称字段不在相应的mbeanattributeinfo或mbeanconstructorinfo或mbeannotificationinfo或mbeanoperationinfo发现时。
MBeanException
套分布式通信异常。
getDescriptor(java.lang.String, java.lang.String)
Descriptor getMBeanDescriptor() throws MBeanException, RuntimeOperationsException
返回的描述符包含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
场。为了表示它始终是有效的,为这个字段使用一个非常大的数字。
MBeanException
套分布式通信异常。
RuntimeOperationsException
-
RuntimeException
发生在获取描述符。
setMBeanDescriptor(javax.management.Descriptor)
void setMBeanDescriptor(Descriptor inDescriptor) throws MBeanException, RuntimeOperationsException
getMBeanDescriptor
javadoc。
inDescriptor
的描述符集。
MBeanException
套分布式通信异常。
RuntimeOperationsException
包描述符无效时。
getMBeanDescriptor()
ModelMBeanAttributeInfo getAttribute(String inName) throws MBeanException, RuntimeOperationsException
inName
- ModelMBeanAttributeInfo的名字取得。如果这个名字没有modelmbeanattributeinfo存在返回。
MBeanException
套分布式通信异常。
RuntimeOperationsException
包为空属性的名字时。
ModelMBeanOperationInfo getOperation(String inName) throws MBeanException, RuntimeOperationsException
inName
- ModelMBeanOperationInfo的名字取得。如果这个名字没有modelmbeanoperationinfo存在返回。
MBeanException
套分布式通信异常。
RuntimeOperationsException
包为空操作名称IllegalArgumentException。
ModelMBeanNotificationInfo getNotification(String inName) throws MBeanException, RuntimeOperationsException
inName
- ModelMBeanNotificationInfo的名字取得。如果这个名字没有modelmbeannotificationinfo存在返回。
MBeanException
套分布式通信异常。
RuntimeOperationsException
包为空通知名IllegalArgumentException。
Object clone()
MBeanAttributeInfo[] getAttributes()
MBeanAttributeInfo
对象描述。
MBeanAttributeInfo
对象数组。
String getClassName()
MBeanInfo
java类的名称。
MBeanConstructorInfo[] getConstructors()
MBeanConstructorInfo
对象描述。
MBeanConstructorInfo
对象数组。
String getDescription()
MBeanNotificationInfo[] getNotifications()
MBeanNotificationInfo
对象描述。
除了由应用程序指定的任何通知,ModelMBean可能永远也送两个额外的通知:
MBeanNotificationInfo
对象数组。
MBeanOperationInfo[] getOperations()
MBeanOperationInfo
对象描述。
MBeanOperationInfo
对象数组。
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.