[newbie] Creating MBeanServer differently

Hi, I noticed that if I create a MBeanServer as

MBeanServer server = MBeanServerFactory.createMBeanServer();

I can't see my mbean into the jconsole, even when passing the-Dcom.sun.management.jmxremote property, but I'd see it with an adaptor registered with the MBean server.

In order to see my MBean in the management console, I have to create it with:

MBeanServer server = ManagementFactory.getPlatformMBeanServer();

I'd like your opinion about a possible framework. Would it be ok to get the platform MBean server and register all MBeans with that, or it's better to leave the platform MBean server for JVM stuff and create our own connector for implementation specific MBeans?

Thanks

[744 byte] By [mtedonea] at [2007-11-26 21:59:44]
# 1

Hi,

I'd rather encourage you to use the out-of-the-box management agent and the platform MBeanServer for your application specific MBeans always unless you have strong reasons not to do so.

This will avoid spawning unnecessary JMX connectors and MBeanServers.

Regards,

Luis-Miguel Alventosa

Java SE JMX/JConsole development team

Sun Microsystems, Inc.

lmalventa at 2007-7-10 3:58:55 > top of Java-index,Core,Monitoring & Management...