public class

SSLContextRMIServerSocketFactory

extends SslRMIServerSocketFactory
java.lang.Object
   ↳ javax.rmi.ssl.SslRMIServerSocketFactory
     ↳ sun.management.jmxremote.SSLContextRMIServerSocketFactory

Class Overview

This class represents a specialized version of the SslRMIServerSocketFactory class that allows to supply an SSLContext.

Summary

Public Constructors
SSLContextRMIServerSocketFactory(SSLContext context)

Creates a new SSLContextRMIServerSocketFactory with SSL sockets created from the SSLSocketFactory returned by the given SSLContext and configured with the default SSL parameters.

SSLContextRMIServerSocketFactory(SSLContext context, String[] enabledCipherSuites, String[] enabledProtocols, boolean needClientAuth)

Creates a new SSLContextRMIServerSocketFactory with SSL sockets created from the SSLSocketFactory returned by the given SSLContext and configured with the supplied SSL parameters.

Public Methods
ServerSocket createServerSocket(int port)

Creates a server socket that accepts SSL connections configured according to this factory's SSL socket configuration parameters.

boolean equals(Object obj)

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

int hashCode()

Returns a hash code value for this SSLContextRMIServerSocketFactory.

[Expand]
Inherited Methods
From class javax.rmi.ssl.SslRMIServerSocketFactory
From class java.lang.Object
From interface java.rmi.server.RMIServerSocketFactory

Public Constructors

public SSLContextRMIServerSocketFactory (SSLContext context)

Creates a new SSLContextRMIServerSocketFactory with SSL sockets created from the SSLSocketFactory returned by the given SSLContext and configured with the default SSL parameters.

SSL connections accepted by server sockets created by this factory have the default cipher suites and protocol versions enabled and do not require client authentication.

Parameters
context the SSL context to be used for creating SSL sockets. Calling this constructor with a null context is equivalent to calling SslRMIServerSocketFactory().

public SSLContextRMIServerSocketFactory (SSLContext context, String[] enabledCipherSuites, String[] enabledProtocols, boolean needClientAuth)

Creates a new SSLContextRMIServerSocketFactory with SSL sockets created from the SSLSocketFactory returned by the given SSLContext and configured with the supplied SSL parameters.

Parameters
context the SSL context to be used for creating SSL sockets. Calling this constructor with a null context is equivalent to calling SslRMIServerSocketFactory(enabledCipherSuites, enabledProtocols, needClientAuth).
enabledCipherSuites names of all the cipher suites to enable on SSL connections accepted by server sockets created by this factory, or null to use the cipher suites that are enabled by default
enabledProtocols names of all the protocol versions to enable on SSL connections accepted by server sockets created by this factory, or null to use the protocol versions that are enabled by default
needClientAuth true to require client authentication on SSL connections accepted by server sockets created by this factory; false to not require client authentication
Throws
IllegalArgumentException when one or more of the cipher suites named by the enabledCipherSuites parameter is not supported, when one or more of the protocols named by the enabledProtocols parameter is not supported or when a problem is encountered while trying to check if the supplied cipher suites and protocols to be enabled are supported.

Public Methods

public ServerSocket createServerSocket (int port)

Creates a server socket that accepts SSL connections configured according to this factory's SSL socket configuration parameters. If a null SSLContext was supplied in the constructor this method just calls super.createServerSocket(port). Otherwise, the SSLSocketFactory returned by the call to SSLContext.getSocketFactory() will be used to create the SSL sockets.

Parameters
port the port number
Returns
  • the server socket on the specified port
Throws
IOException

public boolean equals (Object obj)

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

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

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

Parameters
obj the reference object with which to compare.
Returns
  • true if this object is the same as the obj argument; false otherwise.

public int hashCode ()

Returns a hash code value for this SSLContextRMIServerSocketFactory.

Returns
  • a hash code value for this SSLContextRMIServerSocketFactory.