01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: package mx4j.tools.remote.provider.burlap;
10:
11: import java.io.IOException;
12: import java.net.MalformedURLException;
13: import java.util.Map;
14:
15: import javax.management.remote.JMXConnector;
16: import javax.management.remote.JMXConnectorProvider;
17: import javax.management.remote.JMXServiceURL;
18:
19: import mx4j.tools.remote.http.HTTPConnector;
20:
21: /**
22: * @version $Revision: 1.5 $
23: */
24: public class ClientProvider implements JMXConnectorProvider {
25: public JMXConnector newJMXConnector(JMXServiceURL url,
26: Map environment) throws IOException {
27: String protocol = url.getProtocol();
28: if (!"burlap".equals(protocol))
29: throw new MalformedURLException("Wrong protocol "
30: + protocol + " for provider " + this );
31: return new HTTPConnector(url, environment);
32: }
33: }
|