org.objectweb.proactive.core.rmi
Class RandomPortSocketFactory

java.lang.Object
  |
  +--org.objectweb.proactive.core.rmi.RandomPortSocketFactory
All Implemented Interfaces:
java.rmi.server.RMIClientSocketFactory, java.rmi.server.RMIServerSocketFactory, java.io.Serializable

public class RandomPortSocketFactory
extends java.lang.Object
implements java.rmi.server.RMIServerSocketFactory, java.rmi.server.RMIClientSocketFactory, java.io.Serializable

This factory creates server socket with randomly choosen port number it tries 5 different ports before reporting a failure

See Also:
Serialized Form

Field Summary
protected  int basePort
           
protected static int MAX
           
protected static java.util.Random random
           
protected  int range
           
 
Constructor Summary
RandomPortSocketFactory()
           
RandomPortSocketFactory(int basePort, int range)
           
 
Method Summary
 java.net.ServerSocket createServerSocket(int port)
           
 java.net.Socket createSocket(java.lang.String host, int port)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX

protected static final int MAX
See Also:
Constant Field Values

random

protected static java.util.Random random

basePort

protected int basePort

range

protected int range
Constructor Detail

RandomPortSocketFactory

public RandomPortSocketFactory()

RandomPortSocketFactory

public RandomPortSocketFactory(int basePort,
                               int range)
Method Detail

createServerSocket

public java.net.ServerSocket createServerSocket(int port)
                                         throws java.io.IOException
Specified by:
createServerSocket in interface java.rmi.server.RMIServerSocketFactory
java.io.IOException

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
java.io.IOException


Copyright © April 2004 INRIA All Rights Reserved.