javax.management
Class StandardMBean

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.management.StandardMBean
All Implemented Interfaces:
DynamicMBean sample code for javax.management.DynamicMBean definition code for javax.management.DynamicMBean

public class StandardMBean
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements DynamicMBean sample code for javax.management.DynamicMBean definition code for javax.management.DynamicMBean

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 sample code for javax.management.MBeanInfo definition code for javax.management.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.

Since:
1.5

Constructor Summary
protected StandardMBean sample code for javax.management.StandardMBean.StandardMBean(java.lang.Class) definition code for javax.management.StandardMBean.StandardMBean(java.lang.Class) (Class sample code for java.lang.Class definition code for java.lang.Class  mbeanInterface)
          Make a DynamicMBean out of this, using the specified mbeanInterface class.
  StandardMBean sample code for javax.management.StandardMBean.StandardMBean(java.lang.Object, java.lang.Class) definition code for javax.management.StandardMBean.StandardMBean(java.lang.Object, java.lang.Class) (Object sample code for java.lang.Object definition code for java.lang.Object  implementation, Class sample code for java.lang.Class definition code for java.lang.Class  mbeanInterface)
          Make a DynamicMBean out of the object implementation, using the specified mbeanInterface class.
 
Method Summary
protected  void cacheMBeanInfo sample code for javax.management.StandardMBean.cacheMBeanInfo(javax.management.MBeanInfo) definition code for javax.management.StandardMBean.cacheMBeanInfo(javax.management.MBeanInfo) (MBeanInfo sample code for javax.management.MBeanInfo definition code for javax.management.MBeanInfo  info)
          Customization hook: cache the MBeanInfo built for this object.
 Object sample code for java.lang.Object definition code for java.lang.Object getAttribute sample code for javax.management.StandardMBean.getAttribute(java.lang.String) definition code for javax.management.StandardMBean.getAttribute(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  attribute)
          Obtain the value of a specific attribute of the Dynamic MBean.
 AttributeList sample code for javax.management.AttributeList definition code for javax.management.AttributeList getAttributes sample code for javax.management.StandardMBean.getAttributes(java.lang.String[]) definition code for javax.management.StandardMBean.getAttributes(java.lang.String[]) (String sample code for java.lang.String definition code for java.lang.String [] attributes)
          Get the values of several attributes of the Dynamic MBean.
protected  MBeanInfo sample code for javax.management.MBeanInfo definition code for javax.management.MBeanInfo getCachedMBeanInfo sample code for javax.management.StandardMBean.getCachedMBeanInfo() definition code for javax.management.StandardMBean.getCachedMBeanInfo() ()
          Customization hook: Return the MBeanInfo cached for this object.
protected  String sample code for java.lang.String definition code for java.lang.String getClassName sample code for javax.management.StandardMBean.getClassName(javax.management.MBeanInfo) definition code for javax.management.StandardMBean.getClassName(javax.management.MBeanInfo) (MBeanInfo sample code for javax.management.MBeanInfo definition code for javax.management.MBeanInfo  info)
          Customization hook: Get the className that will be used in the MBeanInfo returned by this MBean.
protected  MBeanConstructorInfo sample code for javax.management.MBeanConstructorInfo definition code for javax.management.MBeanConstructorInfo [] getConstructors sample code for javax.management.StandardMBean.getConstructors(javax.management.MBeanConstructorInfo[], java.lang.Object) definition code for javax.management.StandardMBean.getConstructors(javax.management.MBeanConstructorInfo[], java.lang.Object) (MBeanConstructorInfo sample code for javax.management.MBeanConstructorInfo definition code for javax.management.MBeanConstructorInfo [] ctors, Object sample code for java.lang.Object definition code for java.lang.Object  impl)
          Customization hook: Get the MBeanConstructorInfo[] that will be used in the MBeanInfo returned by this MBean.
protected  String sample code for java.lang.String definition code for java.lang.String getDescription sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanAttributeInfo) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanAttributeInfo) (MBeanAttributeInfo sample code for javax.management.MBeanAttributeInfo definition code for javax.management.MBeanAttributeInfo  info)
          Customization hook: Get the description that will be used in the MBeanAttributeInfo returned by this MBean.
protected  String sample code for java.lang.String definition code for java.lang.String getDescription sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanConstructorInfo) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanConstructorInfo) (MBeanConstructorInfo sample code for javax.management.MBeanConstructorInfo definition code for javax.management.MBeanConstructorInfo  info)
          Customization hook: Get the description that will be used in the MBeanConstructorInfo returned by this MBean.
