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:
java.rmi.server.RMIClientSocketFactory, java.rmi.server.RMIServerSocketFactory
Direct Known Subclasses:
LocalhostRMISocketFactory

public class SmartRMISocketFactory
extends java.rmi.server.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
 java.net.ServerSocket createServerSocket(int port)
          
 java.net.Socket createSocket(java.lang.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 java.net.Socket createSocket(java.lang.String host,
                                    int port)
                             throws java.io.IOException

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

createServerSocket

public java.net.ServerSocket createServerSocket(int port)
                                         throws java.io.IOException

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

TUM CCSM Commons

TUM CCSM Commons - 2.7