public final class ConfigurableRMIClientSocketFactory
extends java.lang.Object
implements java.io.Serializable, java.rmi.server.RMIClientSocketFactory
Modifier and Type | Field and Description |
---|---|
private static int |
ONE_SECOND |
private static long |
serialVersionUID |
private int |
socketTimeoutMillis |
Constructor and Description |
---|
ConfigurableRMIClientSocketFactory(java.lang.Integer socketTimeoutMillis)
Construct a new socket factory with the given timeout.
|
Modifier and Type | Method and Description |
---|---|
java.net.Socket |
createSocket(java.lang.String host,
int port)
Create a client socket connected to the specified host and port.
|
boolean |
equals(java.lang.Object object)
The standard hashCode method which is necessary for SocketFactory classes.
|
static java.rmi.server.RMISocketFactory |
getConfiguredRMISocketFactory()
Return the JVM-level configured
RMISocketFactory . |
int |
hashCode()
Implements the Object hashCode method.
|
private static final int ONE_SECOND
private static final long serialVersionUID
private final int socketTimeoutMillis
public ConfigurableRMIClientSocketFactory(java.lang.Integer socketTimeoutMillis)
socketTimeoutMillis
- Socket.setSoTimeout(int)
public java.net.Socket createSocket(java.lang.String host, int port) throws java.io.IOException
Socket socket = new Socket(host, port, localInterface , 0);
createSocket
in interface java.rmi.server.RMIClientSocketFactory
host
- the host nameport
- the port numberjava.io.IOException
- if an I/O error occurs during socket creationpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- the comparison objectpublic static java.rmi.server.RMISocketFactory getConfiguredRMISocketFactory()
RMISocketFactory
.
If a global socket factory has been set via the
RMISocketFactory.setSocketFactory(RMISocketFactory)
method then
that factory will be returned. Otherwise the default socket factory as
returned by RMISocketFactory.getDefaultSocketFactory()
is used
instead.
RMISocketFactory