Package javax.management.remote

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
View Full Code Here


    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

            if (params.getProtocol().equals("jmx")) {
                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);
                    }
View Full Code Here

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

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

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

        }
        String serviceUrl = args[0];
        if (!serviceUrl.startsWith("service:jmx")) {
            serviceUrl = "service:jmx:rmi:///jndi/rmi://" + args[0] + "/jmxrmi";
        }
        final JMXServiceURL url = new JMXServiceURL(serviceUrl);
        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));
        }
View Full Code Here

            credentials[0] = username;
            credentials[1] = password;
            environment = new HashMap();
            environment.put(JMXConnector.CREDENTIALS, credentials);
        }
        return JMXConnectorFactory.connect(new JMXServiceURL(urlForJMX),
                environment).getMBeanServerConnection();

    }
View Full Code Here

     *
     * @throws IOException on connection failures
     */
    private void connect() throws IOException
    {
        JMXServiceURL jmxUrl = new JMXServiceURL(String.format(fmtUrl, host, port));
        Map<String,Object> env = new HashMap<String,Object>();
        if (username != null)
        {
            String[] creds = { username, password };
            env.put(JMXConnector.CREDENTIALS, creds);
View Full Code Here

        Map env = new HashMap();

        try
        {
            // Convert the serviceUrl string to instance of JMXServiceURL
            JMXServiceURL address = new JMXServiceURL(parameter.getJmxServiceURL());

            JMXConnectorServer server = javax.management.remote.JMXConnectorServerFactory
                    .newJMXConnectorServer(address, env, null);

            return server;
View Full Code Here

    public ServerProxy(final String url, final String username, final String password) throws Exception {
        assert url != null;
        assert username != null;
        assert password != null;
       
        this.url = new JMXServiceURL(url);
        this.environment = new HashMap();
        this.environment.put("jmx.remote.credentials", new String[] {username, password});

        log.debug("Initialized with URL: " + url + ", environment: " + environment);
    }
View Full Code Here

TOP

Related Classes of javax.management.remote.JMXServiceURL

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.