Package javax.management.remote

Examples of javax.management.remote.JMXConnectorProvider


   {
      // Yes, throw NPE if url is null (spec compliant)
      String protocol = normalizeProtocol(url.getProtocol());
      String providerPackages = findProviderPackageList(env, JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES);
      ClassLoader classLoader = findProviderClassLoader(env, JMXConnectorFactory.PROTOCOL_PROVIDER_CLASS_LOADER);
      JMXConnectorProvider provider = (JMXConnectorProvider)loadProvider(providerPackages, protocol, MX4JRemoteConstants.CLIENT_PROVIDER_CLASS, classLoader);
      return provider;
   }
View Full Code Here


    return Collections.unmodifiableSet(transports.keySet());
  }

  @Override
    public JMXConnectorProvider getConnectorProvider(String key) {
    final JMXConnectorProvider connector = transports.get(key);

    // TODO: Add logging

    return connector;
  }
View Full Code Here

  @Override
    public JMXConnector getJMXConnector(JMXServiceDescriptor serviceDescriptor) {
    try {
      final String transport = serviceDescriptor.getUrl().getProtocol();

      final JMXConnectorProvider connectorProvider = getConnectorProvider(transport);

      final JMXServiceURL url = getJMXServiceURL(
                  serviceDescriptor.getUrl().getHost(),
                  serviceDescriptor.getUrl().getPort(),
                  serviceDescriptor.getUrl().getProtocol(),
                  serviceDescriptor.getDomain());

      Map<String, Object> environment = null;
      if (serviceDescriptor.getUsername() != null) {
        environment = new HashMap<String, Object>();
        String[] credentials = new String[] {
              serviceDescriptor.getUsername(),
              serviceDescriptor.getPassword()
        };
        environment.put(JMXConnector.CREDENTIALS, credentials);
      }

      return connectorProvider.newJMXConnector(url, environment);
    } catch (Exception e) {
      KarafWorkbenchActivator.getLogger().error(e.getMessage(), e);
      return null;
    }
  }
View Full Code Here

TOP

Related Classes of javax.management.remote.JMXConnectorProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.