APIdia Launch Partner
Top Description Fields Constructors Methods
javax.management

public Class MBeanFeatureInfo

extends Object
implements Serializable, DescriptorRead
Class Inheritance
All Implemented Interfaces
javax.management.DescriptorRead, java.io.Serializable
Known Direct Subclasses
javax.management.MBeanNotificationInfo, javax.management.MBeanOperationInfo, javax.management.MBeanParameterInfo, javax.management.MBeanAttributeInfo, javax.management.MBeanConstructorInfo
Imports
java.io.IOException, .ObjectInputStream, .ObjectOutputStream, .Serializable, .StreamCorruptedException, java.util.Objects

Provides general information for an MBean descriptor object. The feature described can be an attribute, an operation, a parameter, or a notification. Instances of this class are immutable. Subclasses may be mutable but this is not recommended.

Since
1.5

Field Summary

Modifier and TypeField and Description
protected String
description

The human-readable description of the feature.

private transient Descriptor
protected String
name

The name of the feature.

pack-priv static final long

Constructor Summary

AccessConstructor and Description
public
MBeanFeatureInfo(String
The name of the feature.
name
,
String
A human readable description of the feature.
description
)

Constructs an MBeanFeatureInfo object.

public
MBeanFeatureInfo(String
The name of the feature.
name
,
String
A human readable description of the feature.
description
,
Descriptor
The descriptor for the feature. This may be null which is equivalent to an empty descriptor.
descriptor
)

Constructs an MBeanFeatureInfo object.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if and only if o is an MBeanFeatureInfo such that its getName(), getDescription(), and getDescriptor() values are equal (not necessarily identical) to those of this MBeanFeatureInfo.
equals
(Object
the object to compare to.
o
)

Overrides java.lang.Object.equals.

Compare this MBeanFeatureInfo to another.

public String

Returns:

the human-readable description of the feature.
getDescription
()

Returns the human-readable description of the feature.

public Descriptor

Returns:

a descriptor that is either immutable or a copy of the original.
getDescriptor
()

Implements javax.management.DescriptorRead.getDescriptor.

Returns the descriptor for the feature.

public String

Returns:

the name of the feature.
getName
()

Returns the name of the feature.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

private void
private void
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

descriptionback to summary
protected String description

The human-readable description of the feature. It is recommended that subclasses call getDescription rather than reading this field, and that they not change it.

descriptorback to summary
private transient Descriptor descriptor
nameback to summary
protected String name

The name of the feature. It is recommended that subclasses call getName rather than reading this field, and that they not change it.

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Constructor Detail

MBeanFeatureInfoback to summary
public MBeanFeatureInfo(String name, String description)

Constructs an MBeanFeatureInfo object. This constructor is equivalent to MBeanFeatureInfo(name, description, (Descriptor) null.

Parameters
name:String

The name of the feature.

description:String

A human readable description of the feature.

MBeanFeatureInfoback to summary
public MBeanFeatureInfo(String name, String description, Descriptor descriptor)

Constructs an MBeanFeatureInfo object.

Parameters
name:String

The name of the feature.

description:String

A human readable description of the feature.

descriptor:Descriptor

The descriptor for the feature. This may be null which is equivalent to an empty descriptor.

Since
1.6

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Compare this MBeanFeatureInfo to another.

Parameters
o:Object

the object to compare to.

Returns:boolean

true if and only if o is an MBeanFeatureInfo such that its getName(), getDescription(), and getDescriptor() values are equal (not necessarily identical) to those of this MBeanFeatureInfo.

getDescriptionback to summary
public String getDescription()

Returns the human-readable description of the feature.

Returns:String

the human-readable description of the feature.

getDescriptorback to summary
public Descriptor getDescriptor()

Implements javax.management.DescriptorRead.getDescriptor.

Returns the descriptor for the feature. Changing the returned value will have no affect on the original descriptor.

Returns:Descriptor

a descriptor that is either immutable or a copy of the original.

Since
1.6
getNameback to summary
public String getName()

Returns the name of the feature.

Returns:String

the name of the feature.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
readObjectback to summary
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException

Deserializes an MBeanFeatureInfo from an ObjectInputStream.

Since
1.6
Serial data
For compatibility reasons, an object of this class is deserialized as follows.

The method defaultReadObject() is called first to deserialize the object except the field descriptor, which is not serialized in the default way. Then the method read() is called to read a byte, the field descriptor is deserialized according to the value of the byte value:

  • 1. The method readObject() is called twice to obtain the field names (a String[]) and the field values (an Object[]) of the descriptor. The two obtained values then are used to construct an ImmutableDescriptor instance for the field descriptor;
  • 0. The value for the field descriptor is obtained directly by calling the method readObject(). If the obtained value is null, the field descriptor is set to EMPTY_DESCRIPTOR;
  • -1. This means that there is no byte to read and that the object is from an earlier version of the JMX API. The field descriptor is set to EMPTY_DESCRIPTOR
  • Any other value. A StreamCorruptedException is thrown.
writeObjectback to summary
private void writeObject(ObjectOutputStream out) throws IOException

Serializes an MBeanFeatureInfo to an ObjectOutputStream.

Since
1.6
Serial data
For compatibility reasons, an object of this class is serialized as follows.

The method defaultWriteObject() is called first to serialize the object except the field descriptor which is declared as transient. The field descriptor is serialized as follows:

  • If descriptor is an instance of the class ImmutableDescriptor, the method write(int val) is called to write a byte with the value 1, then the method writeObject(Object obj) is called twice to serialize the field names and the field values of the descriptor, respectively as a String[] and an Object[];
  • Otherwise, the method write(int val) is called to write a byte with the value 0, then the method writeObject(Object obj) is called to serialize directly the field descriptor.