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
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
RandomPortSocketFactory
public RandomPortSocketFactory()
RandomPortSocketFactory
public RandomPortSocketFactory(int basePort,
int range)
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.