Package javax.management.remote

Examples of javax.management.remote.JMXAuthenticator


        }
        String connectionId = mc.getConnectionId();
        // If the environment includes an authenticator, check
        // that it accepts the connection id, and replace the
        // Subject by whatever it returns.
        JMXAuthenticator authenticator =
      (JMXAuthenticator) env.get("jmx.remote.authenticator");
        if (authenticator != null) {
      Object[] credentials = {connectionId, subject};
      subject = authenticator.authenticate(credentials);
      if (mc instanceof SocketConnectionIf) {
          ((SocketConnectionIf)mc).setSubject(subject);
      }
      connectionId = mc.getConnectionId();
        }
View Full Code Here


    }

    private static boolean test(String proto) throws Exception {
        ObjectName serverName = ObjectName.getInstance("d:type=server");
        MBeanServer mbs = MBeanServerFactory.newMBeanServer();
        JMXAuthenticator authenticator = new BogusAuthenticator();
        Map env = Collections.singletonMap("jmx.remote.authenticator",
                                           authenticator);
        JMXServiceURL url = new JMXServiceURL("service:jmx:" + proto + "://");
        JMXConnectorServer server;
        try {
View Full Code Here

        if (getMBeanServer() == null)
            throw new IllegalStateException("Not attached to an MBean server");

        Subject subject = null;
        JMXAuthenticator authenticator =
            (JMXAuthenticator) env.get(JMXConnectorServer.AUTHENTICATOR);
        if (authenticator == null) {
            /*
             * Create the JAAS-based authenticator only if authentication
             * has been enabled
             */
            if (env.get("jmx.remote.x.password.file") != null ||
                env.get("jmx.remote.x.login.config") != null) {
                authenticator = new JMXPluggableAuthenticator(env);
            }
        }
        if (authenticator != null) {
            if (tracing) logger.trace("newClient","got authenticator: " +
                               authenticator.getClass().getName());
            try {
                subject = authenticator.authenticate(credentials);
            } catch (SecurityException e) {
                logger.trace("newClient", "Authentication failed: " + e);
                throw e;
            }
        }
View Full Code Here

        env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, sslServerSocketFactory);

        // For binding the JMXConnectorServer with the Registry
        env.put("com.sun.jndi.rmi.factory.socket", sslCsf);

        JMXAuthenticator authenticator = getAccessController();
        if (authenticator != null) {
            env.put("jmx.remote.authenticator", authenticator);
        }
        // env.put("jmx.remote.protocol.provider.pkgs", "com.sun.jmx.remote.protocol");
        //env.put("jmx.remote.protocol.provider.class.loader", this.getClass().getClassLoader());
View Full Code Here

    public JMXAuthenticator getAccessController() {

        // we return a proxy to avoid instantiating the jmx authenticator until it is actually
        // needed by the system.
        return new JMXAuthenticator() {

            /**
             * We actually wait for the first authentication request to delegate/
             * @param credentials
             * @return
             */
            public Subject authenticate(Object credentials) {
                // lazy init...
                // todo : lloyd, if this becomes a performance bottleneck, we should cache
                // on first access.
                JMXAuthenticator controller = mHabitat.getService(JMXAuthenticator.class);
                return controller.authenticate(credentials);
            }
        };
    }
View Full Code Here

        env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, sslServerSocketFactory);

        // For binding the JMXConnectorServer with the Registry
        env.put("com.sun.jndi.rmi.factory.socket", sslCsf);

        JMXAuthenticator authenticator = getAccessController();
        if (authenticator != null) {
            env.put("jmx.remote.authenticator", authenticator);
        }
        // env.put("jmx.remote.protocol.provider.pkgs", "com.sun.jmx.remote.protocol");
        //env.put("jmx.remote.protocol.provider.class.loader", this.getClass().getClassLoader());
View Full Code Here

        env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, sslServerSocketFactory);

        // For binding the JMXConnectorServer with the Registry
        env.put("com.sun.jndi.rmi.factory.socket", sslCsf);

        JMXAuthenticator authenticator = getAccessController();
        if (authenticator != null) {
            env.put("jmx.remote.authenticator", authenticator);
        }
        // env.put("jmx.remote.protocol.provider.pkgs", "com.sun.jmx.remote.protocol");
        //env.put("jmx.remote.protocol.provider.class.loader", this.getClass().getClassLoader());
View Full Code Here

TOP

Related Classes of javax.management.remote.JMXAuthenticator

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.