Examples of RMIClientSocketFactory


Examples of java.rmi.server.RMIClientSocketFactory

                // ignore
            }
        }
        if (registry == null && create) {
            if (host != null && !host.isEmpty()) {
                RMIClientSocketFactory socketFactory = RMISocketFactory.getDefaultSocketFactory();
                InetAddress addr = InetAddress.getByName(host);
                RMIServerSocketFactory serverSocketFactory = new KarafServerSocketFactory(addr, port);

                registry = LocateRegistry.createRegistry(getPort(), socketFactory, serverSocketFactory);
            } else {
View Full Code Here

Examples of java.rmi.server.RMIClientSocketFactory

    private void setupSsl() throws GeneralSecurityException {

        SSLServerSocketFactory sssf = keystoreManager.createSSLServerFactory(null, secureProtocol, algorithm, keyStore, keyAlias, trustStore,keyStoreAvailabilityTimeout);
        RMIServerSocketFactory rssf = new KarafSslRMIServerSocketFactory(sssf, this.isClientAuth());
        RMIClientSocketFactory rcsf = new SslRMIClientSocketFactory();
        environment.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, rssf);
        environment.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, rcsf);
        //@TODO secure RMI connector as well?
        //env.put("com.sun.jndi.rmi.factory.socket", rcsf);
    }
View Full Code Here

Examples of java.rmi.server.RMIClientSocketFactory

            log.warn("Starting unauthenticating JMXConnector for " + jmxServiceURL);
        }
       
        SSLServerSocketFactory sssf = keystoreManager.createSSLServerFactory(null, secureProtocol, algorithm, keyStore, keyAlias, trustStore, classLoader);
        RMIServerSocketFactory rssf = new GeronimoSslRMIServerSocketFactory(sssf, host, clientAuth);
        RMIClientSocketFactory rcsf = new SslRMIClientSocketFactory();
        env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, rssf);
        env.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, rcsf);
       
        server = JMXConnectorServerFactory.newJMXConnectorServer(jmxServiceURL, env, mbeanServer);
        NotificationFilterSupport filter = new NotificationFilterSupport();
View Full Code Here

Examples of java.rmi.server.RMIClientSocketFactory

            System.setProperty("java.rmi.server.randomIDs", "true");

            // Create the environment
            HashMap<String,Object> env = new HashMap<>();

            RMIClientSocketFactory csf = null;
            RMIServerSocketFactory ssf = null;

            // Configure SSL for RMI connection if required
            if (rmiSSL) {
                if (rmiBindAddress != null) {
View Full Code Here

Examples of java.rmi.server.RMIClientSocketFactory

    }

    private void setupSsl() throws GeneralSecurityException {
        SSLServerSocketFactory sslServerSocketFactory = keystoreManager.createSSLServerFactory(null, secureProtocol, algorithm, keyStore, keyAlias, trustStore, keyStoreAvailabilityTimeout);
        RMIServerSocketFactory rmiServerSocketFactory = new KarafSslRMIServerSocketFactory(sslServerSocketFactory, this.isClientAuth());
        RMIClientSocketFactory rmiClientSocketFactory = new SslRMIClientSocketFactory();
        environment.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, rmiServerSocketFactory);
        environment.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, rmiClientSocketFactory);
        // TODO secure RMI connector as well ?
        // environment.put("com.sun.jndi.rmi.factory.socket", rmiClientSocketFactory);
    }
View Full Code Here

Examples of java.rmi.server.RMIClientSocketFactory

        PrincipalDatabase db = map.get(jmxDatabaseName);

        HashMap<String,Object> env = new HashMap<String,Object>();

        //Socket factories for the RMIConnectorServer, either default or SLL depending on configuration
        RMIClientSocketFactory csf;
        RMIServerSocketFactory ssf;

        //check ssl enabled option in config, default to true if option is not set
        boolean sslEnabled = appRegistry.getConfiguration().getManagementSSLEnabled();
View Full Code Here

Examples of java.rmi.server.RMIClientSocketFactory

        // Check RMIClientSocketFactory in stub is from the expected class
        // "javax.rmi.ssl.SslRMIClientSocketFactory".
        //
        LiveRef liveRef = ((UnicastRef2)ref).getLiveRef();
        RMIClientSocketFactory csf = liveRef.getClientSocketFactory();
        if (csf == null || csf.getClass() != SslRMIClientSocketFactory.class)
            throw new SecurityException(
                    "Expecting a " + SslRMIClientSocketFactory.class.getName() +
                    " RMI client socket factory in stub!");
    }
View Full Code Here

Examples of java.rmi.server.RMIClientSocketFactory

         impl = new RMIIIOPServerImpl(environment);
      }
      else if(protocol == null || protocol.length() == 0 || "rmi".equalsIgnoreCase("rmi"))
      {
         int port = address.getPort();
         RMIClientSocketFactory clientSocketFactory = (RMIClientSocketFactory) environment.get(RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE);
         RMIServerSocketFactory serverSocketFactory = (RMIServerSocketFactory) environment.get(RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE);
         impl = new RMIJRMPServerImpl(port, clientSocketFactory, serverSocketFactory, environment);
      }
      else
      {
View Full Code Here

Examples of java.rmi.server.RMIClientSocketFactory

            connectStub((RMIServer)rmiServer.toStub(),env);
    }

    private static RMIServerImpl newJRMPServer(Map<String, ?> env, int port)
            throws IOException {
        RMIClientSocketFactory csf = (RMIClientSocketFactory)
            env.get(RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE);
        RMIServerSocketFactory ssf = (RMIServerSocketFactory)
            env.get(RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE);
        return new RMIJRMPServerImpl(port, csf, ssf, env);
    }
View Full Code Here

Examples of java.rmi.server.RMIClientSocketFactory

            // a custom RMIClientSocketFactory
            Map<String, Object> props = agent.getConnectorServerProperties();
            Map<String, Object> mergedProps = new HashMap<String, Object>(props.size() + 1);
            mergedProps.putAll(props);
           
            RMIClientSocketFactory factory = new FixedHostRmiClientSocketFactory(host);
            mergedProps.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE,
                            factory);
            agent.setConnectorServerProperties(mergedProps);
        }
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.