public class CountSocketFactory extends 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 |
|---|---|
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.
|
getDefaultSocketFactory, getFailureHandler, getSocketFactory, setFailureHandler, setSocketFactorypublic 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 ServerSocket createServerSocket(int port) throws IOException
createServerSocket in interface RMIServerSocketFactorycreateServerSocket in class RMISocketFactoryIOExceptionpublic Socket createSocket(String host, int port) throws IOException
createSocket in interface RMIClientSocketFactorycreateSocket in class RMISocketFactoryIOException