java.applet

java.awt

java.awt.color

java.awt.datatransfer

java.awt.dnd

java.awt.event

java.awt.font

java.awt.geom

java.awt.im

java.awt.im.spi

java.awt.image

java.awt.image.renderable

java.awt.print

java.beans

java.beans.beancontext

java.io

java.lang

java.lang.annotation

java.lang.instrument

java.lang.management

java.lang.ref

java.lang.reflect

java.math

java.net

java.nio

java.nio.channels

java.nio.channels.spi

java.nio.charset

java.nio.charset.spi

java.rmi

java.rmi.activation

java.rmi.dgc

java.rmi.registry

java.rmi.server

java.security

java.security.acl

java.security.cert

java.security.interfaces

java.security.spec

java.sql

java.text

java.util

java.util.concurrent

java.util.concurrent.atomic

java.util.concurrent.locks

java.util.jar

java.util.logging

java.util.prefs

java.util.regex

java.util.zip

javax.accessibility

javax.activity

javax.crypto

javax.crypto.interfaces

javax.crypto.spec

javax.imageio

javax.imageio.event

javax.imageio.metadata

javax.imageio.plugins.bmp

javax.imageio.plugins.jpeg

javax.imageio.spi

javax.imageio.stream

javax.management

javax.management.loading

javax.management.modelmbean

javax.management.monitor

javax.management.openmbean

javax.management.relation

javax.management.remote

javax.management.remote.rmi

javax.management.timer

javax.naming

javax.naming.directory

javax.naming.event

javax.naming.ldap

javax.naming.spi

javax.net

javax.net.ssl

javax.print

javax.print.attribute

javax.print.attribute.standard

javax.print.event

javax.rmi

javax.rmi.CORBA

javax.rmi.ssl

javax.security.auth

javax.security.auth.callback

javax.security.auth.kerberos

javax.security.auth.login

javax.security.auth.spi

javax.security.auth.x500

javax.security.cert

javax.security.sasl

javax.sound.midi

javax.sound.midi.spi

javax.sound.sampled

javax.sound.sampled.spi

javax.sql

javax.sql.rowset

javax.sql.rowset.serial

javax.sql.rowset.spi

javax.swing

javax.swing.border

javax.swing.colorchooser

javax.swing.event

javax.swing.filechooser

javax.swing.plaf

javax.swing.plaf.basic

javax.swing.plaf.metal

javax.swing.plaf.multi

javax.swing.plaf.synth

javax.swing.table

javax.swing.text

javax.swing.text

javax.swing.text.parser

javax.swing.text.rtf

javax.swing.tree

javax.swing.undo

javax.transaction

javax.transaction.xa

javax.xml

javax.xml.datatype

javax.xml.namespace

javax.xml.parsers

javax.xml.transform

javax.xml.transform.dom

javax.xml.transform.sax

javax.xml.transform.stream

javax.xml.validation

javax.xml.xpath

org.ietf.jgss

org.omg.CORBA

org.omg.CORBA_2_3

org.omg.CORBA_2_3.portable

org.omg.CORBA.DynAnyPackage

org.omg.CORBA.ORBPackage

org.omg.CORBA.portable

org.omg.CORBA.TypeCodePackage

org.omg.CosNaming

org.omg.CosNaming.NamingContextExtPackage

org.omg.CosNaming.NamingContextPackage

org.omg.Dynamic

org.omg.DynamicAny

org.omg.DynamicAny.DynAnyFactoryPackage

org.omg.DynamicAny.DynAnyPackage

org.omg.IOP

org.omg.IOP.CodecFactoryPackage

org.omg.IOP.CodecPackage

org.omg.Messaging

org.omg.PortableInterceptor

org.omg.PortableInterceptor.ORBInitInfoPackage

org.omg.PortableServer

org.omg.PortableServer.CurrentPackage

org.omg.PortableServer.POAManagerPackage

org.omg.PortableServer.POAPackage

org.omg.PortableServer.portable

org.omg.PortableServer.ServantLocatorPackage

org.omg.SendingContext

