| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
MBeanServer server = …;
ObjectName name = …;
MBeanInfo info = server.getMBeanInfo(name);
Based on 17 examples
public class MBeanInfo extends Object implements Cloneable, Serializable, DescriptorRead
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.
The contents of the MBeanInfo
for a Dynamic MBean
are determined by its {@link DynamicMBean#getMBeanInfo
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:
getName
, isName
, or
setName
method that conforms to the conventions
for Standard MBeans;
The description returned by {@link #getDescription()} and the descriptions of the contained attributes and operations are determined by the corresponding Description annotations if any; otherwise their contents 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.
Constructor Summary | |
---|---|
MBeanInfo(String className, String description, MBeanAttributeInfo[] attributes, MBeanConstructorInfo[] constructors, MBeanOperationInfo[] operations, MBeanNotificationInfo[] notifications) Constructs an MBeanInfo .
|
|
MBeanInfo(String className, String description, MBeanAttributeInfo[] attributes, MBeanConstructorInfo[] constructors, MBeanOperationInfo[] operations, MBeanNotificationInfo[] notifications, Descriptor descriptor) Constructs an MBeanInfo .
|
Method Summary | |
---|---|
Object |
clone() Returns a shallow clone of this instance. |
boolean |
Compare this MBeanInfo to another. |
MBeanAttributeInfo[] |
Returns the list of attributes exposed for management. |
String |
Returns the name of the Java class of the MBean described by this MBeanInfo .
|
MBeanConstructorInfo[] |
Returns the list of the public constructors of the MBean. |
String |
Returns a human readable description of the MBean. |
Descriptor |
Get the descriptor of this MBeanInfo. |
MBeanNotificationInfo[] |
Returns the list of the notifications emitted by the MBean. |
MBeanOperationInfo[] |
Returns the list of operations of the MBean. |
int |
hashCode() Returns a hash code value for the object. |
String |
toString() Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MBeanInfo(String className, String description, MBeanAttributeInfo[] attributes, MBeanConstructorInfo[] constructors, MBeanOperationInfo[] operations, MBeanNotificationInfo[] notifications) throws IllegalArgumentException
MBeanInfo
.
className
- The name of the Java class of the MBean described
by this 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.description
- A human readable description of the MBean (optional).attributes
- The list of exposed attributes of the MBean.
This may be null with the same effect as a zero-length array.constructors
- The list of public constructors of the
MBean. This may be null with the same effect as a zero-length
array.operations
- The list of operations of the MBean. This
may be null with the same effect as a zero-length array.notifications
- The list of notifications emitted. This
may be null with the same effect as a zero-length array.IllegalArgumentException
public MBeanInfo(String className, String description, MBeanAttributeInfo[] attributes, MBeanConstructorInfo[] constructors, MBeanOperationInfo[] operations, MBeanNotificationInfo[] notifications, Descriptor descriptor) throws IllegalArgumentException
MBeanInfo
.
className
- The name of the Java class of the MBean described
by this 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.description
- A human readable description of the MBean (optional).attributes
- The list of exposed attributes of the MBean.
This may be null with the same effect as a zero-length array.constructors
- The list of public constructors of the
MBean. This may be null with the same effect as a zero-length
array.operations
- The list of operations of the MBean. This
may be null with the same effect as a zero-length array.notifications
- The list of notifications emitted. This
may be null with the same effect as a zero-length array.descriptor
- The descriptor for the MBean. This may be null
which is equivalent to an empty descriptor.IllegalArgumentException
Method Detail |
---|
public Object clone()
Returns a shallow clone of this instance. The clone is obtained by simply calling super.clone(), thus calling the default native shallow cloning mechanism implemented by Object.clone(). No deeper cloning of any internal field is made.
Since this class is immutable, the clone method is chiefly of interest to subclasses.
clone
in class Object
public boolean equals(Object o)
Compare this MBeanInfo to another. Two MBeanInfo objects are equal if and only if they return equal values for {@link #getClassName()}, for {@link #getDescription()}, and for {@link #getDescriptor()}, and the arrays returned by the two objects for {@link #getAttributes()}, {@link #getOperations()}, {@link #getConstructors()}, and {@link #getNotifications()} are pairwise equal. Here "equal" means {@link Object#equals(Object)}, not identity.
If two MBeanInfo objects return the same values in one of their arrays but in a different order then they are not equal.
equals
in class Object
o
- the object to compare to.o
is an MBeanInfo that is equal
to this one according to the rules above.public MBeanAttributeInfo[] getAttributes()
MBeanAttributeInfo
object.
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 MBeanAttributeInfo
objects
but that each referenced MBeanAttributeInfo
object is not copied.
MBeanAttributeInfo
objects.public String getClassName()
MBeanInfo
.
public MBeanConstructorInfo[] getConstructors()
Returns the list of the public constructors of the MBean.
Each constructor is described by an
MBeanConstructorInfo
object.
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 MBeanConstructorInfo
objects but
that each referenced MBeanConstructorInfo
object
is not copied.
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.
MBeanConstructorInfo
objects.public String getDescription()
public Descriptor getDescriptor()
public MBeanNotificationInfo[] getNotifications()
MBeanNotificationInfo
object.
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 MBeanNotificationInfo
objects
but that each referenced MBeanNotificationInfo
object is not copied.
MBeanNotificationInfo
objects.public MBeanOperationInfo[] getOperations()
MBeanOperationInfo
object.
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 MBeanOperationInfo
objects
but that each referenced MBeanOperationInfo
object is not copied.
MBeanOperationInfo
objects.public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |