KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)ClientProvider.java 1.17 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.remote.JMXConnectorProvider JavaDoc;
15 import javax.management.remote.JMXConnector JavaDoc;
16 import javax.management.remote.JMXServiceURL JavaDoc;
17 import javax.management.remote.rmi.RMIConnector JavaDoc;
18
19 public class ClientProvider implements JMXConnectorProvider JavaDoc {
20
21     public JMXConnector JavaDoc newJMXConnector(JMXServiceURL JavaDoc serviceURL,
22                     Map JavaDoc<String JavaDoc,?> environment)
23         throws IOException JavaDoc {
24     if (!serviceURL.getProtocol().equals("rmi")) {
25         throw new MalformedURLException JavaDoc("Protocol not rmi: " +
26                         serviceURL.getProtocol());
27     }
28     return new RMIConnector JavaDoc(serviceURL, environment);
29     }
30 }
31
Popular Tags