javax.rmi.ssl
Class SslRMIClientSocketFactory

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.rmi.ssl.SslRMIClientSocketFactory
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , RMIClientSocketFactory sample code for java.rmi.server.RMIClientSocketFactory definition code for java.rmi.server.RMIClientSocketFactory

public class SslRMIClientSocketFactory
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements RMIClientSocketFactory sample code for java.rmi.server.RMIClientSocketFactory definition code for java.rmi.server.RMIClientSocketFactory , Serializable sample code for java.io.Serializable definition code for java.io.Serializable

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) sample code for javax.rmi.ssl.SslRMIClientSocketFactory.createSocket(java.lang.String, int) definition code for javax.rmi.ssl.SslRMIClientSocketFactory.createSocket(java.lang.String, int) method; in that case, equals sample code for javax.rmi.ssl.SslRMIClientSocketFactory.equals(java.lang.Object) definition code for javax.rmi.ssl.SslRMIClientSocketFactory.equals(java.lang.Object) and hashCode sample code for javax.rmi.ssl.SslRMIClientSocketFactory.hashCode() definition code for javax.rmi.ssl.SslRMIClientSocketFactory.hashCode() may also need to be overridden.

If the system property javax.rmi.ssl.client.enabledCipherSuites is specified, the createSocket(String,int) sample code for javax.rmi.ssl.SslRMIClientSocketFactory.createSocket(java.lang.String, int) definition code for javax.rmi.ssl.SslRMIClientSocketFactory.createSocket(java.lang.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) sample code for javax.rmi.ssl.SslRMIClientSocketFactory.createSocket(java.lang.String, int) definition code for javax.rmi.ssl.SslRMIClientSocketFactory.createSocket(java.lang.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:
SSLSocketFactory, SslRMIServerSocketFactory sample code for javax.rmi.ssl.SslRMIServerSocketFactory definition code for javax.rmi.ssl.SslRMIServerSocketFactory , Serialized Form

Constructor Summary
SslRMIClientSocketFactory sample code for javax.rmi.ssl.SslRMIClientSocketFactory.SslRMIClientSocketFactory() definition code for javax.rmi.ssl.SslRMIClientSocketFactory.SslRMIClientSocketFactory() ()
          Creates a new SslRMIClientSocketFactory.
 
Method Summary
 Socket sample code for java.net.Socket definition code for java.net.Socket createSocket sample code for javax.rmi.ssl.SslRMIClientSocketFactory.createSocket(java.lang.String, int) definition code for javax.rmi.ssl.SslRMIClientSocketFactory.createSocket(java.lang.String, int) (String sample code for java.lang.String definition code for java.lang.String  host, int port)
          Creates an SSL socket.
 boolean equals sample code for javax.rmi.ssl.SslRMIClientSocketFactory.equals(java.lang.Object) definition code for javax.rmi.ssl.SslRMIClientSocketFactory.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Indicates whether some other object is "equal to" this one.
 int hashCode sample code for javax.rmi.ssl.SslRMIClientSocketFactory.hashCode() definition code for javax.rmi.ssl.SslRMIClientSocketFactory.hashCode() ()
          Returns a hash code value for this SslRMIClientSocketFactory.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

SslRMIClientSocketFactory sample code for javax.rmi.ssl.SslRMIClientSocketFactory() definition code for javax.rmi.ssl.SslRMIClientSocketFactory()

public SslRMIClientSocketFactory()

Creates a new SslRMIClientSocketFactory.

Method Detail

createSocket sample code for javax.rmi.ssl.SslRMIClientSocketFactory.createSocket(java.lang.String, int) definition code for javax.rmi.ssl.SslRMIClientSocketFactory.createSocket(java.lang.String, int)

public Socket sample code for java.net.Socket definition code for java.net.Socket  createSocket(String sample code for java.lang.String definition code for java.lang.String  host,
                           int port)
                    throws IOException sample code for java.io.IOException definition code for java.io.IOException 

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.

Specified by:
createSocket sample code for java.rmi.server.RMIClientSocketFactory.createSocket(java.lang.String, int) definition code for java.rmi.server.RMIClientSocketFactory.createSocket(java.lang.String, int) in interface RMIClientSocketFactory sample code for java.rmi.server.RMIClientSocketFactory definition code for java.rmi.server.RMIClientSocketFactory
Parameters:
host - the host name
port - the port number
Returns:
a socket connected to the specified host and port.
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during socket creation

equals sample code for javax.rmi.ssl.SslRMIClientSocketFactory.equals(java.lang.Object) definition code for javax.rmi.ssl.SslRMIClientSocketFactory.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  obj)

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() sample code for javax.rmi.ssl.SslRMIClientSocketFactory.hashCode() definition code for javax.rmi.ssl.SslRMIClientSocketFactory.hashCode() ) if its instances are not all functionally equivalent.

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

hashCode sample code for javax.rmi.ssl.SslRMIClientSocketFactory.hashCode() definition code for javax.rmi.ssl.SslRMIClientSocketFactory.hashCode()

public int hashCode()

Returns a hash code value for this SslRMIClientSocketFactory.

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a hash code value for this SslRMIClientSocketFactory.
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable