TUM CCSM Commons

edu.tum.cs.commons.net
Class SmartRMISocketFactory

java.lang.Object
  extended by java.rmi.server.RMISocketFactory
      extended by edu.tum.cs.commons.net.SmartRMISocketFactory
All Implemented Interfaces:
RMIClientSocketFactory, RMIServerSocketFactory
Direct Known Subclasses:
LocalhostRMISocketFactory

public class SmartRMISocketFactory
extends RMISocketFactory

A RMISocketFactory that adjusts flags on the sockets used. One is that for the server socket the reuse flag is set, which allows fast reopening. Second, an optional timeout can be set.

Version:
$Rev: 28668 $
Author:
hummelb, $Author: heineman $
Rating:
GREEN Hash: 676BF40E769C33456EE7029EE0E3949A

Constructor Summary
SmartRMISocketFactory()
          Constructor.
SmartRMISocketFactory(int timeoutSeconds)
          Constructor
 
Method Summary
 ServerSocket createServerSocket(int port)
          
 Socket createSocket(String host, int port)
          
 
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
 

Constructor Detail

SmartRMISocketFactory

public SmartRMISocketFactory()
Constructor. No timeout is set.


SmartRMISocketFactory

public SmartRMISocketFactory(int timeoutSeconds)
Constructor

Method Detail

createSocket

public Socket createSocket(String host,
                           int port)
                    throws IOException

Specified by:
createSocket in interface RMIClientSocketFactory
Specified by:
createSocket in class RMISocketFactory
Throws:
IOException

createServerSocket

public ServerSocket createServerSocket(int port)
                                throws IOException

Specified by:
createServerSocket in interface RMIServerSocketFactory
Specified by:
createServerSocket in class RMISocketFactory
Throws:
IOException

TUM CCSM Commons

TUM CCSM Commons - 2.7