org.omg.stub.java.rmi

org.w3c.dom

org.w3c.dom.bootstrap

org.w3c.dom.events

org.w3c.dom.ls

org.xml.sax

org.xml.sax.ext

org.xml.sax.helpers

allclasses-frame

allclasses-noframe

constant-values

deprecated-list

help-doc

JavaTM 2 Platform
Standard Ed. 5.0

javax.management.modelmbean
类 ModelMBeanAttributeInfo

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

public class ModelMBeanAttributeInfo
extends MBeanAttributeInfo
implements DescriptorAccess, Cloneable

ModelMBeanAttributeInfo 对象描述了 ModelMBean 的一个属性。它是 MBeanAttributeInfo 的一个子类,添加了关联 Descriptor 和 DescriptorAccess 接口实现。

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

name            : 属性名称 
descriptorType  : 必须为 "attribute"   
value           : 属性的当前值
 default        : 属性的默认值
 displayName    : 要在显示中使用的属性名称
 getMethod      : get 方法的操作描述符名称
 setMethod      : set 方法的操作描述符名称
 protocolMap    : 实现 Descriptor 接口的对象:映射关系必须适用于该属性
并且项可以在运行时进行更新或扩充。
 persistPolicy  : OnUpdate|OnTimer|NoMoreOftenThan|Always|Never  
 persistPeriod  : 秒数 - 保持周期的频率。当 persistPolicy 为 "OnTimer" 或 "NoMoreOftenThan" 时使用。  
 currencyTimeLimit : 值保持有效的时间, <0 为无效,=0 为总是有效,>0 为有效的秒数
 lastUpdatedTimeStamp : 当设置值时
 visibility     : 1-4,其中 1:总是可见;4:几乎不可见
 presentationString : 允许数据呈现的 xml 格式的字符串
 
默认的描述符包含 name、descriptorType 和 displayName 字段。

注:由于与此规范的以前版本不一致,因此对于 currencyTimeLimit,推荐不使用负值或零。要指示某个缓存的值永远无效,请忽略 currencyTimeLimit 字段。要指示它总是有效,请为此字段使用一个非常大的值。

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

字段摘要
 
从类 javax.management.MBeanFeatureInfo 继承的字段
description, name
 
构造方法摘要
ModelMBeanAttributeInfo(ModelMBeanAttributeInfo inInfo)
          根据此 ModelMBeanAttributeInfo Object 构造新 ModelMBeanAttributeInfo 对象。
ModelMBeanAttributeInfo(String name, String description, Method getter, Method setter)
          构造具有默认描述符的 ModelMBeanAttributeInfo 对象。
ModelMBeanAttributeInfo(String name, String description, Method getter, Method 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 对象。
 
方法摘要
 Object clone()
          创建并返回新 ModelMBeanAttributeInfo,它是此 ModelMBeanAttributeInfo 的副本。
 Descriptor getDescriptor()
          获取 ModelMBeanAttributeInfo 的关联 Descriptor 的副本。
 void setDescriptor(Descriptor inDescriptor)
          设置 ModelMBeanAttributeDescriptor 的关联 Descriptor(完全取代)。
 String toString()
          返回 ModelMBeanAttributeInfo 实例的可读版本。
 
从类 javax.management.MBeanAttributeInfo 继承的方法
equals, getType, hashCode, isIs, isReadable, isWritable
 
从类 javax.management.MBeanFeatureInfo 继承的方法
getDescription, getName
 
从类 java.lang.Object 继承的方法
finalize, getClass, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

ModelMBeanAttributeInfo

public ModelMBeanAttributeInfo(String name,
                               String description,
                               Method getter,
                               Method setter)
                        throws IntrospectionException
构造具有默认描述符的 ModelMBeanAttributeInfo 对象。

参数:
name - 属性名称。
description - 属性的可读描述。它是可选的。
getter - 用于读取属性值的方法。如果该属性是只写的,则可以为 null。
setter - 用于写入属性值的方法。如果该属性是只读的,则可以为 null。
抛出:
IntrospectionException - 如果此属性的定义中存在一致性问题。

ModelMBeanAttributeInfo

public ModelMBeanAttributeInfo(String name,
                               String description,
                               Method getter,
                               Method setter,
                               Descriptor descriptor)
                        throws IntrospectionException
构造 ModelMBeanAttributeInfo 对象。

参数:
name - 属性名称。
description - 属性的可读描述。它是可选的。
getter - 用于读取属性值的方法。如果该属性是只写的,则可以为 null。
setter - 用于写入属性值的方法。如果该属性是只读的,则可以为 null。
descriptor - 包含此 Attribute 实例的适当元数据的 Descriptor 的实例。如果它为 null,则将创建默认描述符。如果描述符不包含 "displayName" 字段,则以默认值将此字段添加到描述符中。
抛出:
IntrospectionException - 如果此属性的定义中存在一致性问题。
RuntimeOperationsException - 包装一个 IllegalArgumentException。描述符无效,或者描述符 "name" 字段不等于 name 参数,或者描述符字段 "DescriptorType" 不等于 "attribute"。

ModelMBeanAttributeInfo

public ModelMBeanAttributeInfo(String name,
                               String type,
                               String description,
                               boolean isReadable,
                               boolean isWritable,
                               boolean isIs)
构造具有默认描述符的 ModelMBeanAttributeInfo 对象。

参数:
name - 属性名称
type - 属性的类型名称或类名称
description - 属性的可读描述。
isReadable - 如果属性有 getter 方法,则为 true,否则为 false。
isWritable - 如果属性有 setter 方法,则为 true,否则为 false。
isIs - 如果属性有 "is" getter,则为 true,否则为 false。

ModelMBeanAttributeInfo

public ModelMBeanAttributeInfo(String name,
                               String type,
                               String description,
                               boolean isReadable,
                               boolean isWritable,
                               boolean isIs,
                               Descriptor descriptor)
构造具有默认描述符的 ModelMBeanAttributeInfo 对象。

参数:
name - 属性名称
type - 属性的类型名称或类名称
description - 属性的可读描述。
isReadable - 如果属性有 getter 方法,则为 true,否则为 false。
isWritable - 如果属性有 setter 方法,则为 true,否则为 false。
isIs - 如果属性有 "is" getter,则为 true,否则为 false。
descriptor - 包含此 Attribute 实例的适当元数据的 Descriptor 的一个实例。如果它为 null,则将创建默认描述符。如果描述符不包含 "displayName" 字段,则以默认值将此字段添加到描述符中。
抛出:
RuntimeOperationsException - 包装一个 IllegalArgumentException。描述符无效,或者描述符 "name" 字段不等于 name 参数,或者描述符字段 "DescriptorType" 不等于 "attribute"。

ModelMBeanAttributeInfo

public ModelMBeanAttributeInfo(ModelMBeanAttributeInfo inInfo)
根据此 ModelMBeanAttributeInfo Object 构造新 ModelMBeanAttributeInfo 对象。将创建默认描述符。

参数:
inInfo - 要被复制的 ModelMBeanAttributeInfo
方法详细信息

getDescriptor

public Descriptor getDescriptor()
获取 ModelMBeanAttributeInfo 的关联 Descriptor 的副本。

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

setDescriptor

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

指定者:
接口 DescriptorAccess 中的 setDescriptor
参数:
inDescriptor - 替换与 ModelMBeanAttributeInfo 关联的 Descriptor
抛出:
RuntimeOperationsException - 包装无效 Descriptor 的 IllegalArgumentException
另请参见:
getDescriptor()

clone

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

覆盖:
MBeanAttributeInfo 中的 clone
返回:
此实例的一个克隆。
抛出:
RuntimeOperationsException - 如果 Names 或 Values 字段的值为非法值。如果描述符构造由于任何原因而失败,都将抛出此异常。
另请参见:
Cloneable

toString

public String toString()
返回 ModelMBeanAttributeInfo 实例的可读版本。

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

JavaTM 2 Platform
Standard Ed. 5.0

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

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