- Managed Bean
In the
JMX API, a managed bean - sometimes simply referred to as an "MBean" - is a type ofJavaBean , created withdependency injection . Managed Beans are particularly used in theJava Management Extensions technology.The MBean represents a resource running in the
Java Virtual Machine such as an application, a J2EE technical service (transactional monitor, JDBC driver, ...), ... They can be used for getting and setting applications configuration (pull), for collecting statistics (pull) (e.g. performance, resources usage, problems, ...) and notifying events (push) (e.g. faults, state changes, ...)MBean Types
There are two basic types of MBean:
* "Standard MBeans" implement a business interface containing setters and getters for the attributes and the operations (i.e., methods).
* "Dynamic MBeans" implement the javax.management.DynamicMBean interface which provides a way to list the attributes and operations, and to get and set the attribute values.Additional types are "Open MBeans", "Model MBeans" and "Monitor MBeans".
"Open MBeans" are dynamic MBeans that rely on the basic data types. They are self-explanatory and more user friendly.
"Model MBeans" are dynamic MBeans that can be configured during runtime. A generic MBean class is also provided for dynamically configuring the resources during program runtime.
MBean Registration
The registration of an MBean in the MBeanServer (i.e., the agent) requires a unique identifier called "ObjectName".The "ObjectName" pattern is composed of two parts. The first one indicates the domain since the second one is a list of name-value pairs. Registered MBeans can be searched using wildcards in the ObjectName (e.g *:type=Memory*)
MBean Notification
An MBean can notify the MBeanServer of its internal changes (for the attributes) by implementing the javax.management.NotificationEmitter. The application interested in the MBean's changes registers a listener (javax.management.NotificationListener) to the MBeanServer.
MXBean
An MXBean ("Platform MBean") is a special type of MBean that reifies
Java Virtual Machine subsystems such as memory pools, garbage collection,multi-threading ,class loading ,JIT compilation , etc.MLet
MLet ("Management applet") is a utility MBean to load, instantiate and register MBeans in the MBeanServer from a
XML description.The format of the XML descriptor is: [cite news | url=http://java.sun.com/j2se/1.5.0/docs/api/javax/management/loading/MLet.html | title=MLet (Java 2 Platform SE 5.0) | publisher=Sun Microsystems | accessdate=2008-06-22][arglist] References
External links
* [http://java.sun.com/j2se/1.5.0/docs/guide/management/overview.html Sun Java Overview of Monitoring and Management]
Wikimedia Foundation. 2010.