APIdia Launch Partner
Top Description Fields Constructors Methods
javax.rmi.ssl

public Class SslRMIClientSocketFactory

extends Object
implements RMIClientSocketFactory, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.rmi.server.RMIClientSocketFactory
Imports
java.io.IOException, .Serializable, java.net.Socket, java.rmi.server.RMIClientSocketFactory, java.util.StringTokenizer, javax.net.SocketFactory, javax.net.ssl.SSLParameters, .SSLSocket, .SSLSocketFactory

An SslRMIClientSocketFactory instance is used by the RMI runtime in order to obtain client sockets for RMI calls via SSL.

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

This class creates SSL sockets using the default SSLSocketFactory (see SSLSocketFactory#getDefault). All instances of this class are functionally equivalent. In particular, they all share the same truststore, and the same keystore when client authentication is required by the server. This behavior can be modified in subclasses by overriding the createSocket(String, int) method; in that case, equals and hashCode may also need to be overridden.

If the system property javax.rmi.ssl.client.enabledCipherSuites is specified, the createSocket(String, int) method will call SSLSocket#setEnabledCipherSuites(String[]) before returning the socket. The value of this system property is a string that is a comma-separated list of SSL/TLS cipher suites to enable.

If the system property javax.rmi.ssl.client.enabledProtocols is specified, the createSocket(String, int) method will call SSLSocket#setEnabledProtocols(String[]) before returning the socket. The value of this system property is a string that is a comma-separated list of SSL/TLS protocol versions to enable.

Since
1.5
See Also
javax.net.ssl.SSLSocketFactory, javax.rmi.ssl.SslRMIServerSocketFactory

Field Summary

Modifier and TypeField and Description
private static SocketFactory
private static final long

Constructor Summary

AccessConstructor and Description
public
SslRMIClientSocketFactory()

Creates a new SslRMIClientSocketFactory.

Method Summary

Modifier and TypeMethod and Description
public Socket
createSocket(String host, int port)

Implements java.rmi.server.RMIClientSocketFactory.createSocket.

Creates an SSL socket.

public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

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

private static synchronized SocketFactory
public int

Returns:

a hash code value for this SslRMIClientSocketFactory.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this SslRMIClientSocketFactory.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultSocketFactoryback to summary
private static SocketFactory defaultSocketFactory
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

SslRMIClientSocketFactoryback to summary
public SslRMIClientSocketFactory()

Creates a new SslRMIClientSocketFactory.

Method Detail

createSocketback to summary
public Socket createSocket(String host, int port) throws IOException

Implements java.rmi.server.RMIClientSocketFactory.createSocket.

Creates an SSL socket.

If the system property javax.rmi.ssl.client.enabledCipherSuites is specified, this method will call SSLSocket#setEnabledCipherSuites(String[]) before returning the socket. The value of this system property is a string that is a comma-separated list of SSL/TLS cipher suites to enable.

If the system property javax.rmi.ssl.client.enabledProtocols is specified, this method will call SSLSocket#setEnabledProtocols(String[]) before returning the socket. The value of this system property is a string that is a comma-separated list of SSL/TLS protocol versions to enable.

Exceptions
IOException:

Doc from java.rmi.server.RMIClientSocketFactory.createSocket.

if an I/O error occurs during socket creation

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

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

Because all instances of this class are functionally equivalent (they all use the default SSLSocketFactory), this method simply returns this.getClass().equals(obj.getClass()).

A subclass should override this method (as well as hashCode()) if its instances are not all functionally equivalent.

getDefaultClientSocketFactoryback to summary
private static synchronized SocketFactory getDefaultClientSocketFactory()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this SslRMIClientSocketFactory.

Returns:int

a hash code value for this SslRMIClientSocketFactory.