public class ModelMBeanAttributeInfo extends MBeanAttributeInfo implements DescriptorAccess
该对象描述的modelmbeanattributeinfo ModelMBean属性。它是一类具有一个相关的描述符的descriptoraccess接口的实现,除了mbeanattributeinfo。
描述符中的字段被定义,但不限于以下几个字段。请注意,当此表中的类型是数字时,也可以使用一个长的十进制表示形式的字符串。
Name | Type | Meaning |
---|---|---|
name | String | Attribute name. |
descriptorType | String | Must be "attribute". |
value | Object | Current (cached) value for attribute. |
default | Object | Default value for attribute. |
displayName | String | Name of attribute to be used in displays. |
getMethod | String | Name of operation descriptor for get method. |
setMethod | String | Name of operation descriptor for set method. |
protocolMap | Descriptor | See the section "Protocol Map Support" in the JMX specification document. Mappings must be appropriate for the attribute and entries can be updated or augmented at runtime. |
persistPolicy | String | One of: OnUpdate|OnTimer|NoMoreOftenThan|OnUnregister|Always|Never. See the section "MBean Descriptor Fields" in the JMX specification document. |
persistPeriod | Number | Frequency of persist cycle in seconds. Used when persistPolicy is "OnTimer" or "NoMoreOftenThan". |
currencyTimeLimit | Number | How long value is valid: <0 never, =0 always, >0 seconds. |
lastUpdatedTimeStamp | Number | When value was set. |
visibility | Number | 1-4 where 1: always visible, 4: rarely visible. |
presentationString | String | XML formatted string to allow presentation of data. |
默认的描述符包含名称、descriptortype和DisplayName领域。的名称和显示名称字段的默认值的属性的名称。
注:由于在本规范的早期版本不一致,建议不要使用负数或零值currencyTimeLimit
。显示缓存的值是永远有效,省略currencyTimeLimit
场。为了表示它始终是有效的,为这个字段使用一个非常大的数字。
这个班的serialVersionUID是6181543027787327345L
。
description, name
Constructor and Description |
---|
ModelMBeanAttributeInfo(ModelMBeanAttributeInfo inInfo)
从这个modelmbeanattributeinfo构建对象的新modelmbeanattributeinfo对象。
|
ModelMBeanAttributeInfo(String name, String description, 方法 getter, 方法 setter)
构建一个与默认modelmbeanattributeinfo对象描述符。
|
ModelMBeanAttributeInfo(String name, String description, 方法 getter, 方法 setter, Descriptor descriptor)
构建了一个modelmbeanattributeinfo对象。
|
ModelMBeanAttributeInfo(String name, String type, String description, boolean isReadable, boolean isWritable, boolean isIs)
构建一个与默认modelmbeanattributeinfo对象描述符。
|
ModelMBeanAttributeInfo(String name, String type, String description, boolean isReadable, boolean isWritable, boolean isIs, Descriptor descriptor)
构建了一个modelmbeanattributeinfo对象。
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
创建并返回一个新的modelmbeanattributeinfo这modelmbeanattributeinfo重复。
|
Descriptor |
getDescriptor()
得到的modelmbeanattributeinfo复制相关的描述符。
|
void |
setDescriptor(Descriptor inDescriptor)
集相关的描述符(全部替换)的modelmbeanattributedescriptor。
|
String |
toString()
返回一个可读的版本的modelmbeanattributeinfo实例。
|
equals, getType, hashCode, isIs, isReadable, isWritable
getDescription, getName
public ModelMBeanAttributeInfo(String name, String description, 方法 getter, 方法 setter) throws IntrospectionException
name
-属性的名称。
description
-人类的可读属性描述。可选。
getter
用于读取属性值的方法。可能是无效的,如果属性是只写。
setter
-用于写入属性值的方法。如果属性是只读的,则可能为空。
IntrospectionException
-在这个属性定义的一致性问题。
public ModelMBeanAttributeInfo(String name, String description, 方法 getter, 方法 setter, Descriptor descriptor) throws IntrospectionException
name
-属性的名称。
description
-人类的可读属性描述。可选。
getter
用于读取属性值的方法。可能是无效的,如果属性是只写。
setter
-用于写入属性值的方法。如果属性是只读的,则可能为空。
descriptor
-包含此属性的实例相应的元数据描述实例。如果它是空的,那么将创建一个默认的描述符。如果描述符不包含字段“显示名称”这场具有默认值的描述符添加。
IntrospectionException
-在这个属性定义的一致性问题。
RuntimeOperationsException
IllegalArgumentException -包装。描述符无效,或描述符字段“姓名”不等于名称参数,或描述领域的“descriptortype”并不等于“属性”。
public ModelMBeanAttributeInfo(String name, String type, String description, boolean isReadable, boolean isWritable, boolean isIs)
name
-属性的名称
type
的类型或属性的类的名称
description
-人类的可读属性描述。
isReadable
-如果属性的getter方法,否则为假。
isWritable
-如果属性setter方法,否则为假。
isIs
-如果属性有一个“是”者,否则为假。
public ModelMBeanAttributeInfo(String name, String type, String description, boolean isReadable, boolean isWritable, boolean isIs, Descriptor descriptor)
name
-属性的名称
type
的类型或属性的类的名称
description
-人类的可读属性描述。
isReadable
-如果属性的getter方法,否则为假。
isWritable
-如果属性setter方法,否则为假。
isIs
-如果属性有一个“是”者,否则为假。
descriptor
-包含此属性的实例相应的元数据描述实例。如果它为空,则将创建一个默认描述符。如果描述符不包含字段“显示名称”这场具有默认值的描述符添加。
RuntimeOperationsException
IllegalArgumentException -包装。描述符无效,或描述符字段“姓名”不等于名称参数,或描述领域的“descriptortype”并不等于“属性”。
public ModelMBeanAttributeInfo(ModelMBeanAttributeInfo inInfo)
inInfo
- modelmbeanattributeinfo被复制
public Descriptor getDescriptor()
getDescriptor
接口
DescriptorRead
getDescriptor
方法重写,继承类
MBeanFeatureInfo
setDescriptor(javax.management.Descriptor)
public void setDescriptor(Descriptor inDescriptor)
setDescriptor
接口
DescriptorAccess
inDescriptor
-取代的modelmbeanattributeinfo相关的描述符
RuntimeOperationsException
-包无效的描述符IllegalArgumentException
getDescriptor()
public Object clone()
clone
方法重写,继承类
MBeanAttributeInfo
RuntimeOperationsException
-非法值的字段名或字段值。如果描述符建设失败,任何原因,这个异常将被抛出。
Cloneable
public String toString()
toString
方法重写,继承类
MBeanAttributeInfo
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.