Package java.rmi.server

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


        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();

        if (sslEnabled)
View Full Code Here

      }
      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
      {
         throw new MalformedURLException("Can not create connector server.  Protocol must be either 'rmi', 'iiop', or null.");
View Full Code Here

    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

    private static RMIServerImpl newJRMPServer(Map 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

        final JMXConnectorServer cs;
        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();

        if (sslEnabled)
View Full Code Here

            // 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

     *      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

     */
    private void createConnector(MBeanServer mbeanServer) throws MalformedObjectNameException, MalformedURLException, IOException {
        // Create the NamingService, needed by JSR 160
        try {
            if (registry == null) {
                registry = LocateRegistry.createRegistry(connectorPort, null, new RMIServerSocketFactory() {
                    public ServerSocket createServerSocket(int port)
                            throws IOException {
                        ServerSocket result = new ServerSocket(port);
                        result.setReuseAddress(true);
                        return result;
View Full Code Here

                JmxServiceUrlFactory.localhost(this.bindAddress), this.port);
        }
    }
    private void prepare() {
        if (protocol == RemoteJmxProtocol.RMIJRMP) {
            RMIServerSocketFactory rmiregssf = new RMIServerSocketFactory() {
                public ServerSocket createServerSocket(int port)
                                throws IOException {
                    return new ServerSocket(
                        port, 0, InetAddress.getByName(bindAddress));
                }
View Full Code Here

TOP

Related Classes of java.rmi.server.RMIServerSocketFactory

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.