Getting Started with the Java Dynamic Management Kit 4.2

Dynamic MBeans

Dynamic MBeans do not have getter and setter methods for each attribute and operation. Instead, they have generic methods for getting or setting an attribute by name, and for invoking operations by name. These methods are common to all dynamic MBeans and defined by the DynamicMBean interface.

The management interface is determined by the set of attribute and operation names to which these methods will respond. The getMBeanInfo method of the DynamicMBean interface must also return a data structure which describes the management interface. This metadata contains the attribute and operation names, their types, and the notifications that may be sent if the MBean is a broadcaster.

Dynamic MBeans provide a simple way to wrap existing Java object which do not follow the design patterns for standard MBeans. They can also be implemented to access non-Java technology based resources by using the Java Native Interface (JNI).

The management interface of a dynamic MBean is static, but this interface is exposed dynamically when the MBean server calls its getMBeanInfo method. The implementation of a dynamic MBean may be quite complex, for example if it determines its own management interface based on existing conditions when it is instantiated.