Package javax.management.remote

Examples of javax.management.remote.JMXConnector


    _outputFileName = outputfile;
    _namePattern = namePattern;
    _targetSamples = sampleCount;
   
    JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + _jmxUrl + "/jmxrmi");
    JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
   
    _mbeanServer = jmxc.getMBeanServerConnection();
    MBeanServerNotificationFilter filter = new MBeanServerNotificationFilter();
    filter.enableAllObjectNames();
    _mbeanServer.addNotificationListener(MBeanServerDelegate.DELEGATE_NAME, this, filter, null);
    init();
    _timer = new Timer(true);
View Full Code Here


                Hashtable<String, Object> env = new Hashtable<String, Object>();
                String[] credentials = new String[2];
                credentials[0] = userName;
                credentials[1] = password;
                env.put(JMXConnector.CREDENTIALS, credentials);
                JMXConnector connector = JMXConnectorFactory.connect(
                        serviceURL, env);
                mbServerConn = connector.getMBeanServerConnection();

                // retrieve the mbean name to the agent-car-jmx plugin
                if(PATH == null) {
                    Set<ObjectName> mbeanNames = mbServerConn.queryNames(new ObjectName("*:name=MasterRemoteControlJMX,*"), null);
                    for(Iterator<ObjectName> it = mbeanNames.iterator(); it.hasNext(); ) {
View Full Code Here

    Kernel kernel = null;
    try {
      JMXServiceURL address = new JMXServiceURL(
          "service:jmx:rmi:///jndi/rmi://localhost" + ":" + port
              + "/JMXConnector");
      JMXConnector jmxConnector = JMXConnectorFactory.connect(address,
          map);
      MBeanServerConnection mbServerConnection = jmxConnector
          .getMBeanServerConnection();
      kernel = new KernelDelegate(mbServerConnection);

    } catch (MalformedURLException e) {
      e.printStackTrace();
View Full Code Here

                Map environment = new HashMap();
                String[] credentials = new String[]{username, password};
                environment.put(JMXConnector.CREDENTIALS, credentials);
                try {
                    JMXServiceURL address = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://"+params.getHost()+":"+params.getPort()+"/JMXConnector");
                    JMXConnector jmxConnector = JMXConnectorFactory.connect(address, environment);
                    RemoteDeploymentManager manager = new RemoteDeploymentManager(jmxConnector, params.getHost());
                    if(!manager.isSameMachine()) {
                        manager.setAuthentication(username, password);
                    }
                    return manager;
View Full Code Here

        final Map<String, String> paramMap = new HashMap<String, String>();
        for (final Object objKey : System.getProperties().keySet()) {
            final String key = (String) objKey;
            paramMap.put(key, System.getProperties().getProperty(key));
        }
        final JMXConnector connector = JMXConnectorFactory.connect(url, paramMap);
        final Client client = new Client(connector);
        final String title = "Log4j JMX Client - " + url;

        SwingUtilities.invokeLater(new Runnable() {
            @Override
View Full Code Here

        }
    Kernel kernel = null;
    try {
      JMXServiceURL address = new JMXServiceURL(
          "service:jmx:rmi:///jndi/rmi://" + host + ":" + port + connectorName);
      JMXConnector jmxConnector = JMXConnectorFactory.connect(address, map);
      MBeanServerConnection mbServerConnection = jmxConnector.getMBeanServerConnection();
      kernel = new KernelDelegate(mbServerConnection);
    } catch (MalformedURLException e) {
      e.printStackTrace();
    }
    return kernel;
View Full Code Here

        }
        Kernel kernel = null;
        try {
            JMXServiceURL address = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + host + ":" + port
                    + connectorName);
            JMXConnector jmxConnector = JMXConnectorFactory.connect(address, map);
            MBeanServerConnection mbServerConnection = jmxConnector.getMBeanServerConnection();
            kernel = new KernelDelegate(mbServerConnection);
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        return kernel;
View Full Code Here

    map.put("jmx.remote.credentials", new String[] { user, password });
    Kernel kernel = null;
    try {
      JMXServiceURL address = new JMXServiceURL(
          "service:jmx:rmi:///jndi/rmi://localhost" + ":" + port + "/JMXConnector");
      JMXConnector jmxConnector = JMXConnectorFactory.connect(address, map);
      MBeanServerConnection mbServerConnection = jmxConnector.getMBeanServerConnection();
      kernel = new KernelDelegate(mbServerConnection);
    } catch (MalformedURLException e) {
      e.printStackTrace();
    }
    return kernel;
View Full Code Here

        String[] credentials = new String[]{username, password};
        environment.put(JMXConnector.CREDENTIALS, credentials);
        environment.put(JMXConnectorFactory.DEFAULT_CLASS_LOADER, BaseDeploymentFactory.class.getClassLoader());
        try {
            JMXServiceURL address = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://"+params.getHost()+":"+params.getPort()+"/JMXConnector");
            JMXConnector jmxConnector = JMXConnectorFactory.connect(address, environment);
            RemoteDeploymentManager manager = getRemoteDeploymentManager();
            manager.init(jmxConnector, params.getHost());
            if(!manager.isSameMachine()) {
                manager.setAuthentication(username, password);
            }
View Full Code Here

        }
    }

    private void createMemoryMxBean() {
        try {
            JMXConnector connector = JMXConnectorFactory.connect(url);
            MBeanServerConnection mbsc = connector.getMBeanServerConnection();
            memoryMbean = ManagementFactory.newPlatformMXBeanProxy(mbsc, "java.lang:type=Memory", MemoryMXBean.class);
        } catch (IOException e) {
            throw new IllegalStateException("Unable to get to the MemoryMXBean", e);
        }
    }
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.