protected  String sample code for java.lang.String definition code for java.lang.String getDescription sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanConstructorInfo, javax.management.MBeanParameterInfo, int) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanConstructorInfo, javax.management.MBeanParameterInfo, int) (MBeanConstructorInfo sample code for javax.management.MBeanConstructorInfo definition code for javax.management.MBeanConstructorInfo  ctor, MBeanParameterInfo sample code for javax.management.MBeanParameterInfo definition code for javax.management.MBeanParameterInfo  param, int sequence)
          Customization hook: Get the description that will be used for the sequence MBeanParameterInfo of the MBeanConstructorInfo returned by this MBean.
protected  String sample code for java.lang.String definition code for java.lang.String getDescription sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanFeatureInfo) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanFeatureInfo) (MBeanFeatureInfo sample code for javax.management.MBeanFeatureInfo definition code for javax.management.MBeanFeatureInfo  info)
          Customization hook: Get the description that will be used in the MBeanFeatureInfo returned by this MBean.
protected  String sample code for java.lang.String definition code for java.lang.String getDescription sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanInfo) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanInfo) (MBeanInfo sample code for javax.management.MBeanInfo definition code for javax.management.MBeanInfo  info)
          Customization hook: Get the description that will be used in the MBeanInfo returned by this MBean.
protected  String sample code for java.lang.String definition code for java.lang.String getDescription sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanOperationInfo) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanOperationInfo) (MBeanOperationInfo sample code for javax.management.MBeanOperationInfo definition code for javax.management.MBeanOperationInfo  info)
          Customization hook: Get the description that will be used in the MBeanOperationInfo returned by this MBean.
protected  String sample code for java.lang.String definition code for java.lang.String getDescription sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanOperationInfo, javax.management.MBeanParameterInfo, int) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanOperationInfo, javax.management.MBeanParameterInfo, int) (MBeanOperationInfo sample code for javax.management.MBeanOperationInfo definition code for javax.management.MBeanOperationInfo  op, MBeanParameterInfo sample code for javax.management.MBeanParameterInfo definition code for javax.management.MBeanParameterInfo  param, int sequence)
          Customization hook: Get the description that will be used for the sequence MBeanParameterInfo of the MBeanOperationInfo returned by this MBean.
protected  int getImpact sample code for javax.management.StandardMBean.getImpact(javax.management.MBeanOperationInfo) definition code for javax.management.StandardMBean.getImpact(javax.management.MBeanOperationInfo) (MBeanOperationInfo sample code for javax.management.MBeanOperationInfo definition code for javax.management.MBeanOperationInfo  info)
          Customization hook: Get the impact flag of the operation that will be used in the MBeanOperationInfo returned by this MBean.
 Object sample code for java.lang.Object definition code for java.lang.Object getImplementation sample code for javax.management.StandardMBean.getImplementation() definition code for javax.management.StandardMBean.getImplementation() ()
          Get the implementation of this MBean.
 Class sample code for java.lang.Class definition code for java.lang.Class getImplementationClass sample code for javax.management.StandardMBean.getImplementationClass() definition code for javax.management.StandardMBean.getImplementationClass() ()
          Get the class of the implementation of this MBean.
 MBeanInfo sample code for javax.management.MBeanInfo definition code for javax.management.MBeanInfo getMBeanInfo sample code for javax.management.StandardMBean.getMBeanInfo() definition code for javax.management.StandardMBean.getMBeanInfo() ()
          Get the MBeanInfo sample code for javax.management.MBeanInfo definition code for javax.management.MBeanInfo for this MBean.
 Class sample code for java.lang.Class definition code for java.lang.Class getMBeanInterface sample code for javax.management.StandardMBean.getMBeanInterface() definition code for javax.management.StandardMBean.getMBeanInterface() ()
          Get the Management Interface of this MBean.
protected  String sample code for java.lang.String definition code for java.lang.String getParameterName sample code for javax.management.StandardMBean.getParameterName(javax.management.MBeanConstructorInfo, javax.management.MBeanParameterInfo, int) definition code for javax.management.StandardMBean.getParameterName(javax.management.MBeanConstructorInfo, javax.management.MBeanParameterInfo, int) (MBeanConstructorInfo sample code for javax.management.MBeanConstructorInfo definition code for javax.management.MBeanConstructorInfo  ctor, MBeanParameterInfo sample code for javax.management.MBeanParameterInfo definition code for javax.management.MBeanParameterInfo  param, int sequence)
          Customization hook: Get the name that will be used for the sequence MBeanParameterInfo of the MBeanConstructorInfo returned by this MBean.
