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