ManagementFactory.getPlatformMBeanServer() vs MBeanServerFactory.createMBeanServer()

ManagementFactory.getPlatformMBeanServer() returns a reference to the existing MBean server within the JVM. JConsole looks at the beans on that server.

If you use createMBeanServer(), that will create an entirely new server. JConsole has no knowledge of it, and so will not see the beans registered with it.

posted @ 2011-06-09 14:42  规格严格-功夫到家  阅读(1903)  评论(0编辑  收藏  举报