KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > remote > protocol > rmi > ServerProvider


1 /*
2  * @(#)ServerProvider.java 1.4 04/02/13
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.jmx.remote.protocol.rmi;
9
10 import java.io.IOException JavaDoc;
11 import java.net.MalformedURLException JavaDoc;
12 import java.util.Map JavaDoc;
13
14 import javax.management.MBeanServer JavaDoc;
15 import javax.management.remote.JMXConnectorServer JavaDoc;
16 import javax.management.remote.JMXConnectorServerProvider JavaDoc;
17 import javax.management.remote.JMXServiceURL JavaDoc;
18 import javax.management.remote.rmi.RMIConnectorServer JavaDoc;
19
20 public class ServerProvider implements JMXConnectorServerProvider JavaDoc {
21
22     public JMXConnectorServer JavaDoc newJMXConnectorServer(JMXServiceURL JavaDoc serviceURL,
23                             Map JavaDoc<String JavaDoc,?> environment,
24                             MBeanServer JavaDoc mbeanServer)
25         throws IOException JavaDoc {
26     if (!serviceURL.getProtocol().equals("rmi")) {
27         throw new MalformedURLException JavaDoc("Protocol not rmi: " +
28                         serviceURL.getProtocol());
29     }
30     return new RMIConnectorServer JavaDoc(serviceURL, environment, mbeanServer);
31     }
32
33 }
34
Popular Tags