1 9 package org.jboss.mx.remoting.provider.iiop; 10 11 import java.io.IOException ; 12 import java.net.MalformedURLException ; 13 import java.util.Map ; 14 import javax.management.remote.JMXConnector ; 15 import javax.management.remote.JMXConnectorProvider ; 16 import javax.management.remote.JMXServiceURL ; 17 import javax.management.remote.rmi.RMIConnector ; 18 19 22 public class ClientProvider implements JMXConnectorProvider 23 { 24 public static final String PROTOCOL = "iiop"; 25 26 public ClientProvider() 27 { 28 29 } 30 31 public JMXConnector newJMXConnector(JMXServiceURL serviceURL, Map environment) 32 throws IOException 33 { 34 if(serviceURL != null && serviceURL.getProtocol() != null && serviceURL.getProtocol().equalsIgnoreCase(PROTOCOL)) 35 { 36 return new RMIConnector (serviceURL, environment); 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 } | Popular Tags |