2362N/A * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * Copyright IBM Corp. 1999-2000. All rights reserved. 689N/A * <p>The ModelMBeanAttributeInfo object describes an attribute of the ModelMBean. 0N/A * It is a subclass of MBeanAttributeInfo with the addition of an associated Descriptor 689N/A * and an implementation of the DescriptorAccess interface.</p> 689N/A * The fields in the descriptor are defined, but not limited to, the following. 689N/A * Note that when the Type in this table is Number, a String that is the decimal 689N/A * representation of a Long can also be used.</P> 689N/A * <table border="1" cellpadding="5"> 689N/A * <tr><th>Name</th><th>Type</th><th>Meaning</th></tr> 689N/A * <tr><td>name</td><td>String</td> 689N/A * <td>Attribute name.</td></tr> 689N/A * <tr><td>descriptorType</td><td>String</td> 689N/A * <td>Must be "attribute".</td></tr> 689N/A * <tr id="value-field"><td>value</td><td>Object</td> 689N/A * <td>Current (cached) value for attribute.</td></tr> 689N/A * <tr><td>default</td><td>Object</td> 689N/A * <td>Default value for attribute.</td></tr> 689N/A * <tr><td>displayName</td><td>String</td> 689N/A * <td>Name of attribute to be used in displays.</td></tr> 689N/A * <tr><td>getMethod</td><td>String</td> 689N/A * <td>Name of operation descriptor for get method.</td></tr> 689N/A * <tr><td>setMethod</td><td>String</td> 689N/A * <td>Name of operation descriptor for set method.</td></tr> 689N/A * <tr><td>protocolMap</td><td>Descriptor</td> 689N/A * <td>See the section "Protocol Map Support" in the JMX specification 689N/A * document. Mappings must be appropriate for the attribute and entries 689N/A * can be updated or augmented at runtime.</td></tr> 689N/A * <tr><td>persistPolicy</td><td>String</td> 689N/A * <td>One of: OnUpdate|OnTimer|NoMoreOftenThan|OnUnregister|Always|Never. 689N/A * See the section "MBean Descriptor Fields" in the JMX specification 689N/A * <tr><td>persistPeriod</td><td>Number</td> 689N/A * <td>Frequency of persist cycle in seconds. Used when persistPolicy is 689N/A * "OnTimer" or "NoMoreOftenThan".</td></tr> 689N/A * <tr><td>currencyTimeLimit</td><td>Number</td> 689N/A * <td>How long <a href="#value=field">value</a> is valid: <0 never, 689N/A * =0 always, >0 seconds.</td></tr> 689N/A * <tr><td>lastUpdatedTimeStamp</td><td>Number</td> 689N/A * <td>When <a href="#value-field">value</a> was set.</td></tr> 689N/A * <tr><td>visibility</td><td>Number</td> 689N/A * <td>1-4 where 1: always visible, 4: rarely visible.</td></tr> 689N/A * <tr><td>presentationString</td><td>String</td> 689N/A * <td>XML formatted string to allow presentation of data.</td></tr> 689N/A * <p>The default descriptor contains the name, descriptorType and displayName 689N/A * fields. The default value of the name and displayName fields is the name of 0N/A * <p><b>Note:</b> because of inconsistencies in previous versions of 0N/A * this specification, it is recommended not to use negative or zero 0N/A * values for <code>currencyTimeLimit</code>. To indicate that a 0N/A * cached value is never valid, omit the 0N/A * <code>currencyTimeLimit</code> field. To indicate that it is 0N/A * always valid, use a very large number for this field.</p> 0N/A * <p>The <b>serialVersionUID</b> of this class is <code>6181543027787327345L</code>. 0N/A // Serialization compatibility stuff: 0N/A // Two serial forms are supported in this class. The selected form depends 0N/A // on system property "jmx.serial.form": 0N/A // - "1.0" for JMX 1.0 0N/A // - any other value for JMX 1.1 and higher 0N/A // Serial version for old serial form 0N/A // Serial version for new serial form 0N/A // Serializable fields in old serial form 0N/A // Serializable fields in new serial form 0N/A // Actual serial version and serial form 0N/A * @serialField attrDescriptor Descriptor The {@link Descriptor} 0N/A * containing the metadata corresponding to this attribute 0N/A // OK: No compat with 1.0 0N/A // END Serialization compatibility stuff 0N/A * @serial The {@link Descriptor} containing the metadata corresponding to 0N/A * Constructs a ModelMBeanAttributeInfo object with a default 0N/A * descriptor. The {@link Descriptor} of the constructed 0N/A * object will include fields contributed by any annotations 0N/A * on the {@code Method} objects that contain the {@link 0N/A * DescriptorKey} meta-annotation. 0N/A * @param name The name of the attribute. 0N/A * @param description A human readable description of the attribute. Optional. 0N/A * @param getter The method used for reading the attribute value. 0N/A * May be null if the property is write-only. 0N/A * @param setter The method used for writing the attribute value. 0N/A * May be null if the attribute is read-only. 0N/A * @exception IntrospectionException There is a consistency 0N/A * problem in the definition of this attribute. 0N/A "ModelMBeanAttributeInfo(" +
0N/A "String,String,Method,Method)",
0N/A // put getter and setter methods in operations list 0N/A // create default descriptor 0N/A * Constructs a ModelMBeanAttributeInfo object. The {@link 0N/A * Descriptor} of the constructed object will include fields 0N/A * contributed by any annotations on the {@code Method} 0N/A * objects that contain the {@link DescriptorKey} 0N/A * @param name The name of the attribute. 0N/A * @param description A human readable description of the attribute. Optional. 0N/A * @param getter The method used for reading the attribute value. 0N/A * May be null if the property is write-only. 0N/A * @param setter The method used for writing the attribute value. 0N/A * May be null if the attribute is read-only. 0N/A * @param descriptor An instance of Descriptor containing the 0N/A * appropriate metadata for this instance of the Attribute. If 0N/A * it is null, then a default descriptor will be created. If 1790N/A * the descriptor does not contain the field "displayName" this field is added 1790N/A * in the descriptor with its default value. 0N/A * @exception IntrospectionException There is a consistency 0N/A * problem in the definition of this attribute. 0N/A * @exception RuntimeOperationsException Wraps an 1790N/A * IllegalArgumentException. The descriptor is invalid, or descriptor 1790N/A * field "name" is not equal to name parameter, or descriptor field 1790N/A * "descriptorType" is not equal to "attribute". 0N/A // put getter and setter methods in operations list 0N/A "ModelMBeanAttributeInfo(" +
0N/A "String,String,Method,Method,Descriptor)",
0N/A * Constructs a ModelMBeanAttributeInfo object with a default descriptor. 0N/A * @param name The name of the attribute 0N/A * @param type The type or class name of the attribute 0N/A * @param description A human readable description of the attribute. 0N/A * @param isReadable True if the attribute has a getter method, false otherwise. 0N/A * @param isWritable True if the attribute has a setter method, false otherwise. 0N/A * @param isIs True if the attribute has an "is" getter, false otherwise. 0N/A // create default descriptor 0N/A "ModelMBeanAttributeInfo(" +
0N/A "String,String,String,boolean,boolean,boolean)",
1790N/A * Constructs a ModelMBeanAttributeInfo object. 0N/A * @param name The name of the attribute 0N/A * @param type The type or class name of the attribute 0N/A * @param description A human readable description of the attribute. 0N/A * @param isReadable True if the attribute has a getter method, false otherwise. 0N/A * @param isWritable True if the attribute has a setter method, false otherwise. 0N/A * @param isIs True if the attribute has an "is" getter, false otherwise. 0N/A * @param descriptor An instance of Descriptor containing the 0N/A * appropriate metadata for this instance of the Attribute. If 0N/A * it is null then a default descriptor will be created. If 1790N/A * the descriptor does not contain the field "displayName" this field 1790N/A * is added in the descriptor with its default value. 0N/A * @exception RuntimeOperationsException Wraps an 1790N/A * IllegalArgumentException. The descriptor is invalid, or descriptor 1790N/A * field "name" is not equal to name parameter, or descriptor field 1790N/A * "descriptorType" is not equal to "attribute". 0N/A "ModelMBeanAttributeInfo(String,String,String," +
0N/A "boolean,boolean,boolean,Descriptor)",
0N/A * Constructs a new ModelMBeanAttributeInfo object from this 0N/A * ModelMBeanAttributeInfo Object. A default descriptor will 0N/A * @param inInfo the ModelMBeanAttributeInfo to be duplicated 0N/A "ModelMBeanAttributeInfo(ModelMBeanAttributeInfo)",
0N/A * Gets a copy of the associated Descriptor for the 0N/A * ModelMBeanAttributeInfo. 0N/A * @return Descriptor associated with the 0N/A * ModelMBeanAttributeInfo object. 0N/A * @see #setDescriptor 0N/A "getDescriptor()",
"Entry");
0N/A * Sets associated Descriptor (full replace) for the 0N/A * ModelMBeanAttributeDescriptor. If the new Descriptor is 0N/A * null, then the associated Descriptor reverts to a default 0N/A * descriptor. The Descriptor is validated before it is 0N/A * assigned. If the new Descriptor is invalid, then a 0N/A * RuntimeOperationsException wrapping an 0N/A * IllegalArgumentException is thrown. 0N/A * @param inDescriptor replaces the Descriptor associated with the 0N/A * ModelMBeanAttributeInfo 0N/A * @exception RuntimeOperationsException Wraps an 0N/A * IllegalArgumentException for an invalid Descriptor 0N/A * @see #getDescriptor 0N/A * Creates and returns a new ModelMBeanAttributeInfo which is a duplicate of this ModelMBeanAttributeInfo. 0N/A * @exception RuntimeOperationsException for illegal value for 0N/A * field Names or field Values. If the descriptor construction 0N/A * fails for any reason, this exception will be thrown. 0N/A "clone()",
"Entry");
0N/A * Returns a human-readable version of the 0N/A * ModelMBeanAttributeInfo instance. 0N/A * Clones the passed in Descriptor, sets default values, and checks for validity. 0N/A * If the Descriptor is invalid (for instance by having the wrong "name"), 0N/A * this indicates programming error and a RuntimeOperationsException will be thrown. 0N/A * The following fields will be defaulted if they are not already set: 0N/A * displayName=this.getName(),name=this.getName(),descriptorType = "attribute" 0N/A * @param in Descriptor to be checked, or null which is equivalent to 0N/A * an empty Descriptor. 0N/A * @exception RuntimeOperationsException if Descriptor is invalid 0N/A "The isValid() method of the Descriptor object itself returned false,"+
0N/A "The Descriptor \"name\" field does not match the object described. " +
0N/A "The Descriptor \"descriptorType\" field does not match the object described. " +
0N/A * Deserializes a {@link ModelMBeanAttributeInfo} from an {@link ObjectInputStream}. 0N/A // New serial form ignores extra field "currClass" 0N/A * Serializes a {@link ModelMBeanAttributeInfo} to an {@link ObjectOutputStream}. 0N/A // Serializes this instance in the old serial form 0N/A // Serializes this instance in the new serial form