1 15 package org.apache.hivemind.management.impl; 16 17 import java.util.List ; 18 19 import javax.management.MBeanServer ; 20 21 import org.apache.hivemind.ServiceImplementationFactory; 22 import org.apache.hivemind.ServiceImplementationFactoryParameters; 23 24 32 public class MBeanServerFactory implements ServiceImplementationFactory 33 { 34 35 public Object createCoreServiceImplementation( 36 ServiceImplementationFactoryParameters factoryParameters) 37 { 38 String serverId = null; 39 MBeanServer server = null; 40 List servers = javax.management.MBeanServerFactory.findMBeanServer(serverId); 41 if (servers != null && servers.size() > 0) 42 server = (MBeanServer ) servers.get(0); 43 else 44 server = javax.management.MBeanServerFactory.createMBeanServer(); 45 46 return server; 47 } 48 49 } | Popular Tags |