From ###@###.###:
A named MBeanServer is an MBeanServer that has a name, and can be
searched using that name. Duplicate names are not allowed.
MBeanServerFactory.createNamedMBeanServer(String name, String domain)
MBeanServerFactory.findNamedMBeanServer(String name)
MBeanServerBuilder.newMBeanServer(String name, String domain,
MBeanServer outer, MBeanServerDelegate delegate)
may be added, since they're addition to existing classes (not
interfaces).
About asking the name to an MBeanServer, there may be these choices:
1. Add getName() to MBeanServer interface
2. Add getName() to MBeanServerDelegateMBean interface and
implementation
3. Subclass MBeanServerDelegateMBean adding getName()
4. Add and register a new MBean, similar to the delegate, in the
JMImplementation domain.
Most of the mechanism may be hidden by
MBeanServerFactory.findNamedMBeanServer(String name), though JSR 255 may
be explicit in defining it (for example by mandating one of the above
choices).
This proposal will allow clients to easily distinguish MBeanServers in
case multiple ones are created in a single JVM, and a human user of a
management console to better understand the scope of the MBeanServer.
For example, running Tomcat in J2SE 5 will result in 2 MBeanServer
created, the platform's and Tomcat's.
Programmatically, the only way to distinguish them is to perform some
wild guess on the registered MBeans (yes, one can compare the results of
MBeanServerFactory.findMBeanServer(null) with
ManagementFactory.getPlatformMBeanServer(), but it's not general).
If both are registered with a name, say "platform" and "tomcat", the job
will be much easier.
###@###.### 2005-07-20 10:25:22 GMT