protected  String sample code for java.lang.String definition code for java.lang.String getParameterName sample code for javax.management.StandardMBean.getParameterName(javax.management.MBeanOperationInfo, javax.management.MBeanParameterInfo, int) definition code for javax.management.StandardMBean.getParameterName(javax.management.MBeanOperationInfo, javax.management.MBeanParameterInfo, int) (MBeanOperationInfo sample code for javax.management.MBeanOperationInfo definition code for javax.management.MBeanOperationInfo  op, MBeanParameterInfo sample code for javax.management.MBeanParameterInfo definition code for javax.management.MBeanParameterInfo  param, int sequence)
          Customization hook: Get the name that will be used for the sequence MBeanParameterInfo of the MBeanOperationInfo returned by this MBean.
 Object sample code for java.lang.Object definition code for java.lang.Object invoke sample code for javax.management.StandardMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[]) definition code for javax.management.StandardMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[]) (String sample code for java.lang.String definition code for java.lang.String  actionName, Object sample code for java.lang.Object definition code for java.lang.Object [] params, String sample code for java.lang.String definition code for java.lang.String [] signature)
          Allows an action to be invoked on the Dynamic MBean.
 void setAttribute sample code for javax.management.StandardMBean.setAttribute(javax.management.Attribute) definition code for javax.management.StandardMBean.setAttribute(javax.management.Attribute) (Attribute sample code for javax.management.Attribute definition code for javax.management.Attribute  attribute)
          Set the value of a specific attribute of the Dynamic MBean.
 AttributeList sample code for javax.management.AttributeList definition code for javax.management.AttributeList setAttributes sample code for javax.management.StandardMBean.setAttributes(javax.management.AttributeList) definition code for javax.management.StandardMBean.setAttributes(javax.management.AttributeList) (AttributeList sample code for javax.management.AttributeList definition code for javax.management.AttributeList  attributes)
          Sets the values of several attributes of the Dynamic MBean.
 void setImplementation sample code for javax.management.StandardMBean.setImplementation(java.lang.Object) definition code for javax.management.StandardMBean.setImplementation(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  implementation)
          Replace the implementation object wrapped in this object.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

StandardMBean sample code for javax.management.StandardMBean(java.lang.Object, java.lang.Class) definition code for javax.management.StandardMBean(java.lang.Object, java.lang.Class)

public StandardMBean(Object sample code for java.lang.Object definition code for java.lang.Object  implementation,
                     Class sample code for java.lang.Class definition code for java.lang.Class  mbeanInterface)
              throws NotCompliantMBeanException sample code for javax.management.NotCompliantMBeanException definition code for javax.management.NotCompliantMBeanException 

Make a DynamicMBean out of the object implementation, using the specified mbeanInterface class.

Parameters:
implementation - The implementation of this MBean.
mbeanInterface - The Management Interface exported by this MBean's implementation. If null, then this object will use standard JMX design pattern to determine the management interface associated with the given implementation.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the given implementation is null.
NotCompliantMBeanException sample code for javax.management.NotCompliantMBeanException definition code for javax.management.NotCompliantMBeanException - if the mbeanInterface does not follow JMX design patterns for Management Interfaces, or if the given implementation does not implement the specified interface.

StandardMBean sample code for javax.management.StandardMBean(java.lang.Class) definition code for javax.management.StandardMBean(java.lang.Class)

protected StandardMBean(Class sample code for java.lang.Class definition code for java.lang.Class  mbeanInterface)
                 throws NotCompliantMBeanException sample code for javax.management.NotCompliantMBeanException definition code for javax.management.NotCompliantMBeanException 

Make a DynamicMBean out of this, using the specified mbeanInterface class.

Call this(this,mbeanInterface) sample code for javax.management.StandardMBean.StandardMBean(java.lang.Object, java.lang.Class) definition code for javax.management.StandardMBean.StandardMBean(java.lang.Object, java.lang.Class) . This constructor is reserved to subclasses.

Parameters:
mbeanInterface - The Management Interface exported by this MBean.
Throws:
NotCompliantMBeanException sample code for javax.management.NotCompliantMBeanException definition code for javax.management.NotCompliantMBeanException - if the mbeanInterface does not follow JMX design patterns for Management Interfaces, or if this does not implement the specified interface.
Method Detail

setImplementation sample code for javax.management.StandardMBean.setImplementation(java.lang.Object) definition code for javax.management.StandardMBean.setImplementation(java.lang.Object)

public void setImplementation(Object sample code for java.lang.Object definition code for java.lang.Object  implementation)
                       throws NotCompliantMBeanException sample code for javax.management.NotCompliantMBeanException definition code for javax.management.NotCompliantMBeanException 

Replace the implementation object wrapped in this object.

Parameters:
implementation - The new implementation of this MBean. The implementation object must implement the MBean interface that was supplied when this StandardMBean was constructed.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the given implementation is null.
NotCompliantMBeanException sample code for javax.management.NotCompliantMBeanException definition code for javax.management.NotCompliantMBeanException - if the given implementation does not implement the MBean interface that was supplied at construction.
See Also:
getImplementation() sample code for javax.management.StandardMBean.getImplementation() definition code for javax.management.StandardMBean.getImplementation()

getImplementation sample code for javax.management.StandardMBean.getImplementation() definition code for javax.management.StandardMBean.getImplementation()

