Examples of JMXServiceURL


Examples of javax.management.remote.JMXServiceURL

         String[] creds = new String[2];
         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.JMXServiceURL

  }
 
  public MBeanServerConnection getConnection() {
    if (connection != null) return connection;
    try {
      JMXServiceURL url = new JMXServiceURL(serviceURI);
      Map map = new HashMap();
      if (user != null) {
        String[] credentials = new String[] {user, pass};
        map.put("jmx.remote.credentials", credentials);
      }
View Full Code Here

Examples of javax.management.remote.JMXServiceURL

    {
      int port = _config.getInt("wrapper.jmx.rmi.port", Constants.DEFAULT_RMI_PORT);
      if (port > 0)
      {
        Registry rmiRegistry = LocateRegistry.createRegistry(port);
        JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + port + "/server");
        Map environment = null;
        if (_config.getString("wrapper.jmx.rmi.user", null) != null)
        {
          final String myUser = _config.getString("wrapper.jmx.rmi.user");
          final String myPassword = _config.getString("wrapper.jmx.rmi.password", "");
View Full Code Here

Examples of javax.management.remote.JMXServiceURL

    if (xname == null)
      xname = _config.getString("wrapper.ntservice.name");
    if (xname == null)
      xname = "yajsw.noname";
    ObjectName oName = new ObjectName("org.rzo.yajsw", "name", xname);
    JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:"+port+"/server");
     jmxc = JMXConnectorFactory.connect(url, null);
      MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();
        proxy = (AbstractWrappedProcessMBean)
          MBeanServerInvocationHandler.newProxyInstance(
                                         mbsc,
View Full Code Here

Examples of javax.management.remote.JMXServiceURL

                registryCreated = true;
            }
           
            if (registryCreated) {
                jmxInformation.updateJMXUrl();
                JMXServiceURL url = new JMXServiceURL(jmxInformation.getJmxUrl());
                Map<String, Object> env = createContextMap();
                MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
                connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs);
                try {
                    connectorServer.start();
View Full Code Here

Examples of javax.management.remote.JMXServiceURL

    public void setUrlPath(String urlPath) {
        this.urlPath = urlPath;
    }

    public void doStart() throws Exception {
        jmxServiceURL = new JMXServiceURL(protocol, host, port, urlPath);
        Map env = new HashMap();
        if (applicationConfigName != null) {
            authenticator = new Authenticator(applicationConfigName, classLoader);
            env.put(JMXConnectorServer.AUTHENTICATOR, authenticator);
        } else {
View Full Code Here

Examples of javax.management.remote.JMXServiceURL

        assert password != null;
       
        Map env = new HashMap();
        env.put("jmx.remote.credentials", new String[] {username, password});

        init(new JMXServiceURL(url), env);
    }
View Full Code Here

Examples of javax.management.remote.JMXServiceURL

  public Kernel getRunningKernel() throws IOException {
    Map map = new HashMap();
    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) {
View Full Code Here

Examples of javax.management.remote.JMXServiceURL

                throw e;
            }

        } else {
            try {
                JMXServiceURL serviceURL = new JMXServiceURL(
                        "service:jmx:rmi:///jndi/rmi://" + ip + ":" + port
                                + "/JMXConnector");
                Hashtable<String, Object> env = new Hashtable<String, Object>();
                String[] credentials = new String[2];
                credentials[0] = userName;
View Full Code Here

Examples of javax.management.remote.JMXServiceURL

                host = "[" + host + "]";
            }
            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
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.