Why should a Java developer care about JMX?

Andreas Schaefer

There are several reasons to do so:

  1. When a Java developer creates components (JavaBeans) he/she should also provide a way to manage these components because the usage is unknown and the buyer of the component may not know the internals of the component well enough to create a management interface.
  2. An application is mostly a static grouping of components providing the features of the application. This makes it very difficult to add, change or replace components. When the components have a JMX management interface or for short an MBean and these MBeans work together through JMX, a flexible and dynamic application can be build. You can just replace an MBean with another one (also at runtime) and the application can still work.

    As a prime example have a look at JBoss (www.jboss.org). You can add a new or replace an existing DataSource at runtime without bouncing the server.
  3. With proper coding you can enable a JMX application to run 24x7 without the need to bounce the application. JMX enables the coder to create loosely coupled systems because the links between components are established at runtime and this for every call.