public Object sample code for java.lang.Object definition code for java.lang.Object  getImplementation()
Get the implementation of this MBean.

Returns:
The implementation of this MBean.
See Also:
setImplementation(java.lang.Object) sample code for javax.management.StandardMBean.setImplementation(java.lang.Object) definition code for javax.management.StandardMBean.setImplementation(java.lang.Object)

getMBeanInterface sample code for javax.management.StandardMBean.getMBeanInterface() definition code for javax.management.StandardMBean.getMBeanInterface()

public final Class sample code for java.lang.Class definition code for java.lang.Class  getMBeanInterface()
Get the Management Interface of this MBean.

Returns:
The management interface of this MBean.

getImplementationClass sample code for javax.management.StandardMBean.getImplementationClass() definition code for javax.management.StandardMBean.getImplementationClass()

public Class sample code for java.lang.Class definition code for java.lang.Class  getImplementationClass()
Get the class of the implementation of this MBean.

Returns:
The class of the implementation of this MBean.

getAttribute sample code for javax.management.StandardMBean.getAttribute(java.lang.String) definition code for javax.management.StandardMBean.getAttribute(java.lang.String)

public Object sample code for java.lang.Object definition code for java.lang.Object  getAttribute(String sample code for java.lang.String definition code for java.lang.String  attribute)
                    throws AttributeNotFoundException sample code for javax.management.AttributeNotFoundException definition code for javax.management.AttributeNotFoundException ,
                           MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                           ReflectionException sample code for javax.management.ReflectionException definition code for javax.management.ReflectionException 
Description copied from interface: DynamicMBean sample code for javax.management.DynamicMBean.getAttribute(java.lang.String) definition code for javax.management.DynamicMBean.getAttribute(java.lang.String)
Obtain the value of a specific attribute of the Dynamic MBean.

Specified by:
getAttribute sample code for javax.management.DynamicMBean.getAttribute(java.lang.String) definition code for javax.management.DynamicMBean.getAttribute(java.lang.String) in interface DynamicMBean sample code for javax.management.DynamicMBean definition code for javax.management.DynamicMBean
Parameters:
attribute - The name of the attribute to be retrieved
Returns:
The value of the attribute retrieved.
Throws:
AttributeNotFoundException sample code for javax.management.AttributeNotFoundException definition code for javax.management.AttributeNotFoundException
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - Wraps a java.lang.Exception thrown by the MBean's getter.
ReflectionException sample code for javax.management.ReflectionException definition code for javax.management.ReflectionException - Wraps a java.lang.Exception thrown while trying to invoke the getter.
See Also:
DynamicMBean.setAttribute(javax.management.Attribute) sample code for javax.management.DynamicMBean.setAttribute(javax.management.Attribute) definition code for javax.management.DynamicMBean.setAttribute(javax.management.Attribute)

setAttribute sample code for javax.management.StandardMBean.setAttribute(javax.management.Attribute) definition code for javax.management.StandardMBean.setAttribute(javax.management.Attribute)

public void setAttribute(Attribute sample code for javax.management.Attribute definition code for javax.management.Attribute  attribute)
                  throws AttributeNotFoundException sample code for javax.management.AttributeNotFoundException definition code for javax.management.AttributeNotFoundException ,
                         InvalidAttributeValueException sample code for javax.management.InvalidAttributeValueException definition code for javax.management.InvalidAttributeValueException ,
                         MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                         ReflectionException sample code for javax.management.ReflectionException definition code for javax.management.ReflectionException 
Description copied from interface: DynamicMBean sample code for javax.management.DynamicMBean.setAttribute(javax.management.Attribute) definition code for javax.management.DynamicMBean.setAttribute(javax.management.Attribute)
Set the value of a specific attribute of the Dynamic MBean.

Specified by:
setAttribute sample code for javax.management.DynamicMBean.setAttribute(javax.management.Attribute) definition code for javax.management.DynamicMBean.setAttribute(javax.management.Attribute) in interface DynamicMBean sample code for javax.management.DynamicMBean definition code for javax.management.DynamicMBean
Parameters:
attribute - The identification of the attribute to be set and the value it is to be set to.
Throws:
AttributeNotFoundException sample code for javax.management.AttributeNotFoundException definition code for javax.management.AttributeNotFoundException
InvalidAttributeValueException sample code for javax.management.InvalidAttributeValueException definition code for javax.management.InvalidAttributeValueException
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - Wraps a java.lang.Exception thrown by the MBean's setter.
ReflectionException sample code for javax.management.ReflectionException definition code for javax.management.ReflectionException - Wraps a java.lang.Exception thrown while trying to invoke the MBean's setter.
See Also:
DynamicMBean.getAttribute(java.lang.String) sample code for javax.management.DynamicMBean.getAttribute(java.lang.String) definition code for javax.management.DynamicMBean.getAttribute(java.lang.String)

