| java.lang.Object javax.management.StandardMBean
All known Subclasses: mx4j.tools.i18n.I18NStandardMBean, mx4j.monitor.MX4JMonitor,
StandardMBean | public class StandardMBean implements DynamicMBean(Code) | | StandardMBean eases the development of MBeans that have a management interface described
by a java interface, like plain standard MBeans have; differently from a plain standard
MBean, StandardMBean is not tied to the JMX lexical patterns and allows more control on the
customization of the MBeanInfo that describes the MBean (for example it allows to describe
metadata descriptions).
Usage of StandardMBean with a management interface that does not follow the JMX lexical patterns:
public interface Management
{
...
}
public class Service implements Management
{
...
}
Service service = new Service();
StandardMBean mbean = new StandardMBean(service, Management.class);
MBeanServer server = ...;
ObjectName name = ...;
server.registerMBean(mbean, name);
Usage of a subclass of StandardMBean:
public interface Management
{
...
}
public class Service extends StandardMBean implements Management
{
public Service()
{
super(Manegement.class);
}
...
}
Service mbean = new Service();
MBeanServer server = ...;
ObjectName name = ...;
server.registerMBean(mbean, name);
Usage of StandardMBean with a management interface that follows the JMX lexical patterns
(this is similar to plain standard MBeans):
public interface ServiceMBean
{
...
}
public class Service implements ServiceMBean
{
...
}
Service service = new Service();
StandardMBean mbean = new StandardMBean(service, null);
MBeanServer server = ...;
ObjectName name = ...;
server.registerMBean(mbean, name);
version: $Revision: 1.5 $ since: JMX 1.2 |
Constructor Summary | |
public | StandardMBean(Object implementation, Class management) Creates a new StandardMBean. | protected | StandardMBean(Class managementInterface) Creates a new StandardMBean using 'this' as implementation. |
Method Summary | |
protected void | cacheMBeanInfo(MBeanInfo info) Caches the given MBeanInfo after it has been created, by introspection, with the information
provided to constructors. | public Object | getAttribute(String attribute) | public AttributeList | getAttributes(String[] attributes) | protected MBeanInfo | getCachedMBeanInfo() Returns the cached MBeanInfo, or null if the MBeanInfo is not cached. | protected String | getClassName(MBeanInfo info) Returns the class name of this MBean. | protected MBeanConstructorInfo[] | getConstructors(MBeanConstructorInfo[] constructors, Object implementation) Returns, by default, the given constructors if implementation
is 'this' object or null, otherwise returns null. | protected String | getDescription(MBeanInfo info) Returns the description for this MBean. | protected String | getDescription(MBeanFeatureInfo info) Returns the description for the given feature. | protected String | getDescription(MBeanAttributeInfo info) Returns the description for the given attribute. | protected String | getDescription(MBeanConstructorInfo info) Returns the description for the given constructor. | protected String | getDescription(MBeanOperationInfo info) Returns the description for the given operation. | protected String | getDescription(MBeanConstructorInfo constructor, MBeanParameterInfo param, int sequence) Returns the description of the (sequence + 1)th parameter (that is: if sequence is 0 returns the description of the first
parameter, if sequence is 1 returns the description of the second parameter, and so on) for the given constructor. | protected String | getDescription(MBeanOperationInfo operation, MBeanParameterInfo param, int sequence) Returns the description of the (sequence + 1)th parameter (that is: if sequence is 0 returns the description of the first
parameter, if sequence is 1 returns the description of the second parameter, and so on) for the given operation. | protected int | getImpact(MBeanOperationInfo info) Returns the impact flag for the given MBeanOperationInfo. | public Object | getImplementation() | public Class | getImplementationClass() Returns the class of the MBean implementation for this StandardMBean, or 'this' (sub)class if no
implementation was supplied. | public MBeanInfo | getMBeanInfo() See
DynamicMBean.getMBeanInfo . | final public Class | getMBeanInterface() Returns the management interface for this MBean. | protected String | getParameterName(MBeanConstructorInfo constructor, MBeanParameterInfo param, int sequence) Returns the name of the (sequence + 1)th parameter (that is: if sequence is 0 returns the name of the first
parameter, if sequence is 1 returns the name of the second parameter, and so on) for the given constructor. | protected String | getParameterName(MBeanOperationInfo operation, MBeanParameterInfo param, int sequence) Returns the name of the (sequence + 1)th parameter (that is: if sequence is 0 returns the name of the first
parameter, if sequence is 1 returns the name of the second parameter, and so on) for the given operation. | public Object | invoke(String method, Object[] arguments, String[] params) | public void | setAttribute(Attribute attribute) | public AttributeList | setAttributes(AttributeList attributes) | public void | setImplementation(Object implementation) Sets the MBean implementation for this StandardMBean. |
cacheMBeanInfo | protected void cacheMBeanInfo(MBeanInfo info)(Code) | | Caches the given MBeanInfo after it has been created, by introspection, with the information
provided to constructors.
Override to disable caching, or to install different caching policies.
Parameters: info - The MBeanInfo to cache; if it is null, the cache is cleared. See Also: StandardMBean.getCachedMBeanInfo See Also: StandardMBean.getMBeanInfo |
getConstructors | protected MBeanConstructorInfo[] getConstructors(MBeanConstructorInfo[] constructors, Object implementation)(Code) | | Returns, by default, the given constructors if implementation
is 'this' object or null, otherwise returns null.
Since the MBean that is registered in an MBeanServer is always an instance of StandardMBean,
there is no meaning in providing MBeanConstructorInfo if the implementation passed to
StandardMBean.StandardMBean(Object,Class) is not 'this' object.
|
getDescription | protected String getDescription(MBeanConstructorInfo constructor, MBeanParameterInfo param, int sequence)(Code) | | Returns the description of the (sequence + 1)th parameter (that is: if sequence is 0 returns the description of the first
parameter, if sequence is 1 returns the description of the second parameter, and so on) for the given constructor.
By default returns
MBeanParameterInfo.getDescription param.getDescription() .
|
getDescription | protected String getDescription(MBeanOperationInfo operation, MBeanParameterInfo param, int sequence)(Code) | | Returns the description of the (sequence + 1)th parameter (that is: if sequence is 0 returns the description of the first
parameter, if sequence is 1 returns the description of the second parameter, and so on) for the given operation.
By default returns
MBeanParameterInfo.getDescription param.getDescription() .
|
getImplementationClass | public Class getImplementationClass()(Code) | | Returns the class of the MBean implementation for this StandardMBean, or 'this' (sub)class if no
implementation was supplied.
See Also: #StandardMBean(Object,Class)} |
getMBeanInterface | final public Class getMBeanInterface()(Code) | | Returns the management interface for this MBean. This interface is set at creation time and cannot be changed
even if the implementation object can be changed (but it must implement the same interface).
See Also: #StandardMBean(Object,Class)} See Also: StandardMBean.setImplementation |
getParameterName | protected String getParameterName(MBeanConstructorInfo constructor, MBeanParameterInfo param, int sequence)(Code) | | Returns the name of the (sequence + 1)th parameter (that is: if sequence is 0 returns the name of the first
parameter, if sequence is 1 returns the name of the second parameter, and so on) for the given constructor.
By default returns
MBeanParameterInfo.getName param.getName() .
|
getParameterName | protected String getParameterName(MBeanOperationInfo operation, MBeanParameterInfo param, int sequence)(Code) | | Returns the name of the (sequence + 1)th parameter (that is: if sequence is 0 returns the name of the first
parameter, if sequence is 1 returns the name of the second parameter, and so on) for the given operation.
By default returns
MBeanParameterInfo.getName param.getName() .
|
|
|