Examples of JMXConnector


Examples of javax.management.remote.JMXConnector

         creds[1] = password;
         env.put(JMXConnector.CREDENTIALS, creds);
      }

      JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://"+getServerHostForURL()+":1090/jmxrmi");
      JMXConnector jmxc = JMXConnectorFactory.connect(url, env);
      MBeanServerConnection adaptor = jmxc.getMBeanServerConnection();
      return adaptor;
   }
View Full Code Here

Examples of javax.management.remote.JMXConnector

         creds[1] = password;
         env.put(JMXConnector.CREDENTIALS, creds);
      }

      JMXServiceURL url = new JMXServiceURL(serverURL);
      JMXConnector jmxc = JMXConnectorFactory.connect(url, env);
      MBeanServerConnection adaptor = jmxc.getMBeanServerConnection();

      ServerProxyHandler handler = new ServerProxyHandler(adaptor, serverJMXName);
      Class<?>[] ifaces = {JBossASServer.class};
      ClassLoader tcl = Thread.currentThread().getContextClassLoader();
      JBossASServer server = (JBossASServer) Proxy.newProxyInstance(tcl, ifaces, handler);
      server.shutdown();

      System.out.println("Shutdown message has been posted to the server.");
      System.out.println("Server shutdown may take a while - check logfiles for completion");
      jmxc.close();
   }
View Full Code Here

Examples of javax.management.remote.JMXConnector

            if (verbose )
            {
               log("will connect with JMXServiceURL = "+url);
            }

            JMXConnector jmxc = JMXConnectorFactory.connect(url, env);
            MBeanServerConnection server = jmxc.getMBeanServerConnection();
            if(verbose)
            {
               log("connected to server");
            }
View Full Code Here

Examples of javax.management.remote.JMXConnector

         creds[0] = username;
         creds[1] = password;
         env.put(JMXConnector.CREDENTIALS, creds);
      }
      JMXServiceURL url = new JMXServiceURL(this.serverURL);
      JMXConnector jmxc = JMXConnectorFactory.connect(url, env);
      return jmxc;
   }
View Full Code Here

Examples of javax.management.remote.JMXConnector

      Map map = new HashMap();
      if (user != null) {
        String[] credentials = new String[] {user, pass};
        map.put("jmx.remote.credentials", credentials);
      }
      JMXConnector conn = JMXConnectorFactory.connect(url, map);
      connection = conn.getMBeanServerConnection();
    } catch (Exception e) {
      log.error("Unable to get JMX connection: ", e);
      return null;
    }
    return connection;
View Full Code Here

Examples of javax.management.remote.JMXConnector

    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

Examples of javax.management.remote.JMXConnector

    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

Examples of javax.management.remote.JMXConnector

                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();
            } catch (Exception e) {
                throw e;
            }

        }
View Full Code Here

Examples of javax.management.remote.JMXConnector

            }
            if (log.isDebugEnabled()) {
                log.debug("Using JMXServiceURL with host=" + host + ", port=" + params.getPort());
            }
            JMXServiceURL address = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://"+ host +":"+params.getPort()+"/JMXConnector");
            JMXConnector jmxConnector = JMXConnectorFactory.connect(address, environment);
            RemoteDeploymentManager manager = getRemoteDeploymentManager();
            manager.init(jmxConnector, host);
            if(!manager.isSameMachine()) {
                manager.setAuthentication(username, password);
            }
View Full Code Here

Examples of javax.management.remote.JMXConnector

        Map environment = new HashMap();
        environment.put(JMXConnector.CREDENTIALS, new String[]{getUser(), getPassword()});

        JMXServiceURL serviceURL = new JMXServiceURL(getUrl());
        JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, environment);
        try {
            MBeanServerConnection mbServer = jmxConnector.getMBeanServerConnection();

            ObjectName configStore = locateConfigStore(mbServer, storeName);
            mbServer.invoke(configStore, "install", new Object[]{getArtifact().toURL()}, new String[]{URL.class.getName()});
            System.out.println("Distributed " + getArtifact() + " to " + getUrl());
        } finally {
            jmxConnector.close();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.