Methods Summary |
---|
public java.net.ServerSocket | createServerSocket(int port)Implementation of the only method in {@link RMIServerSocketFactory}. This
method is called for creating the server socket.
try {
InetAddress bindAddress = null;
ServerSocket ss = null;
if (address.equals(DEFAULT_ADDRESS))
ss = new ServerSocket(port);
else {
bindAddress = InetAddress.getByName(address);
ss = new ServerSocket(port, 0, bindAddress);
}
debug(ss);
return (ss);
} catch (Exception e) {
throw new IOException(e.getMessage());
}
|
private void | debug(java.net.ServerSocket sss)
// prints the debug information - suppress after beta
String prefix = "RMI/TLS Server Debug Message: " ;
boolean DEBUG = Boolean.getBoolean("Debug");
if (sss != null) {
if (DEBUG) {
System.out.println(prefix + "ServerSocket local port = " + sss.getLocalPort());
System.out.println(prefix + "ServerSocket host address = " + sss.getInetAddress().getHostAddress());
System.out.println(prefix + "ServerSocket bound status = " + sss.isBound());
}
}
else {
System.out.println(prefix + " Catastrophe: no server socket");
}
|
public boolean | equals(java.lang.Object anotherFactory)Overriding the base class method here to ensure that when a functionally
equivalent instance of server socket factory is passed, the same factory
is reused instead of creating new objects
if (anotherFactory != null &&
anotherFactory.getClass().equals(this.getClass())) {
RMIMultiHomedServerSocketFactory rmhssf =
(RMIMultiHomedServerSocketFactory) anotherFactory;
if (this.address == null && rmhssf.address == null) return true;
if (this.address == null ^ rmhssf.address == null) return false;
return this.address.equals(rmhssf.address);
}
return false;
|
public int | hashCode()
return super.hashCode() ^ address.hashCode();
|