com.sun.faban.harness.agent
Class AgentSocketFactory

java.lang.Object
  extended by java.rmi.server.RMISocketFactory
      extended by com.sun.faban.harness.agent.AgentSocketFactory
All Implemented Interfaces:
RMIClientSocketFactory, RMIServerSocketFactory

public class AgentSocketFactory
extends RMISocketFactory
implements RMIClientSocketFactory

This class implements the SocketFactory used by all machines in the SUT to communicate with the master-machine. All machines should use this SocketFactory instead of the RMI default one to take care of RMI problems related to multi-homed hosts.

Author:
Ramesh Ramachandran

Method Summary
 ServerSocket createServerSocket(int port)
          This method just calls the superClass createServerSocket method to create a ServerSocket.
 Socket createSocket(String host, int port)
          Overrides the createSocket method of the RMISocketFactory superclass.
 
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
 

Method Detail

createSocket

public Socket createSocket(String host,
                           int port)
                    throws IOException
Overrides the createSocket method of the RMISocketFactory superclass. It uses the superclass SocketFactory methods to create a socket to the appropriate master-machine interface.

Specified by:
createSocket in interface RMIClientSocketFactory
Specified by:
createSocket in class RMISocketFactory
Parameters:
host - - the destination host.
port - - the port number to connect to.
Returns:
Socket - returns a client socket representing this connection.
Throws:
IOException - Error creating the socket
See Also:
RMISocketFactory

createServerSocket

public ServerSocket createServerSocket(int port)
                                throws IOException
This method just calls the superClass createServerSocket method to create a ServerSocket.

Specified by:
createServerSocket in interface RMIServerSocketFactory
Specified by:
createServerSocket in class RMISocketFactory
Parameters:
port - The port to bind
Returns:
The resulting server socket
Throws:
IOException - Error creating the socket
See Also:
RMISocketFactory