JConsole is a valuable tool for obtaining information about interactive and non-interactive applications. MBeans are always present in the JVM - JMX and tools driven by JMX (i.e. JConsole) are just used to harness the information they provide.
MBeans hookup attributes, notifications, and operations. Mustang (Java 6) allows you to connect to any Java process on the local machine, regardless of whether it was started with JMX configuration options.
There is a challenge in connecting the JMX MBeans in the JVM and the runtime objects associated with your application. Example: adjusting a cache size at runtime using JMX. Here are the speaker's identified methods of establishing this connection.
Method 1: Information Grabbing
MBean consults global fields or methods. This is the simplest technique, but violates modularity. If the MBean can see the object it needs, then so can anyone else.
Method 2: Information Shoving
In this case, the cache object registers itself with the JMX server when initialized. The downside is that the cache class becomes "polluted" with JMX-aware code. An additional downside is that registering an MBean of an instance in the class' constructor can lead to race conditions.
Method 3: Quantum Entanglement
Lots of MBeans can become "entangled" whrough their registration mechanisms. This is bad.
Method 4: Dependency Injection
Borrowed from other technologies like the Spring Framework. An XML or similar configuration file can be used to inject the cache object dependency into the MBean. Spring can be used to accomplish this. So can Java 6 (Mustang), which supports dependency injection via annotations.
Method 5: Aspect-Oriented Programming (AOP)
An aspect can be used to link the MBean and cache class instance. This, too, can be accomplished using the AOP capabilities of Spring. The class is modified or augmented from the "outside" to leverage JMX.
All of the solutions featured in the presentation can be run using Mustang, which is available now.
It's important to return snapshot values in container Java Bean objects since it ensures consistency among the container's data elements. It possible that the container's attributes could become discoupled if accessed independently.
A problem that's being addressed by MXBeans is that the container class must be known in advance by the JMX client accessing a container instance. MXBeans were designed for the instrumentation of the VM itself (JSR 174).
JMX Web Services Connector is being defined by JSR 26. Allows clients of JMX agents on non-Java platforms to monitor a Java application while exploting the web platform. It supports SOAP 1.1 over HTTP. It works with non-JMX clients by publishing a WSDL at a known location. It relies on basic authentication and SSL.
An AJAX/JSR 262 demonstration was given that represents a non-Java client running with a JAX stack. It showed how an MBean agent can be accessed using XML Web Services, and the content provided by JMX is displayed and updated in a web browser using AJAX.
In Java 1.7 (?!?) Dolphin, there is a proposed feature that will allow cascading of MBeans through Master-Slave server relationships. This would allow a JMX client to access the master and have access to MBeans residing in slave servers.