org.jscience.computing.distributed.server
Class FixedPortRMISocketFactory

java.lang.Object
  extended by java.rmi.server.RMISocketFactory
      extended by org.jscience.computing.distributed.server.FixedPortRMISocketFactory
All Implemented Interfaces:
java.rmi.server.RMIClientSocketFactory, java.rmi.server.RMIServerSocketFactory

public class FixedPortRMISocketFactory
extends java.rmi.server.RMISocketFactory


Constructor Summary
FixedPortRMISocketFactory(int fixedPort)
          Creates a FixedPortRMISocketFactory.
 
Method Summary
 java.net.ServerSocket createServerSocket(int port)
          Create a server socket on the specified port (port 0 indicates an anonymous port) and writes out some debugging info
 java.net.Socket createSocket(java.lang.String host, int port)
          Creates a client socket connected to the specified host and port and writes out debugging info
 
Methods inherited from class java.rmi.server.RMISocketFactory
getDefaultSocketFactory, getFailureHandler, getSocketFactory, setFailureHandler, setSocketFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedPortRMISocketFactory

public FixedPortRMISocketFactory(int fixedPort)
Creates a FixedPortRMISocketFactory.

Parameters:
fixedPort - Port at which anonymous (requested as port 0) server sockets should be created. If this is equal to 0 then the Java default policy of selecting a random port will be followed.
Method Detail

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port)
                             throws java.io.IOException
Creates a client socket connected to the specified host and port and writes out debugging info

Specified by:
createSocket in interface java.rmi.server.RMIClientSocketFactory
Specified by:
createSocket in class java.rmi.server.RMISocketFactory
Parameters:
host - the host name
port - the port number
Returns:
a socket connected to the specified host and port.
Throws:
java.io.IOException - if an I/O error occurs during socket creation

createServerSocket

public java.net.ServerSocket createServerSocket(int port)
                                         throws java.io.IOException
Create a server socket on the specified port (port 0 indicates an anonymous port) and writes out some debugging info

Specified by:
createServerSocket in interface java.rmi.server.RMIServerSocketFactory
Specified by:
createServerSocket in class java.rmi.server.RMISocketFactory
Parameters:
port - the port number
Returns:
the server socket on the specified port
Throws:
java.io.IOException - if an I/O error occurs during server socket creation