Package javax.rmi.ssl

Examples of javax.rmi.ssl.SslRMIClientSocketFactory


            while (true) {
                i++;
                Logging.getErrorLog().reportError("Trying to re-connect to remote userbase, tries: " + i);
                System.err.println("Trying to re-connect to remote userbase, tries: " + i);
                try {
                    registry = LocateRegistry.getRegistry(host, port, new SslRMIClientSocketFactory());
                    rmi = (RmiDelegateUserbase) registry.lookup("userbase");
                    if (rmi.isUp()) {
                        break; // if we get here, then we are reconnected (since it didn't throw any exceptions)
                    }
                } catch (RemoteException e) {
View Full Code Here


    public RmiUserStatisticsClient(String host, int port, int retry) throws IOException {
        this.host = host;
        this.port = port;
        this.retry = retry;
        try {
            registry = LocateRegistry.getRegistry(host, port, new SslRMIClientSocketFactory());
            rmi = (RmiUserStatistics) registry.lookup("statistics");
            if (rmi.isUp()) {
                System.out.println("Located remote user statistics at " + host + ':' + port);
            } else {
                throw new IOException("Failed to connect to remote statistics. (Found registry but not statistics)");
View Full Code Here

            while (true) {
                i++;
                Logging.getErrorLog().reportError("Trying to re-connect to remote statistics, tries: " + i);
                System.err.println("Trying to re-connect to remote statistics, tries: " + i);
                try {
                    registry = LocateRegistry.getRegistry(host, port, new SslRMIClientSocketFactory());
                    rmi = (RmiUserStatistics) registry.lookup("statistics");
                    if (rmi.isUp()) {
                        break; // if we get here, then we are reconnected (since it didn't throw any exceptions)
                    }
                } catch (RemoteException e) {
View Full Code Here

            RMIClientSocketFactory csf = null;
            RMIServerSocketFactory ssf = null;

            // Configure SSL for RMI connection if required
            if (rmiSSL) {
                csf = new SslRMIClientSocketFactory();
                ssf = new SslRMIServerSocketFactory(ciphers, protocols,
                            clientAuth);
            }
           
            // Force the use of local ports if required
View Full Code Here

                host = hp[0];
                port = Integer.parseInt(hp[1]);
            }

            // Try SSL
            Registry registry = LocateRegistry.getRegistry(host,port, new SslRMIClientSocketFactory());
            sslStub = (RMIServer) registry.lookup("jmxrmi");
            ssl = true;
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
View Full Code Here

    public static void main(String[] args) {
        try {
            System.out.println("SocketFactoryTest START.");

            final SslRMIClientSocketFactory client1 =
                new SslRMIClientSocketFactory();
            final SslRMIClientSocketFactory client2 =
                new SslRMIClientSocketFactory();
            final SslRMIClientSocketFactory client11 =
                (SslRMIClientSocketFactory) serializeAndClone(client1);
            final SslRMIClientSocketFactory client21 =
                (SslRMIClientSocketFactory) serializeAndClone(client2);
            final SslRMIServerSocketFactory server1 =
                new SslRMIServerSocketFactory();
            final SslRMIServerSocketFactory server2 =
                new SslRMIServerSocketFactory(null,
View Full Code Here

        }

        if ("Test3".equals(testID)) {
            try {
                Registry registry = LocateRegistry.getRegistry(
                    null, 4444, new SslRMIClientSocketFactory());
                String[] list = registry.list();
                if ("jmxrmi".equals(list[0])) {
                    System.out.println(ok);
                } else {
                    System.out.println(ko);
View Full Code Here

                host = hp[0];
                port = Integer.parseInt(hp[1]);
            }

            // Try SSL
            Registry registry = LocateRegistry.getRegistry(host,port, new SslRMIClientSocketFactory());
            sslStub = (RMIServer) registry.lookup("jmxrmi");
            ssl = true;
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
View Full Code Here

    Map map = new HashMap();
    map.put(JMXConnector.CREDENTIALS, new String[] { user, password });
        String connectorName = "/JMXConnector";
        if (secure) {
            connectorName = "/JMXSecureConnector";
            SslRMIClientSocketFactory csf = new SslRMIClientSocketFactory();
            map.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, csf);
        }
    Kernel kernel = null;
    try {
      JMXServiceURL address = new JMXServiceURL(
View Full Code Here

       
        this.url = new JMXServiceURL(url);
        this.environment = new HashMap();
        this.environment.put(JMXConnector.CREDENTIALS, new String[] {username, password});
        if (secure) {
            SslRMIClientSocketFactory csf = new SslRMIClientSocketFactory();
            this.environment.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, csf);
        }

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

TOP

Related Classes of javax.rmi.ssl.SslRMIClientSocketFactory

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.