KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mx4j > remote > provider > iiop > ClientProvider


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package mx4j.remote.provider.iiop;
10
11 import java.io.IOException JavaDoc;
12 import java.net.MalformedURLException JavaDoc;
13 import java.util.Map JavaDoc;
14
15 import javax.management.remote.JMXConnector JavaDoc;
16 import javax.management.remote.JMXConnectorProvider JavaDoc;
17 import javax.management.remote.JMXServiceURL JavaDoc;
18 import javax.management.remote.rmi.RMIConnector JavaDoc;
19
20 /**
21  * @version $Revision: 1.4 $
22  */

23 public class ClientProvider implements JMXConnectorProvider JavaDoc
24 {
25    public JMXConnector JavaDoc newJMXConnector(JMXServiceURL JavaDoc url, Map JavaDoc environment) throws IOException JavaDoc
26    {
27       String JavaDoc protocol = url.getProtocol();
28       if (!"iiop".equals(protocol)) throw new MalformedURLException JavaDoc("Wrong protocol " + protocol + " for provider " + this);
29       return new RMIConnector JavaDoc(url, environment);
30    }
31 }
32
Popular Tags