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 javax.management.remote;
10:
11: import java.io.IOException;
12: import java.util.HashMap;
13: import java.util.Map;
14:
15: import mx4j.remote.ProviderFactory;
16:
17: /**
18: * @version $Revision: 1.11 $
19: */
20: public class JMXConnectorFactory {
21: public static final String DEFAULT_CLASS_LOADER = "jmx.remote.default.class.loader";
22: public static final String PROTOCOL_PROVIDER_PACKAGES = "jmx.remote.protocol.provider.pkgs";
23: public static final String PROTOCOL_PROVIDER_CLASS_LOADER = "jmx.remote.protocol.provider.class.loader";
24:
25: private JMXConnectorFactory() {
26: }
27:
28: public static JMXConnector connect(JMXServiceURL url)
29: throws IOException {
30: return connect(url, null);
31: }
32:
33: public static JMXConnector connect(JMXServiceURL url,
34: Map environment) throws IOException {
35: JMXConnector connector = newJMXConnector(url, environment);
36: connector.connect(environment);
37: return connector;
38: }
39:
40: public static JMXConnector newJMXConnector(JMXServiceURL url,
41: Map env) throws IOException {
42: Map envCopy = env == null ? new HashMap() : new HashMap(env);
43: JMXConnector connector = ProviderFactory.newJMXConnector(url,
44: envCopy);
45: return connector;
46: }
47: }
|