This content has been marked as final.
Show 1 reply
-
1. Re: How to register a MXBean (JBoss 6 final)
windigo Jun 9, 2011 8:29 AM (in response to windigo)At the end i used the workaround decribed here.The code-snippet looks like this:
Objectname objectName = new ObjectName("test", "type", Test.class.getSimpleName()); MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); final StandardMBean mxBean = new StandardMBean(new Test(), TestMXBean.class, true); mBeanServer.registerMBean(mxBean, objectName);
The "true" in the StandardMBean-constructor is quite important beacause it marks the MBean as a MXBean.