1 22 package org.jboss.webservice; 23 24 26 import javax.management.MBeanServer ; 27 import javax.management.ObjectName ; 28 29 import org.jboss.logging.Logger; 30 import org.jboss.mx.util.MBeanProxyExt; 31 import org.jboss.mx.util.MBeanServerLocator; 32 import org.jboss.mx.util.ObjectNameFactory; 33 34 40 public class ServiceRefHandlerFactory 41 { 42 private static final Logger log = Logger.getLogger(ServiceRefHandlerFactory.class); 44 45 47 public static ServiceRefHandler newInstance() 48 { 49 MBeanServer server = MBeanServerLocator.locateJBoss(); 50 ObjectName objectName = ObjectNameFactory.create("jboss.ws:service=ServiceRefHandler"); 51 52 ServiceRefHandler refHandler = null; 53 if (server.isRegistered(objectName)) 54 { 55 refHandler = (ServiceRefHandler)MBeanProxyExt.create(ServiceRefHandler.class, objectName, server); 56 } 57 else 58 { 59 log.warn("Not registered: " + objectName); 60 } 61 return refHandler; 62 } 63 } 64 | Popular Tags |