getAttributes sample code for javax.management.StandardMBean.getAttributes(java.lang.String[]) definition code for javax.management.StandardMBean.getAttributes(java.lang.String[])

public AttributeList sample code for javax.management.AttributeList definition code for javax.management.AttributeList  getAttributes(String sample code for java.lang.String definition code for java.lang.String [] attributes)
Description copied from interface: DynamicMBean sample code for javax.management.DynamicMBean.getAttributes(java.lang.String[]) definition code for javax.management.DynamicMBean.getAttributes(java.lang.String[])
Get the values of several attributes of the Dynamic MBean.

Specified by:
getAttributes sample code for javax.management.DynamicMBean.getAttributes(java.lang.String[]) definition code for javax.management.DynamicMBean.getAttributes(java.lang.String[]) in interface DynamicMBean sample code for javax.management.DynamicMBean definition code for javax.management.DynamicMBean
Parameters:
attributes - A list of the attributes to be retrieved.
Returns:
The list of attributes retrieved.
See Also:
DynamicMBean.setAttributes(javax.management.AttributeList) sample code for javax.management.DynamicMBean.setAttributes(javax.management.AttributeList) definition code for javax.management.DynamicMBean.setAttributes(javax.management.AttributeList)

setAttributes sample code for javax.management.StandardMBean.setAttributes(javax.management.AttributeList) definition code for javax.management.StandardMBean.setAttributes(javax.management.AttributeList)

public AttributeList sample code for javax.management.AttributeList definition code for javax.management.AttributeList  setAttributes(AttributeList sample code for javax.management.AttributeList definition code for javax.management.AttributeList  attributes)
Description copied from interface: DynamicMBean sample code for javax.management.DynamicMBean.setAttributes(javax.management.AttributeList) definition code for javax.management.DynamicMBean.setAttributes(javax.management.AttributeList)
Sets the values of several attributes of the Dynamic MBean.

Specified by:
setAttributes sample code for javax.management.DynamicMBean.setAttributes(javax.management.AttributeList) definition code for javax.management.DynamicMBean.setAttributes(javax.management.AttributeList) in interface DynamicMBean sample code for javax.management.DynamicMBean definition code for javax.management.DynamicMBean
Parameters:
attributes - A list of attributes: The identification of the attributes to be set and the values they are to be set to.
Returns:
The list of attributes that were set, with their new values.
See Also:
DynamicMBean.getAttributes(java.lang.String[]) sample code for javax.management.DynamicMBean.getAttributes(java.lang.String[]) definition code for javax.management.DynamicMBean.getAttributes(java.lang.String[])

invoke sample code for javax.management.StandardMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[]) definition code for javax.management.StandardMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[])

public Object sample code for java.lang.Object definition code for java.lang.Object  invoke(String sample code for java.lang.String definition code for java.lang.String  actionName,
                     Object sample code for java.lang.Object definition code for java.lang.Object [] params,
                     String sample code for java.lang.String definition code for java.lang.String [] signature)
              throws MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException ,
                     ReflectionException sample code for javax.management.ReflectionException definition code for javax.management.ReflectionException 
Description copied from interface: DynamicMBean sample code for javax.management.DynamicMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[]) definition code for javax.management.DynamicMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[])
Allows an action to be invoked on the Dynamic MBean.

Specified by:
invoke sample code for javax.management.DynamicMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[]) definition code for javax.management.DynamicMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[]) in interface DynamicMBean sample code for javax.management.DynamicMBean definition code for javax.management.DynamicMBean
Parameters:
actionName - The name of the action to be invoked.
params - An array containing the parameters to be set when the action is invoked.
signature - An array containing the signature of the action. The class objects will be loaded through the same class loader as the one used for loading the MBean on which the action is invoked.
Returns:
The object returned by the action, which represents the result of invoking the action on the MBean specified.
Throws:
MBeanException sample code for javax.management.MBeanException definition code for javax.management.MBeanException - Wraps a java.lang.Exception thrown by the MBean's invoked method.
ReflectionException sample code for javax.management.ReflectionException definition code for javax.management.ReflectionException - Wraps a java.lang.Exception thrown while trying to invoke the method

getMBeanInfo sample code for javax.management.StandardMBean.getMBeanInfo() definition code for javax.management.StandardMBean.getMBeanInfo()

public MBeanInfo sample code for javax.management.MBeanInfo definition code for javax.management.MBeanInfo  getMBeanInfo()
Get the MBeanInfo sample code for javax.management.MBeanInfo definition code for javax.management.MBeanInfo for this MBean.

This method implements DynamicMBean.getMBeanInfo() sample code for javax.management.DynamicMBean.getMBeanInfo() definition code for javax.management.DynamicMBean.getMBeanInfo() .

