MBeans { public static List<MBeanNode> getAllMBeanNodes() throws JMException { initJRockitMBeansIfNeeded(); final List<MBeanNode> result = new ArrayList<MBeanNode>(); final MBeanServer platformMBeanServer = getPlatformMBeanServer(); final MBeanNode platformNode = new MBeanNode(""); final MBeans platformMBeans = new MBeans(); platformNode.getChildren().addAll(platformMBeans.getMBeanNodes()); result.add(platformNode); for (final MBeanServer mbeanServer : getMBeanServers()) { if (!mbeanServer.equals(platformMBeanServer)) { final MBeanNode node = new MBeanNode(mbeanServer.getDefaultDomain()); final MBeans mbeans = new MBeans(mbeanServer); node.getChildren().addAll(mbeans.getMBeanNodes()); result.add(node); } } return result; } MBeans(); private  MBeans(MBeanServer mbeanServer); static List<MBeanNode> getAllMBeanNodes(); static String getConvertedAttributes(String jmxValueParameter); static MBeanServer getPlatformMBeanServer(); static final char ATTRIBUTES_SEPARATOR; }
@Test public void testGetAllMBeanNodes() throws JMException { final List<MBeanNode> allMBeanNodes = MBeans.getAllMBeanNodes(); assertNotNull("getAllMBeanNodes", allMBeanNodes); for (final MBeanNode mbeanNode : allMBeanNodes) { assertNotNull("mbeanNode", mbeanNode); assertNotNull("toString", mbeanNode.toString()); } }