Class DirectoryRMIServerSocketFactory

  • All Implemented Interfaces:
    RMIServerSocketFactory

    public class DirectoryRMIServerSocketFactory
    extends Object
    implements RMIServerSocketFactory
    A DirectoryRMIServerSocketFactory instance is used by the RMI runtime in order to obtain server sockets for RMI calls via SSL.

    This class implements RMIServerSocketFactory over the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) protocols.

    • Constructor Detail

      • DirectoryRMIServerSocketFactory

        public DirectoryRMIServerSocketFactory​(SSLSocketFactory sslSocketFactory,
                                               boolean needClientCertificate,
                                               InetAddress listenAddress)
        Constructs a new DirectoryRMIServerSocketFactory with the specified SSL socket configuration.
        Parameters:
        sslSocketFactory - the SSL socket factory to be used by this factory
        needClientCertificate - true to require client authentication on SSL connections accepted by server sockets created by this factory; false to not require client authentication.
        listenAddress - the address the server sockets created by this factory listen on
    • Method Detail

      • getNeedClientCertificate

        public final boolean getNeedClientCertificate()

        Returns true if client authentication is required on SSL connections accepted by server sockets created by this factory.

        Returns:
        true if client authentication is required
        See Also:
        SSLSocket.setNeedClientAuth(boolean)
      • createServerSocket

        public ServerSocket createServerSocket​(int port)
                                        throws IOException
        Creates a server socket that accepts SSL connections configured according to this factory's SSL socket configuration parameters.
        Specified by:
        createServerSocket in interface RMIServerSocketFactory
        Parameters:
        port - the port number the socket listens to
        Returns:
        a server socket
        Throws:
        IOException - if the socket cannot be created
      • equals

        public boolean equals​(Object obj)

        Indicates whether some other object is "equal to" this one.

        Two CacaoRMIServerSocketFactory objects are equal if they have been constructed with the same SSL socket configuration parameters.

        A subclass should override this method (as well as hashCode()) if it adds instance state that affects equality.

        Overrides:
        equals in class Object
        Parameters:
        obj - the reference object with which to compare.
        Returns:
        true if this object is the same as the obj argument false otherwise.
      • hashCode

        public int hashCode()

        Returns a hash code value for this CacaoRMIServerSocketFactory.

        Overrides:
        hashCode in class Object
        Returns:
        a hash code value for this CacaoRMIServerSocketFactory.