KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mx4j > tools > remote > provider > burlap > 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.tools.remote.provider.burlap;
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
19 import mx4j.tools.remote.http.HTTPConnector;
20
21 /**
22  * @version $Revision: 1.5 $
23  */

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