The JMX Namespace feature has now been integratedinto the JDK 7 platform. You can read about it in detail in the online documentation for javax.management.namespace. Here's my quick summary.

Namespaces add a hierarchical structure to the JMX naming scheme. The easiest way to think of this is as a directory hierarchy. Previously JMX MBeans had names likejava.lang:type=ThreadMXBean. Those names are still legal, but there can now also be names like othervm//java.lang:type=ThreadMXBean.

The othervm "directory" is a JMXNamespace. You create it by registering aJMXNamespace MBean with the special nameothervm//:type=JMXNamespace. You specify its contents via the sourceServer argument to theJMXNamespace constructor.

There are three typical use cases for namespaces. First, if you have more than one MBean Server in the same Java VM (for example, it is an app server, and you have one MBean Server per deployed app), then you can group them all together in a higher-level MBean Server. Second, if you have MBean Servers distributed across different Java VMs (maybe on different machines), then again you can group them together into a "master" MBean Server. Then clients can access the different MBean Servers without having to connect to each one directly. Finally, namespaces support "Virtual MBeans", which do not exist as Java objects except while they are being accessed.

There's much more to namespaces than I've described here. Daniel Fuchs is the engineer who did most of the design and implementation work on namespaces, and I expect he will have more to say about them in the near future on his blog.

[Tags: jmx jdk7 jsr255]