This method first calls getCachedMBeanInfo() sample code for javax.management.StandardMBean.getCachedMBeanInfo() definition code for javax.management.StandardMBean.getCachedMBeanInfo() in order to retrieve the cached MBeanInfo for this MBean, if any. If the MBeanInfo returned by getCachedMBeanInfo() sample code for javax.management.StandardMBean.getCachedMBeanInfo() definition code for javax.management.StandardMBean.getCachedMBeanInfo() is not null, then it is returned.
Otherwise, this method builds a default MBeanInfo for this MBean, using the Management Interface specified for this MBean.

While building the MBeanInfo, this method calls the customization hooks that make it possible for subclasses to supply their custom descriptions, parameter names, etc...
Finally, it calls cacheMBeanInfo() sample code for javax.management.StandardMBean.cacheMBeanInfo(javax.management.MBeanInfo) definition code for javax.management.StandardMBean.cacheMBeanInfo(javax.management.MBeanInfo) in order to cache the new MBeanInfo.

Specified by:
getMBeanInfo sample code for javax.management.DynamicMBean.getMBeanInfo() definition code for javax.management.DynamicMBean.getMBeanInfo() in interface DynamicMBean sample code for javax.management.DynamicMBean definition code for javax.management.DynamicMBean
Returns:
The cached MBeanInfo for that MBean, if not null, or a newly built MBeanInfo if none was cached.

getClassName sample code for javax.management.StandardMBean.getClassName(javax.management.MBeanInfo) definition code for javax.management.StandardMBean.getClassName(javax.management.MBeanInfo)

protected String sample code for java.lang.String definition code for java.lang.String  getClassName(MBeanInfo sample code for javax.management.MBeanInfo definition code for javax.management.MBeanInfo  info)
Customization hook: Get the className that will be used in the MBeanInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom class name. The default implementation returns info.getClassName() sample code for javax.management.MBeanInfo.getClassName() definition code for javax.management.MBeanInfo.getClassName() .

Parameters:
info - The default MBeanInfo derived by reflection.
Returns:
the class name for the new MBeanInfo.

getDescription sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanInfo) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanInfo)

protected String sample code for java.lang.String definition code for java.lang.String  getDescription(MBeanInfo sample code for javax.management.MBeanInfo definition code for javax.management.MBeanInfo  info)
Customization hook: Get the description that will be used in the MBeanInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom MBean description. The default implementation returns info.getDescription() sample code for javax.management.MBeanInfo.getDescription() definition code for javax.management.MBeanInfo.getDescription() .

Parameters:
info - The default MBeanInfo derived by reflection.
Returns:
the description for the new MBeanInfo.

getDescription sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanFeatureInfo) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanFeatureInfo)

protected String sample code for java.lang.String definition code for java.lang.String  getDescription(MBeanFeatureInfo sample code for javax.management.MBeanFeatureInfo definition code for javax.management.MBeanFeatureInfo  info)

Customization hook: Get the description that will be used in the MBeanFeatureInfo returned by this MBean.

Subclasses may redefine this method in order to supply their custom description. The default implementation returns info.getDescription() sample code for javax.management.MBeanFeatureInfo.getDescription() definition code for javax.management.MBeanFeatureInfo.getDescription() .

This method is called by getDescription(MBeanAttributeInfo) sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanAttributeInfo) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanAttributeInfo) , getDescription(MBeanOperationInfo) sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanOperationInfo) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanOperationInfo) , getDescription(MBeanConstructorInfo) sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanConstructorInfo) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanConstructorInfo) .

Parameters:
info - The default MBeanFeatureInfo derived by reflection.
Returns:
the description for the given MBeanFeatureInfo.

getDescription sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanAttributeInfo) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanAttributeInfo)

protected String sample code for java.lang.String definition code for java.lang.String  getDescription(MBeanAttributeInfo sample code for javax.management.MBeanAttributeInfo definition code for javax.management.MBeanAttributeInfo  info)
Customization hook: Get the description that will be used in the MBeanAttributeInfo returned by this MBean.

Subclasses may redefine this method in order to supply their custom description. The default implementation returns getDescription((MBeanFeatureInfo) info) sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanFeatureInfo) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanFeatureInfo) .

Parameters:
info - The default MBeanAttributeInfo derived by reflection.
Returns:
the description for the given MBeanAttributeInfo.

getDescription sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanConstructorInfo) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanConstructorInfo)

protected String sample code for java.lang.String definition code for java.lang.String  getDescription(MBeanConstructorInfo sample code for javax.management.MBeanConstructorInfo definition code for javax.management.MBeanConstructorInfo  info)
Customization hook: Get the description that will be used in the MBeanConstructorInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom description. The default implementation returns getDescription((MBeanFeatureInfo) info) sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanFeatureInfo) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanFeatureInfo) .

