public class CountSocketFactory
extends java.rmi.server.RMISocketFactory
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.Timer| Modifier and Type | Method and Description |
|---|---|
java.net.ServerSocket |
createServerSocket(int port) |
java.net.Socket |
createSocket(java.lang.String host,
int port) |
static void |
install()
Static utility method used to install an instance of
CountSocketFactory as the current RMISocketFactory.
|
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());
public java.net.ServerSocket createServerSocket(int port)
throws java.io.IOException
createServerSocket in interface java.rmi.server.RMIServerSocketFactorycreateServerSocket in class java.rmi.server.RMISocketFactoryjava.io.IOExceptionpublic java.net.Socket createSocket(java.lang.String host,
int port)
throws java.io.IOException
createSocket in interface java.rmi.server.RMIClientSocketFactorycreateSocket in class java.rmi.server.RMISocketFactoryjava.io.IOException