Java Management Extensions - Managed Bean

A managed bean - sometimes simply referred to as an MBean - is a type of JavaBean, created with dependency injection. Managed Beans are particularly used in the Java Management Extensions technology. But with Java EE 6, the specification provides for a more detailed meaning of a managed bean.

The MBean represents a resource running in the Java virtual machine, such as an application or a Java EE technical service (transactional monitor, JDBC driver, etc.). They can be used for collecting statistics on concerns like performance, resources usage, or problems (pull); for getting and setting application configurations or properties (push/pull); and notifying events like faults or state changes (push).

Java EE 6 provides that a managed bean is a bean that is implemented by a Java class, which is called its bean class. A top-level Java class is a managed bean if it is defined to be a managed bean by any other Java EE technology specification (for example, the JavaServer Faces technology specification), or if it meets all of the following conditions:

  1. It is not a non-static inner class.
  2. It is a concrete class, or is annotated @Decorator.
  3. It is not annotated with an EJB component-defining annotation or declared as an EJB bean class in ejb-jar.xml.

No special declaration, such as an annotation, is required to define a managed bean.

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. Note that JMX does not guarantee that all notifications will be received by the listeners.

Read more about this topic:  Java Management Extensions

Famous quotes containing the word managed:

    Writing, when properly managed ... is but a different name for conversation: As no one ... would venture to talk all;Mso no author, who understands the just boundaries of decorum and good breeding, would presume to think all: The truest respect which you can pay to the reader’s understanding, is to ... leave him something to imagine, in his turn, as well as yourself.
    Laurence Sterne (1713–1768)