Package javax.management.remote

Examples of javax.management.remote.JMXConnector


                String[] credentials = new String[]{username, password};
                environment.put(JMXConnector.CREDENTIALS, credentials);
               
                try {
                    JMXServiceURL address = new JMXServiceURL("service:" + uri);
                    JMXConnector jmxConnector = JMXConnectorFactory.connect(address, environment);
                    JMXDeploymentManager manager = new JMXDeploymentManager(jmxConnector);
                    return manager;
                } catch (IOException e) {
                    throw (DeploymentManagerCreationException)new DeploymentManagerCreationException(e.getMessage()).initCause(e);
                } catch (SecurityException e) {
View Full Code Here


    } else {
      JMXServiceURL url = new JMXServiceURL(url_string);

      err("Create RMI connector and connect to the RMI connector server" + url);

      JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
      // Get an MBeanServerConnection
      //
      err("\nGet an MBeanServerConnection");
      mbsc = jmxc.getMBeanServerConnection();
    }

    // Get domains from MBeanServer
    //
    err("\nDomains:");
View Full Code Here

            Map<String, Object> env = new HashMap<String, Object>();
            if (jmxUsername != null && jmxPassword != null) {
                String[] credentials = new String[] { jmxUsername, jmxPassword };
                env.put(JMXConnector.CREDENTIALS, credentials);
            }
            JMXConnector connector = JMXConnectorFactory.connect(serviceURL, env);
            mbeanServer = connector.getMBeanServerConnection();
        } catch (Exception ex) {
            LOGGER.warn("Cannot create JMXServiceURL from: {}", jmxServiceURL);
        }
        return mbeanServer;
    }
View Full Code Here

            Map<String, Object> env = new HashMap<String, Object>();
            if (jmxUsername != null && jmxPassword != null) {
                String[] credentials = new String[] { jmxUsername, jmxPassword };
                env.put(JMXConnector.CREDENTIALS, credentials);
            }
            JMXConnector connector = JMXConnectorFactory.connect(serviceURL, env);
            mbeanServer = connector.getMBeanServerConnection();
        } catch (Exception ex) {
            LOGGER.warn("Cannot create JMXServiceURL from: {}", jmxServiceURL);
        }
        return mbeanServer;
    }
View Full Code Here

        BrokerViewMBean mbean = (BrokerViewMBean)MBeanServerInvocationHandler.newProxyInstance(connection, name, BrokerViewMBean.class, true);
        return mbean;
    }

    protected MBeanServerConnection getConnection() throws IOException {
        JMXConnector connector = this.connector;
        if (isConnectionActive(connector)) {
            return connector.getMBeanServerConnection();
        }

        synchronized (this) {
            closeConnection();
View Full Code Here

        }

        Exception exception = null;
        for (int i = 0; i < urls.length; i++) {
            try {
                JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(urls[i]), env);
                connector.connect();
                MBeanServerConnection connection = connector.getMBeanServerConnection();

                Set brokers = findBrokers(connection);
                if (brokers.size() > 0) {
                    LOG.info("Connected via JMX to the broker at " + urls[i]);
                    return connector;
View Full Code Here

    private MBeanServerConnection getMBeanServerConnection() throws MalformedURLException {
        final JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi");
        MBeanServerConnection mbsc = null;
        try {
            JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
            mbsc = jmxc.getMBeanServerConnection();

            // trace all existing MBeans
            Set<?> all = mbsc.queryMBeans(null, null);
            LOG.info("Total MBean count=" + all.size());
            for (Object o : all) {
View Full Code Here

    private MBeanServerConnection getConnection(Map<String, ?> env) throws IOException {    
        String hostname = "localhost";      
        String port = "9999";
        String url = "service:jmx:rmi:///jndi/rmi://" + hostname + "/JMXConnector";
        JMXServiceURL serviceURL = new JMXServiceURL(url);
        JMXConnector connector = JMXConnectorFactory.connect(serviceURL, env);
        return connector.getMBeanServerConnection();
    }
View Full Code Here

    private MBeanServerConnection getConnection() throws IOException {
        if (this.mbeanConnection == null) {
            log.debug("Connecting to: " + url);
           
            JMXConnector connector = JMXConnectorFactory.connect(url, environment);
            this.mbeanConnection = connector.getMBeanServerConnection();
           
            log.debug("Connected");
        }

        return mbeanConnection;
View Full Code Here

    } else {
      JMXServiceURL url = new JMXServiceURL(url_string);

      err("Create RMI connector and connect to the RMI connector server" + url);

      JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
      // Get an MBeanServerConnection
      //
      err("\nGet an MBeanServerConnection");
      mbsc = jmxc.getMBeanServerConnection();
    }

    // Get domains from MBeanServer
    //
    err("\nDomains:");
View Full Code Here

TOP

Related Classes of javax.management.remote.JMXConnector

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.