jmxtrans/embedded-jmxtrans — pull request #78 by MartinMulder (2014-04-25 10:05:30+00:00)
Title: Added support for other MBeanServer

Sometimes you need an other MBean server.

For me (JBoss 4.2.3) I have 2 MBean servers in my webapp and ManagementFactory.getPlatformMBeanServer() gives me the last one, but I need the first (to get jboss:jca for example)

My servlet listener fetches the right MBeanServer:
MBeanServer customMBeanServer = MBeanServerFactory.findMBeanServer(null).get(0);

And start embedded-jmxtrans with this server:
embeddedJmxTrans = configurationParser.newEmbeddedJmxTransWithCustomMBeanServer(configurationUrls, customMBeanServer);