/* Descriptor.java -- Metadata container. Copyright (C) 2007 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package javax.management; import java.io.Serializable; /** *

* Provides metadata for a management element as a series * of fields, formed from name-value pairs. Descriptors * are usually attached to one of the Info * classes, such as {@link MBeanAttributeInfo}. *

*

* Field names are not case-sensitive, but are case-preserving * (in that the same use of case will be returned by * {@link #getFields()} and {@link #getFieldNames()}). * The type of the value should match the type returned * by the getType() method of the associated * Info object. In the case of {@link MXBean}s, * this should be the mapped type returned by the mapping rules. *

*

* The contents of a descriptor may be immutable, in which * case, attempts to change the contents of the descriptor * will cause an exception to be thrown. Immutable descriptors * are usually instances or subclasses of {@link ImmutableDescriptor}, * while mutable descriptors are usually instances or subclasses * of {@link javax.management.modelmbean.DescriptorSupport}. *

*

* A series of field names are predefined, but additional * ones can be added as needed. Predefined names never include * a period ('.'), and so additional names may safely avoid * conflicts by including this character. It is recommended that * additional names make use of the same syntax as Java package * names e.g. gnu.classpath.ImportantMetadata. *

*

* The predefined names are as follows: *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * , * {@link MBeanNotificationInfo}, {@link MBeanParameterInfo} * * * * * * * * * * * * * * * * *
* NameTypeUsed InMeaning
defaultValueObject{@link MBeanAttributeInfo}, * {@link MBeanParameterInfo}Default value for an attribute * or parameter.
deprecatedStringAnyThe annotated element * has been deprecated. Conventially, the field's value takes the form * of the version in which the element was deprecated, followed by an * explaination.
descriptionResourceBundleBaseNameStringAnyThe base name for the bundle in which the descriptionResourceKey * can be found.
descriptionResourceKeyStringAnyThe name of the resource key which contains a localized description of * this element.
enabledString{@link MBeanAttributeInfo}, * {@link MBeanNotificationInfo}, {@link MBeanOperationInfo}Specifies whether the annotated element is currently enabled or * not, via a value of either "true" or "false". *
immutableInfoString{@link MBeanInfo}If the value of this field is "true", this means that * the annotated element will not change and thus may be cached.
infoTimeoutString or Long{@link MBeanInfo}If this field is present, and non-zero, it will contain a value * in milliseconds for which the value of the annotated element will * remain unchanged, allowing it to be safely cached for that period.
interfaceClassNameString{@link MBeanInfo}The Java interface name associated with the bean, as returned * by {@link Class#getName()}.
legalValuesSet{@link MBeanAttributeInfo}, * {@link MBeanParameterInfo}Legal values for an attribute * or parameter.
maxValueObject{@link MBeanAttributeInfo}, * {@link MBeanParameterInfo}Maximum legal value for an attribute * or parameter.
metricTypeString{@link MBeanAttributeInfo}, * {@link MBeanOperationInfo}Specifies the type of metric represented * by the annotated element. This will be either "counter" * (an increasing value, which will only be reset and never decrease) * or "gauge" (an increasing and decreasing value).
minValueObject{@link MBeanAttributeInfo}, * {@link MBeanParameterInfo}Minimum legal value for an attribute * or parameter.
mxbeanString{@link MBeanInfo}Specifies whether the annotated element is an {@link MXBean} or * not, via a value of either "true" or "false". *
openType{@link javax.management.openmbean.OpenType}{@link MBeanAttributeInfo}, {@link MBeanOperationInfo}Specifies the open type of the attribute or parameter, the return * value of the operation or the user data of the notification respectively. * This is present on Open*Info instances and for {@link MXBean}s.
originalTypeString{@link MBeanAttributeInfo}, * {@link MBeanOperationInfo}, {@link MBeanParameterInfo}The original Java type of an element which has been converted * to another type according to the {@link MXBean} typing rules. * For example, {@link java.lang.management.MemoryType} becomes a * String after conversion. This field would contain * "java.lang.management.MemoryType" to represent the * earlier type of an element with the converted type.
severityInteger or String{@link MBeanNotificationInfo}Represents the severity * of the notification, ranging from 1 (most severe) to 6 (least * severe), with 0 representing unknown severity.
sinceStringAnyThe version in which this field was introduced.
unitsString{@link MBeanAttributeInfo}, * {@link MBeanOperationInfo}, {@link MBeanParameterInfo}The units used by the value of an attribute or parameter, * or the return value of an operation, such as "bytes", * "milliseconds" or "kilogrammes". *
*

Some names are also defined as part of the Model MBeans package. * See {@link javax.management.modelmbean.ModelMBeanInfo}.

* * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 */ public interface Descriptor extends Serializable, Cloneable { /** * Returns a clone of this descriptor, which can then be modified * independently of this descriptor. If the descriptor is * immutable, it is sufficient to return this instance. * * @return a clone of this descriptor. * @throws RuntimeOperationsException if creation of the new * descriptor fails for any * reason. */ Object clone() throws RuntimeOperationsException; /** *

* Returns true if this descriptor is equivalent to the * supplied object. This is true if the following holds: *

*