StandardMBean (Java SE 16 & JDK 16) (original) (raw)

All Implemented Interfaces:

[DynamicMBean](DynamicMBean.html "interface in javax.management"), [MBeanRegistration](MBeanRegistration.html "interface in javax.management")

Direct Known Subclasses:

[StandardEmitterMBean](StandardEmitterMBean.html "class in javax.management")


An MBean whose management interface is determined by reflection on a Java interface.

This class brings more flexibility to the notion of Management Interface in the use of Standard MBeans. Straightforward use of the patterns for Standard MBeans described in the JMX Specification means that there is a fixed relationship between the implementation class of an MBean and its management interface (i.e., if the implementation class is Thing, the management interface must be ThingMBean). This class makes it possible to keep the convenience of specifying the management interface with a Java interface, without requiring that there be any naming relationship between the implementation and interface classes.

By making a DynamicMBean out of an MBean, this class makes it possible to select any interface implemented by the MBean as its management interface, provided that it complies with JMX patterns (i.e., attributes defined by getter/setter etc...).

This class also provides hooks that make it possible to supply custom descriptions and names for the MBeanInfo returned by the DynamicMBean interface.

Using this class, an MBean can be created with any implementation class name Impl and with a management interface defined (as for current Standard MBeans) by any interface_Intf_, in one of two general ways:

In either case, the class Impl must implement the interface Intf.

Standard MBeans based on the naming relationship between implementation and interface classes are of course still available.

This class may also be used to construct MXBeans. The usage is exactly the same as for Standard MBeans except that in the examples above, the false parameter to the constructor orsuper(...) invocation is instead true.

Since:

1.5

Constructors
protected
[StandardMBean](#%3Cinit%3E%28java.lang.Class%29)​([Class](../../../java.base/java/lang/Class.html "class in java.lang")<?> mbeanInterface)
Make a DynamicMBean out of this, using the specifiedmbeanInterface class.
protected
[StandardMBean](#%3Cinit%3E%28java.lang.Class,boolean%29)​([Class](../../../java.base/java/lang/Class.html "class in java.lang")<?> mbeanInterface, boolean isMXBean)
Make a DynamicMBean out of this, using the specifiedmbeanInterface class, and choosing whether the resulting MBean is an MXBean.
[StandardMBean](#%3Cinit%3E%28T,java.lang.Class%29)​(T implementation,[Class](../../../java.base/java/lang/Class.html "class in java.lang")<T> mbeanInterface)
Make a DynamicMBean out of the objectimplementation, using the specifiedmbeanInterface class.
[StandardMBean](#%3Cinit%3E%28T,java.lang.Class,boolean%29)​(T implementation,[Class](../../../java.base/java/lang/Class.html "class in java.lang")<T> mbeanInterface, boolean isMXBean)
Make a DynamicMBean out of the objectimplementation, using the specifiedmbeanInterface class, and choosing whether the resultant MBean is an MXBean.

protected void
Customization hook: cache the MBeanInfo built for this object.
Obtain the value of a specific attribute of the Dynamic MBean.
Get the values of several attributes of the Dynamic MBean.
Customization hook: Return the MBeanInfo cached for this object.
Customization hook: Get the className that will be used in the MBeanInfo returned by this MBean.
Customization hook: Get the MBeanConstructorInfo[] that will be used in the MBeanInfo returned by this MBean.
Customization hook: Get the description that will be used in the MBeanAttributeInfo returned by this MBean.
Customization hook: Get the description that will be used in the MBeanConstructorInfo returned by this MBean.
Customization hook: Get the description that will be used for the sequence MBeanParameterInfo of the MBeanConstructorInfo returned by this MBean.
Customization hook: Get the description that will be used in the MBeanFeatureInfo returned by this MBean.
Customization hook: Get the description that will be used in the MBeanInfo returned by this MBean.
Customization hook: Get the description that will be used in the MBeanOperationInfo returned by this MBean.
Customization hook: Get the description that will be used for the sequence MBeanParameterInfo of the MBeanOperationInfo returned by this MBean.
protected int
Customization hook: Get the impact flag of the operation that will be used in the MBeanOperationInfo returned by this MBean.
Get the implementation of this Standard MBean (or MXBean).
Get the class of the implementation of this Standard MBean (or MXBean).
Get the Management Interface of this Standard MBean (or MXBean).
Customization hook: Get the name that will be used for the sequence MBeanParameterInfo of the MBeanConstructorInfo returned by this MBean.
Customization hook: Get the name that will be used for the sequence MBeanParameterInfo of the MBeanOperationInfo returned by this MBean.
Allows an action to be invoked on the Dynamic MBean.
void
Allows the MBean to perform any operations needed after having been unregistered in the MBean server.
void
Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed.
void
Allows the MBean to perform any operations it needs before being unregistered by the MBean server.
Allows the MBean to perform any operations it needs before being registered in the MBean server.
void
Set the value of a specific attribute of the Dynamic MBean.
Sets the values of several attributes of the Dynamic MBean.
void
Replace the implementation object wrapped in this object.

Methods declared in class java.lang.Object

[clone](../../../java.base/java/lang/Object.html#clone%28%29), [equals](../../../java.base/java/lang/Object.html#equals%28java.lang.Object%29), [finalize](../../../java.base/java/lang/Object.html#finalize%28%29), [getClass](../../../java.base/java/lang/Object.html#getClass%28%29), [hashCode](../../../java.base/java/lang/Object.html#hashCode%28%29), [notify](../../../java.base/java/lang/Object.html#notify%28%29), [notifyAll](../../../java.base/java/lang/Object.html#notifyAll%28%29), [toString](../../../java.base/java/lang/Object.html#toString%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28long%29), [wait](../../../java.base/java/lang/Object.html#wait%28long,int%29)