As we have mentioned, MBeans are typed components composed by an implementation class and a management interface that is exposed to external applications. As per JMX specifications, standard MBeans do not require implementing any server-specific interface. However, if you want to fully use the JBoss MBeans capabilities, you are strongly encouraged to write MBeans using JBoss service pattern.
Writing JBoss-style MBeans requires implementing the ServiceMBean
interface and extending the ServiceMBeanSupport
base class that provides a set of life cycle operations. The notifications inform an MBean service when it can create, start, stop, and destroy itself.
For example, if you are writing an MBean that needs a JNDI naming service using JBoss service pattern, it's sufficient to establish a dependency between the two services. When the JNDI life cycle interface signals that the service is started, you can safely start up your service too. The same procedure ranges from difficult...