KickJava   Java API By Example, From Geeks To Geeks.

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


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.MBeanServer JavaDoc;
16 import javax.management.remote.JMXConnectorServer JavaDoc;
17 import javax.management.remote.JMXConnectorServerProvider JavaDoc;
18 import javax.management.remote.JMXServiceURL JavaDoc;
19 import javax.management.remote.rmi.RMIConnectorServer JavaDoc;
20
21 /**
22  * @version $Revision: 1.4 $
23  */

24 public class ServerProvider implements JMXConnectorServerProvider JavaDoc
25 {
26    public JMXConnectorServer JavaDoc newJMXConnectorServer(JMXServiceURL JavaDoc url, Map JavaDoc environment, MBeanServer JavaDoc server) throws IOException JavaDoc
27    {
28       String JavaDoc protocol = url.getProtocol();
29       if (!"iiop".equals(protocol)) throw new MalformedURLException JavaDoc("Wrong protocol " + protocol + " for provider " + this);
30       return new RMIConnectorServer JavaDoc(url, environment, server);
31    }
32 }
33
Popular Tags