org.objectweb.carol.irmi
Class CountSocketFactory
java.lang.Object
java.rmi.server.RMISocketFactory
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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