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.MBeanServer;
16: import javax.management.remote.JMXConnectorServer;
17: import javax.management.remote.JMXConnectorServerProvider;
18: import javax.management.remote.JMXServiceURL;
19:
20: import mx4j.tools.remote.http.HTTPConnectorServer;
21:
22: /**
23: * @version $Revision: 1.5 $
24: */
25: public class ServerProvider implements JMXConnectorServerProvider {
26: public JMXConnectorServer newJMXConnectorServer(JMXServiceURL url,
27: Map environment, MBeanServer server) throws IOException {
28: String protocol = url.getProtocol();
29: if (!"burlap".equals(protocol))
30: throw new MalformedURLException("Wrong protocol "
31: + protocol + " for provider " + this );
32: return new HTTPConnectorServer(url, environment, server);
33: }
34: }
|