cluster5.shared.rmi
Class FixedPortRMISocketFactory
java.lang.Object
java.rmi.server.RMISocketFactory
cluster5.shared.rmi.FixedPortRMISocketFactory
- All Implemented Interfaces:
- java.rmi.server.RMIClientSocketFactory, java.rmi.server.RMIServerSocketFactory
public class FixedPortRMISocketFactory
- extends java.rmi.server.RMISocketFactory
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. |
Methods inherited from class java.rmi.server.RMISocketFactory |
getDefaultSocketFactory, getFailureHandler, getSocketFactory, setFailureHandler, setSocketFactory |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FixedPortRMISocketFactory
public FixedPortRMISocketFactory()
- Creates new RMI socket factory on default port.
FixedPortRMISocketFactory
public FixedPortRMISocketFactory(int port)
- Creates new RMI socket factory with specified fixed port
- Parameters:
port
-
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.
- Specified by:
createSocket
in interface java.rmi.server.RMIClientSocketFactory
- Specified by:
createSocket
in class java.rmi.server.RMISocketFactory
- Parameters:
host
- the host nameport
- 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.