Parameters:
info - The default MBeanConstructorInfo derived by reflection.
Returns:
the description for the given MBeanConstructorInfo.

getDescription sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanConstructorInfo, javax.management.MBeanParameterInfo, int) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanConstructorInfo, javax.management.MBeanParameterInfo, int)

protected String sample code for java.lang.String definition code for java.lang.String  getDescription(MBeanConstructorInfo sample code for javax.management.MBeanConstructorInfo definition code for javax.management.MBeanConstructorInfo  ctor,
                                MBeanParameterInfo sample code for javax.management.MBeanParameterInfo definition code for javax.management.MBeanParameterInfo  param,
                                int sequence)
Customization hook: Get the description that will be used for the sequence MBeanParameterInfo of the MBeanConstructorInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom description. The default implementation returns param.getDescription() sample code for javax.management.MBeanFeatureInfo.getDescription() definition code for javax.management.MBeanFeatureInfo.getDescription() .

Parameters:
ctor - The default MBeanConstructorInfo derived by reflection.
param - The default MBeanParameterInfo derived by reflection.
sequence - The sequence number of the parameter considered ("0" for the first parameter, "1" for the second parameter, etc...).
Returns:
the description for the given MBeanParameterInfo.

getParameterName sample code for javax.management.StandardMBean.getParameterName(javax.management.MBeanConstructorInfo, javax.management.MBeanParameterInfo, int) definition code for javax.management.StandardMBean.getParameterName(javax.management.MBeanConstructorInfo, javax.management.MBeanParameterInfo, int)

protected String sample code for java.lang.String definition code for java.lang.String  getParameterName(MBeanConstructorInfo sample code for javax.management.MBeanConstructorInfo definition code for javax.management.MBeanConstructorInfo  ctor,
                                  MBeanParameterInfo sample code for javax.management.MBeanParameterInfo definition code for javax.management.MBeanParameterInfo  param,
                                  int sequence)
Customization hook: Get the name that will be used for the sequence MBeanParameterInfo of the MBeanConstructorInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom parameter name. The default implementation returns param.getName() sample code for javax.management.MBeanFeatureInfo.getName() definition code for javax.management.MBeanFeatureInfo.getName() .

Parameters:
ctor - The default MBeanConstructorInfo derived by reflection.
param - The default MBeanParameterInfo derived by reflection.
sequence - The sequence number of the parameter considered ("0" for the first parameter, "1" for the second parameter, etc...).
Returns:
the name for the given MBeanParameterInfo.

getDescription sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanOperationInfo) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanOperationInfo)

protected String sample code for java.lang.String definition code for java.lang.String  getDescription(MBeanOperationInfo sample code for javax.management.MBeanOperationInfo definition code for javax.management.MBeanOperationInfo  info)
Customization hook: Get the description that will be used in the MBeanOperationInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom description. The default implementation returns getDescription((MBeanFeatureInfo) info) sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanFeatureInfo) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanFeatureInfo) .

Parameters:
info - The default MBeanOperationInfo derived by reflection.
Returns:
the description for the given MBeanOperationInfo.

getImpact sample code for javax.management.StandardMBean.getImpact(javax.management.MBeanOperationInfo) definition code for javax.management.StandardMBean.getImpact(javax.management.MBeanOperationInfo)

protected int getImpact(MBeanOperationInfo sample code for javax.management.MBeanOperationInfo definition code for javax.management.MBeanOperationInfo  info)
Customization hook: Get the impact flag of the operation that will be used in the MBeanOperationInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom impact flag. The default implementation returns info.getImpact() sample code for javax.management.MBeanOperationInfo.getImpact() definition code for javax.management.MBeanOperationInfo.getImpact() .

Parameters:
info - The default MBeanOperationInfo derived by reflection.
Returns:
the impact flag for the given MBeanOperationInfo.

getParameterName sample code for javax.management.StandardMBean.getParameterName(javax.management.MBeanOperationInfo, javax.management.MBeanParameterInfo, int) definition code for javax.management.StandardMBean.getParameterName(javax.management.MBeanOperationInfo, javax.management.MBeanParameterInfo, int)

protected String sample code for java.lang.String definition code for java.lang.String  getParameterName(MBeanOperationInfo sample code for javax.management.MBeanOperationInfo definition code for javax.management.MBeanOperationInfo  op,
                                  MBeanParameterInfo sample code for javax.management.MBeanParameterInfo definition code for javax.management.MBeanParameterInfo  param,
                                  int sequence)
Customization hook: Get the name that will be used for the sequence MBeanParameterInfo of the MBeanOperationInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom parameter name. The default implementation returns param.getName() sample code for javax.management.MBeanFeatureInfo.getName() definition code for javax.management.MBeanFeatureInfo.getName() .

