org.objectweb.carol.irmi
Class CountSocketFactory

java.lang.Object
  extended by java.rmi.server.RMISocketFactory
      extended by org.objectweb.carol.irmi.CountSocketFactory
All Implemented Interfaces:
RMIClientSocketFactory, RMIServerSocketFactory

public class CountSocketFactory
extends RMISocketFactory

CountSocketFactory is an RMISocketFactory implementation that uses CountOutputStream and CountInputStream to record the time and number of bytes involved in the I/O operations of any RMI implementation that uses RMISocketFactory. This class uses the Timer class to record timing information and report results.

Author:
Rafael H. Schloming <rhs@mit.edu>
See Also:
Timer

Method Summary
 ServerSocket createServerSocket(int port)
           
 Socket createSocket(String host, int port)
           
static void install()
          Static utility method used to install an instance of CountSocketFactory as the current RMISocketFactory.
 
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

install

public static final void install()

Static utility method used to install an instance of CountSocketFactory as the current RMISocketFactory. Note that the RMISocketFactory.setSocketFactory(RMISocketFactory) can only be set once, and must be set before any RMI operations have been performed. Therefore this method must be called exactly once near the beginning of a programs execution in order for the results reported to be accurate. This method is just a convenience for calling:

     RMISocketFactory.setSocketFactory(new CountSocketFactory());
 


createServerSocket

public ServerSocket createServerSocket(int port)
                                throws IOException
Specified by:
createServerSocket in interface RMIServerSocketFactory
Specified by:
createServerSocket in class RMISocketFactory
Throws:
IOException

createSocket

public Socket createSocket(String host,
                           int port)
                    throws IOException
Specified by:
createSocket in interface RMIClientSocketFactory
Specified by:
createSocket in class RMISocketFactory
Throws:
IOException