Examples of RMIServerSocketFactory


Examples of java.rmi.server.RMIServerSocketFactory

            // application is already running on the configured host/port
            // or if the rmiHost is not local
            try {
                // find the server socket factory: use the default if the
                // rmiHost is not configured
                RMIServerSocketFactory sf;
                if (rmiHost.length() > 0) {
                    log.debug("Creating RMIServerSocketFactory for host " + rmiHost);
                    InetAddress hostAddress = InetAddress.getByName(rmiHost);
                    sf = getRMIServerSocketFactory(hostAddress);
                } else {
View Full Code Here

Examples of java.rmi.server.RMIServerSocketFactory

     *      creating <code>java.net.ServerSocket</code> instances bound to
     *      the <code>rmiHost</code>.
     */
    protected RMIServerSocketFactory getRMIServerSocketFactory(
            final InetAddress hostAddress) {
        return new RMIServerSocketFactory() {
            public ServerSocket createServerSocket(int port) throws IOException {
                return new ServerSocket(port, -1, hostAddress);
            }
        };
    }
View Full Code Here

Examples of java.rmi.server.RMIServerSocketFactory

    private void startRegistryAndConnector() throws IOException
    {
        //Socket factories for the RMIConnectorServer, either default or SSL depending on configuration
        RMIClientSocketFactory csf;
        RMIServerSocketFactory ssf;

        //check ssl enabled option on connector port (note we don't provide ssl for registry server at
        //moment).
        boolean connectorSslEnabled = _connectorPort.getTransports().contains(Transport.SSL);
View Full Code Here

Examples of java.rmi.server.RMIServerSocketFactory

        }
    }

    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.RMIServerSocketFactory

   protected RMIServerImpl createRMIServer(JMXServiceURL url, Map environment) throws IOException
   {
      int port = url.getPort();
      RMIClientSocketFactory clientFactory = (RMIClientSocketFactory)environment.get(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE);
      RMIServerSocketFactory serverFactory = (RMIServerSocketFactory)environment.get(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE);
      return new RMIJRMPServerImpl(port, clientFactory, serverFactory, environment);
   }
View Full Code Here

Examples of java.rmi.server.RMIServerSocketFactory

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

            RMIClientSocketFactory csf = null;
            RMIServerSocketFactory ssf = null;

            // Configure SSL for RMI connection if required
            if (rmiSSL) {
                csf = new SslRMIClientSocketFactory();
                ssf = new SslRMIServerSocketFactory(ciphers, protocols,
View Full Code Here

Examples of java.rmi.server.RMIServerSocketFactory

        System.setProperty("java.rmi.server.RMIClassLoaderSpi",RMIClassLoaderSpiImpl.class.getName());
        if (System.getProperty("java.rmi.server.hostname") == null && host != null && !host.equals("0.0.0.0")) {
            System.setProperty("java.rmi.server.hostname", host);
        }
        RMIClientSocketFactory socketFactory = RMISocketFactory.getDefaultSocketFactory();
        RMIServerSocketFactory serverSocketFactory = new GeronimoRMIServerSocketFactory(host);
        registry = LocateRegistry.createRegistry(port, socketFactory, serverSocketFactory);
        log.debug("Started RMI Registry on port " + port);
    }
View Full Code Here

Examples of java.rmi.server.RMIServerSocketFactory

        } else {
            log.warn("Starting unauthenticating JMXConnector for " + jmxServiceURL);
        }
       
        SSLServerSocketFactory sssf = keystoreManager.createSSLServerFactory(null, secureProtocol, algorithm, keyStore, keyAlias, trustStore, classLoader);
        RMIServerSocketFactory rssf = new GeronimoSslRMIServerSocketFactory(sssf, 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);
View Full Code Here

Examples of java.rmi.server.RMIServerSocketFactory

            // application is already running on the configured host/port
            // or if the rmiHost is not local
            try {
                // find the server socket factory: use the default if the
                // rmiHost is not configured
                RMIServerSocketFactory sf;
                if (rmiHost.length() > 0) {
                    log.debug("Creating RMIServerSocketFactory for host " + rmiHost);
                    InetAddress hostAddress = InetAddress.getByName(rmiHost);
                    sf = getRMIServerSocketFactory(hostAddress);
                } else {
View Full Code Here

Examples of java.rmi.server.RMIServerSocketFactory

     *      creating <code>java.net.ServerSocket</code> instances bound to
     *      the <code>rmiHost</code>.
     */
    protected RMIServerSocketFactory getRMIServerSocketFactory(
            final InetAddress hostAddress) {
        return new RMIServerSocketFactory() {
            public ServerSocket createServerSocket(int port) throws IOException {
                return new ServerSocket(port, -1, hostAddress);
            }
        };
    }
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.