Package java.rmi.server

Examples of java.rmi.server.RMIClientSocketFactory


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

            // 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();
View Full Code Here


         clientConnectHost = bindHost;
      }

      locator.setHomeInUse(bindHome);
      RMIServerSocketFactory ssf = new RemotingRMIServerSocketFactory(getServerSocketFactory(), BACKLOG_DEFAULT, bindHost, getTimeout());
      RMIClientSocketFactory csf = getRMIClientSocketFactory(clientConnectHost);
      stub = UnicastRemoteObject.exportObject(this, bindPort, csf, ssf);

      log.debug("Binding server to \"remoting/RMIServerInvoker/" + bindPort + "\" in registry");
      registry.rebind("remoting/RMIServerInvoker/" + bindPort, this);
View Full Code Here

    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

            LiveRef ref = (LiveRef) obj;

            TCPEndpoint thisEp = ((TCPEndpoint) ep);
            TCPEndpoint refEp = ((TCPEndpoint) ref.ep);

            RMIClientSocketFactory thisClientFactory =
                thisEp.getClientSocketFactory();
            RMIClientSocketFactory refClientFactory =
                refEp.getClientSocketFactory();

            /**
             * Fix for 4254103: LiveRef.remoteEquals should not fail
             * if one of the objects in the comparison has a null
             * server socket.  Comparison should only consider the
             * following criteria:
             *
             * hosts, ports, client socket factories and object IDs.
             */
            if (thisEp.getPort() != refEp.getPort() ||
                !thisEp.getHost().equals(refEp.getHost()))
            {
                return false;
            }
            if ((thisClientFactory == null) ^ (refClientFactory == null)) {
                return false;
            }
            if ((thisClientFactory != null) &&
                !((thisClientFactory.getClass() ==
                   refClientFactory.getClass()) &&
                  (thisClientFactory.equals(refClientFactory))))
            {
                return false;
            }
            return (id.equals(ref.id));
View Full Code Here

    public static TCPEndpoint read(ObjectInput in)
        throws IOException, ClassNotFoundException
    {
        String host;
        int port;
        RMIClientSocketFactory csf = null;

        byte format = in.readByte();
        switch (format) {
          case FORMAT_HOST_PORT:
            host = in.readUTF();
View Full Code Here

        }

        Socket socket;

        try {
            RMIClientSocketFactory clientFactory = csf;
            if (clientFactory == null) {
                clientFactory = chooseFactory();
            }
            socket = clientFactory.createSocket(host, port);

        } catch (java.net.UnknownHostException e) {
            throw new java.rmi.UnknownHostException(
                "Unknown host: " + host, e);
        } catch (java.net.ConnectException e) {
View Full Code Here

                env.put(JMXConnectorServer.AUTHENTICATOR,
                        new AccessFileCheckerAuthenticator(env));
            }
        }

        RMIClientSocketFactory csf = null;
        RMIServerSocketFactory ssf = null;

        if (useSsl || useRegistrySsl) {
            csf = new SslRMIClientSocketFactory();
            ssf = createSslRMIServerSocketFactory(
View Full Code Here

      {
         clientConnectHost = bindHost;
      }

      RMIServerSocketFactory ssf = new RemotingRMIServerSocketFactory(getServerSocketFactory(), BACKLOG_DEFAULT, bindHost, getTimeout());
      RMIClientSocketFactory csf = new RemotingRMIClientSocketFactory(getSocketFactory(), clientConnectHost, getTimeout());
      stub = UnicastRemoteObject.exportObject(this, bindPort, csf, ssf);

      log.debug("Binding registry to " + "remoting/RMIServerInvoker/" + bindPort);
      registry.rebind("remoting/RMIServerInvoker/" + bindPort, this);
View Full Code Here

        if (readCsf) {
            inCsf = in.readUnsignedByte();
        }
        String host = (String) in.readUTF();
        int port = in.readInt();
        RMIClientSocketFactory csf = null;

        if (readCsf && inCsf == NONNULL_CSF) {
            csf = (RMIClientSocketFactory) in.readObject();
        }
        return new Endpoint(host, port, csf, null);
View Full Code Here

     *
     * @return non-null RMIClientSocketFactory
     */
    public static RMIClientSocketFactory getNonNullClientFactory(
            RMIClientSocketFactory csf) {
        RMIClientSocketFactory factory =
                (csf == null) ? getSocketFactory() : csf;
        return (factory == null) ? getDefaultSocketFactory() : factory;
    }
View Full Code Here

TOP

Related Classes of java.rmi.server.RMIClientSocketFactory

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.