Describes the management interface exposed by an MBean; that is, the set of attributes and operations which are available for management operations. Instances of this class are immutable. Subclasses may be mutable but this is not recommended.
Usually the MBeanInfo for any given MBean does
not change over the lifetime of that MBean. Dynamic MBeans can change their
MBeanInfo and in that case it is recommended that they emit a Notification with a type of "jmx.mbean.info.changed" and a userData that is the new MBeanInfo. This is not required, but
provides a conventional way for clients of the MBean to discover the change.
See also the immutableInfo and
infoTimeout fields in the MBeanInfo Descriptor.
The contents of the MBeanInfo for a Dynamic MBean
are determined by its getMBeanInfo() method. This includes Open MBeans and Model
MBeans, which are kinds of Dynamic MBeans.
The contents of the MBeanInfo for a Standard MBean
are determined by the MBean server as follows:
getClassName() returns the Java class name of the MBean
object;
getConstructors() returns the list of all public
constructors in that object;
getAttributes() returns the list of all attributes
whose existence is deduced from the presence in the MBean interface
of a getName, isName, or
setName method that conforms to the conventions
for Standard MBeans;
getOperations() returns the list of all methods in
the MBean interface that do not represent attributes;
getNotifications() returns an empty array if the MBean
does not implement the NotificationBroadcaster interface,
otherwise the result of calling NotificationBroadcaster#getNotificationInfo() on it;
getDescriptor() returns a descriptor containing the contents
of any descriptor annotations in the MBean interface (see
@DescriptorKey).
The description returned by getDescription() and the
descriptions of the contained attributes and operations are not specified.
The remaining details of the MBeanInfo for a
Standard MBean are not specified. This includes the description of
any contained constructors, and notifications; the names
of parameters to constructors and operations; and the descriptions of
constructor parameters.
| Modifier and Type | Field and Description |
|---|---|
| private final transient boolean | arrayGettersSafe
True if this class is known not to override the array-valued getters of MBeanInfo. |
| private static final Map | arrayGettersSafeMap
Cached results of previous calls to arrayGettersSafe. |
| private final MBeanAttributeInfo[] | |
| private final String | |
| private final MBeanConstructorInfo[] | |
| private final String | |
| private transient Descriptor | |
| private transient int | |
| private final MBeanNotificationInfo[] | |
| private final MBeanOperationInfo[] | |
| pack-priv static final long |
| Access | Constructor and Description |
|---|---|
| public | MBeanInfo(String
The name of the Java class of the MBean described
by this className, String MBeanInfo. This value may be any
syntactically legal Java class name. It does not have to be a
Java class known to the MBean server or to the MBean's
ClassLoader. If it is a Java class known to the MBean's
ClassLoader, it is recommended but not required that the
class's public methods include those that would appear in a
Standard MBean implementing the attributes and operations in
this MBeanInfo.A human readable description of the MBean (optional). description, MBeanAttributeInfo[] The list of exposed attributes of the MBean.
This may be null with the same effect as a zero-length array. attributes, MBeanConstructorInfo[] The list of public constructors of the
MBean. This may be null with the same effect as a zero-length
array. constructors, MBeanOperationInfo[] The list of operations of the MBean. This
may be null with the same effect as a zero-length array. operations, MBeanNotificationInfo[] The list of notifications emitted. This
may be null with the same effect as a zero-length array. notifications)Constructs an |
| public | MBeanInfo(String
The name of the Java class of the MBean described
by this className, String MBeanInfo. This value may be any
syntactically legal Java class name. It does not have to be a
Java class known to the MBean server or to the MBean's
ClassLoader. If it is a Java class known to the MBean's
ClassLoader, it is recommended but not required that the
class's public methods include those that would appear in a
Standard MBean implementing the attributes and operations in
this MBeanInfo.A human readable description of the MBean (optional). description, MBeanAttributeInfo[] The list of exposed attributes of the MBean.
This may be null with the same effect as a zero-length array. attributes, MBeanConstructorInfo[] The list of public constructors of the
MBean. This may be null with the same effect as a zero-length
array. constructors, MBeanOperationInfo[] The list of operations of the MBean. This
may be null with the same effect as a zero-length array. operations, MBeanNotificationInfo[] The list of notifications emitted. This
may be null with the same effect as a zero-length array. notifications, Descriptor The descriptor for the MBean. This may be null
which is equivalent to an empty descriptor. descriptor)Constructs an |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static boolean | arrayGettersSafe(Class<?> subclass, Class<?> immutableClass)
Return true if |
| private static boolean | |
| public Object | |
| public boolean | Returns: true if and only ifo is an MBeanInfo that is equal
to this one according to the rules above.the object to compare to. o)Overrides java. Compare this MBeanInfo to another. |
| private MBeanAttributeInfo[] | |
| private MBeanConstructorInfo[] | |
| private MBeanNotificationInfo[] | |
| private MBeanOperationInfo[] | |
| public MBeanAttributeInfo[] | Returns: An array ofMBeanAttributeInfo objects.Returns the list of attributes exposed for management. |
| public String | Returns: the class name.Returns the name of the Java class of the MBean described by
this |
| public MBeanConstructorInfo[] | Returns: An array ofMBeanConstructorInfo objects.Returns the list of the public constructors of the MBean. |
| public String | |
| public Descriptor | Returns: a descriptor that is either immutable or a copy of the original.Implements javax. Get the descriptor of this MBeanInfo. |
| public MBeanNotificationInfo[] | Returns: An array ofMBeanNotificationInfo objects.Returns the list of the notifications emitted by the MBean. |
| public MBeanOperationInfo[] | Returns: An array ofMBeanOperationInfo objects.Returns the list of operations of the MBean. |
| public int | |
| private static boolean | |
| private MBeanAttributeInfo[] | nonNullAttributes()
Return the value of the attributes field, or an empty array if the field is null. |
| private MBeanConstructorInfo[] | |
| private MBeanNotificationInfo[] | |
| private MBeanOperationInfo[] | |
| private void | |
| public String | |
| private void |
| arrayGettersSafe | back to summary |
|---|---|
| private final transient boolean arrayGettersSafe True if this class is known not to override the array-valued getters of MBeanInfo. Obviously true for MBeanInfo itself, and true for a subclass where we succeed in reflecting on the methods and discover they are not overridden. The purpose of this variable is to avoid cloning the arrays
when doing operations like | |
| arrayGettersSafeMap | back to summary |
|---|---|
| private static final Map<Class<?>, Boolean> arrayGettersSafeMap Cached results of previous calls to arrayGettersSafe. This is a WeakHashMap so that we don't prevent a class from being garbage collected just because we know whether it's immutable. | |
| attributes | back to summary |
|---|---|
| private final MBeanAttributeInfo[] attributes | |
| className | back to summary |
|---|---|
| private final String className | |
| constructors | back to summary |
|---|---|
| private final MBeanConstructorInfo[] constructors | |
| description | back to summary |
|---|---|
| private final String description | |
| descriptor | back to summary |
|---|---|
| private transient Descriptor descriptor | |
| hashCode | back to summary |
|---|---|
| private transient int hashCode | |
| notifications | back to summary |
|---|---|
| private final MBeanNotificationInfo[] notifications | |
| operations | back to summary |
|---|---|
| private final MBeanOperationInfo[] operations | |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID | |
| MBeanInfo | back to summary |
|---|---|
| public MBeanInfo(String className, String description, MBeanAttributeInfo[] attributes, MBeanConstructorInfo[] constructors, MBeanOperationInfo[] operations, MBeanNotificationInfo[] notifications) throws IllegalArgumentException Constructs an
| |
| MBeanInfo | back to summary |
|---|---|
| public MBeanInfo(String className, String description, MBeanAttributeInfo[] attributes, MBeanConstructorInfo[] constructors, MBeanOperationInfo[] operations, MBeanNotificationInfo[] notifications, Descriptor descriptor) throws IllegalArgumentException Constructs an
| |
| arrayGettersSafe | back to summary |
|---|---|
| pack-priv static boolean arrayGettersSafe(Class<?> subclass, Class<?> immutableClass) Return true if
| |
| arrayGettersSafeHelper | back to summary |
|---|---|
| private static boolean arrayGettersSafeHelper(Class<?> subclass, Class<?> immutableClass) | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Returns a shallow clone of this instance.
The clone is obtained by simply calling Since this class is immutable, the clone method is chiefly of interest to subclasses.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Compare this MBeanInfo to another. Two MBeanInfo objects
are equal if and only if they return equal values for If two MBeanInfo objects return the same values in one of their arrays but in a different order then they are not equal. | |
| fastGetAttributes | back to summary |
|---|---|
| private MBeanAttributeInfo[] fastGetAttributes() | |
| fastGetConstructors | back to summary |
|---|---|
| private MBeanConstructorInfo[] fastGetConstructors() | |
| fastGetNotifications | back to summary |
|---|---|
| private MBeanNotificationInfo[] fastGetNotifications() | |
| fastGetOperations | back to summary |
|---|---|
| private MBeanOperationInfo[] fastGetOperations() | |
| getAttributes | back to summary |
|---|---|
| public MBeanAttributeInfo[] getAttributes() Returns the list of attributes exposed for management.
Each attribute is described by an
| |
| getClassName | back to summary |
|---|---|
| public String getClassName() Returns the name of the Java class of the MBean described by
this
| |
| getConstructors | back to summary |
|---|---|
| public MBeanConstructorInfo[] getConstructors() Returns the list of the public constructors of the MBean.
Each constructor is described by an
The returned array is a shallow copy of the internal array,
which means that it is a copy of the internal array of
references to the The returned list is not necessarily exhaustive. That is, the MBean may have a public constructor that is not in the list. In this case, the MBean server can construct another instance of this MBean's class using that constructor, even though it is not listed here.
| |
| getDescription | back to summary |
|---|---|
| public String getDescription() Returns a human readable description of the MBean.
| |
| getDescriptor | back to summary |
|---|---|
| public Descriptor getDescriptor() Implements javax. Get the descriptor of this MBeanInfo. Changing the returned value will have no affect on the original descriptor.
| |
| getNotifications | back to summary |
|---|---|
| public MBeanNotificationInfo[] getNotifications() Returns the list of the notifications emitted by the MBean.
Each notification is described by an
| |
| getOperations | back to summary |
|---|---|
| public MBeanOperationInfo[] getOperations() Returns the list of operations of the MBean.
Each operation is described by an
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isEqual | back to summary |
|---|---|
| private static boolean isEqual(String s1, String s2) | |
| nonNullAttributes | back to summary |
|---|---|
| private MBeanAttributeInfo[] nonNullAttributes() Return the value of the attributes field, or an empty array if the field is null. This can't happen with a normally-constructed instance of this class, but can if the instance was deserialized from another implementation that allows the field to be null. It would be simpler if we enforced the class invariant that these fields cannot be null by writing a readObject() method, but that would require us to define the various array fields as non-final, which is annoying because conceptually they are indeed final. | |
| nonNullConstructors | back to summary |
|---|---|
| private MBeanConstructorInfo[] nonNullConstructors() | |
| nonNullNotifications | back to summary |
|---|---|
| private MBeanNotificationInfo[] nonNullNotifications() | |
| nonNullOperations | back to summary |
|---|---|
| private MBeanOperationInfo[] nonNullOperations() | |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException Deserializes an
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream out) throws IOException Serializes an
| |