Parameters:
op - The default MBeanOperationInfo derived by reflection.
param - The default MBeanParameterInfo derived by reflection.
sequence - The sequence number of the parameter considered ("0" for the first parameter, "1" for the second parameter, etc...).
Returns:
the name to use for the given MBeanParameterInfo.

getDescription sample code for javax.management.StandardMBean.getDescription(javax.management.MBeanOperationInfo, javax.management.MBeanParameterInfo, int) definition code for javax.management.StandardMBean.getDescription(javax.management.MBeanOperationInfo, javax.management.MBeanParameterInfo, int)

protected String sample code for java.lang.String definition code for java.lang.String  getDescription(MBeanOperationInfo sample code for javax.management.MBeanOperationInfo definition code for javax.management.MBeanOperationInfo  op,
                                MBeanParameterInfo sample code for javax.management.MBeanParameterInfo definition code for javax.management.MBeanParameterInfo  param,
                                int sequence)
Customization hook: Get the description that will be used for the sequence MBeanParameterInfo of the MBeanOperationInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom description. The default implementation returns param.getDescription() sample code for javax.management.MBeanFeatureInfo.getDescription() definition code for javax.management.MBeanFeatureInfo.getDescription() .

Parameters:
op - The default MBeanOperationInfo derived by reflection.
param - The default MBeanParameterInfo derived by reflection.
sequence - The sequence number of the parameter considered ("0" for the first parameter, "1" for the second parameter, etc...).
Returns:
the description for the given MBeanParameterInfo.

getConstructors sample code for javax.management.StandardMBean.getConstructors(javax.management.MBeanConstructorInfo[], java.lang.Object) definition code for javax.management.StandardMBean.getConstructors(javax.management.MBeanConstructorInfo[], java.lang.Object)

protected MBeanConstructorInfo sample code for javax.management.MBeanConstructorInfo definition code for javax.management.MBeanConstructorInfo [] getConstructors(MBeanConstructorInfo sample code for javax.management.MBeanConstructorInfo definition code for javax.management.MBeanConstructorInfo [] ctors,
                                                 Object sample code for java.lang.Object definition code for java.lang.Object  impl)
Customization hook: Get the MBeanConstructorInfo[] that will be used in the MBeanInfo returned by this MBean.
By default, this method returns null if the wrapped implementation is not this. Indeed, if the wrapped implementation is not this object itself, it will not be possible to recreate a wrapped implementation by calling the implementation constructors through MBeanServer.createMBean(...).
Otherwise, if the wrapped implementation is this, ctors is returned.
Subclasses may redefine this method in order to modify this behavior, if needed.

Parameters:
ctors - The default MBeanConstructorInfo[] derived by reflection.
impl - The wrapped implementation. If null is passed, the wrapped implementation is ignored and ctors is returned.
Returns:
the MBeanConstructorInfo[] for the new MBeanInfo.

getCachedMBeanInfo sample code for javax.management.StandardMBean.getCachedMBeanInfo() definition code for javax.management.StandardMBean.getCachedMBeanInfo()

protected MBeanInfo sample code for javax.management.MBeanInfo definition code for javax.management.MBeanInfo  getCachedMBeanInfo()
Customization hook: Return the MBeanInfo cached for this object.

Subclasses may redefine this method in order to implement their own caching policy. The default implementation stores one MBeanInfo sample code for javax.management.MBeanInfo definition code for javax.management.MBeanInfo object per instance.

Returns:
The cached MBeanInfo, or null if no MBeanInfo is cached.
See Also:
cacheMBeanInfo(MBeanInfo) sample code for javax.management.StandardMBean.cacheMBeanInfo(javax.management.MBeanInfo) definition code for javax.management.StandardMBean.cacheMBeanInfo(javax.management.MBeanInfo)

cacheMBeanInfo sample code for javax.management.StandardMBean.cacheMBeanInfo(javax.management.MBeanInfo) definition code for javax.management.StandardMBean.cacheMBeanInfo(javax.management.MBeanInfo)

protected void cacheMBeanInfo(MBeanInfo sample code for javax.management.MBeanInfo definition code for javax.management.MBeanInfo  info)
Customization hook: cache the MBeanInfo built for this object.

Subclasses may redefine this method in order to implement their own caching policy. The default implementation stores info in this instance. A subclass can define other policies, such as not saving info (so it is reconstructed every time getMBeanInfo() sample code for javax.management.StandardMBean.getMBeanInfo() definition code for javax.management.StandardMBean.getMBeanInfo() is called) or sharing a unique MBeanInfo sample code for javax.management.MBeanInfo definition code for javax.management.MBeanInfo object when several StandardMBean instances have equal MBeanInfo sample code for javax.management.MBeanInfo definition code for javax.management.MBeanInfo values.

Parameters:
info - the new MBeanInfo to cache. Any previously cached value is discarded. This parameter may be null, in which case there is no new cached value.