1 9 package org.jboss.mx.remoting.provider.rmi; 10 11 import java.io.IOException ; 12 import java.net.MalformedURLException ; 13 import java.util.Map ; 14 import javax.management.MBeanServer ; 15 import javax.management.remote.JMXConnectorServer ; 16 import javax.management.remote.JMXConnectorServerProvider ; 17 import javax.management.remote.JMXServiceURL ; 18 import javax.management.remote.rmi.RMIConnectorServer ; 19 20 23 public class ServerProvider implements JMXConnectorServerProvider 24 { 25 public static final String PROTOCOL = "rmi"; 26 27 public ServerProvider() 28 { 29 } 30 31 public JMXConnectorServer newJMXConnectorServer(JMXServiceURL serviceURL, Map environment, MBeanServer server) 32 throws IOException 33 { 34 if(serviceURL != null && serviceURL.getProtocol() != null && serviceURL.getProtocol().equalsIgnoreCase(PROTOCOL)) 35 { 36 return new RMIConnectorServer (serviceURL, environment, server); 37 } 38 else 39 { 40 throw new MalformedURLException ("JMXServiceURL provided is invalid for this provider. " + 41 "Protocol must be " + PROTOCOL + ". JMXServiceURL provided is " + 42 serviceURL); 43 } 44 } 45 46 } | Popular Tags |