org.mbari.siam.utils
Class ClientSocketFactory

java.lang.Object
  extended by java.rmi.server.RMISocketFactory
      extended by org.mbari.siam.utils.ClientSocketFactory
All Implemented Interfaces:
java.rmi.server.RMIClientSocketFactory, java.rmi.server.RMIServerSocketFactory

public class ClientSocketFactory
extends java.rmi.server.RMISocketFactory

ClientSocketFactory creates client sockets that timeout more cleanly than the default RMI stuff. SIAM service clients may find this class to be useful.


Field Summary
protected  int _connectTimeout
           
protected  java.rmi.server.RMISocketFactory _defaultFactory
           
protected  int _readTimeout
           
protected  java.net.Socket _socket
           
 
Constructor Summary
ClientSocketFactory(int connectTimeout, int readTimeout)
          Create the socket factory, specifying the inet name of the remote node server.
 
Method Summary
 java.net.ServerSocket createServerSocket(int port)
          Create a server socket; just returns a plain vanilla java.net.ServerSocket.
 java.net.Socket createSocket(java.lang.String host, int port)
          Create a client socket; socket gets a timeout setting.
 
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
 

Field Detail

_defaultFactory

protected java.rmi.server.RMISocketFactory _defaultFactory

_connectTimeout

protected int _connectTimeout

_readTimeout

protected int _readTimeout

_socket

protected java.net.Socket _socket
Constructor Detail

ClientSocketFactory

public ClientSocketFactory(int connectTimeout,
                           int readTimeout)
Create the socket factory, specifying the inet name of the remote node server.

Method Detail

createServerSocket

public java.net.ServerSocket createServerSocket(int port)
                                         throws java.io.IOException
Create a server socket; just returns a plain vanilla java.net.ServerSocket.

Specified by:
createServerSocket in interface java.rmi.server.RMIServerSocketFactory
Specified by:
createServerSocket in class java.rmi.server.RMISocketFactory
Throws:
java.io.IOException

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port)
                             throws java.io.IOException
Create a client socket; socket gets a timeout setting.

Specified by:
createSocket in interface java.rmi.server.RMIClientSocketFactory
Specified by:
createSocket in class java.rmi.server.RMISocketFactory
Throws:
java.io.IOException


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.