org.jacorb.orb.factory
Class PortRangeSocketFactory

java.lang.Object
  extended by org.jacorb.orb.factory.AbstractSocketFactory
      extended by org.jacorb.orb.factory.PortRangeSocketFactory
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, SocketFactory

public class PortRangeSocketFactory
extends AbstractSocketFactory

a SocketFactory implementation that allows to specify the range of local ports that should be used by a created socket. the factory will read the attributes jacorb.net.socket_factory.port.min and jacorb.net.socket_factory.port.max from the configuration and use the specified values to configure the created sockets.

Version:
$Id: PortRangeSocketFactory.java,v 1.14 2006/11/24 14:15:37 alphonse.bendt Exp $
Author:
Steve Osselton

Field Summary
static java.lang.String MAX_PROP
           
static java.lang.String MIN_PROP
           
 
Fields inherited from class org.jacorb.orb.factory.AbstractSocketFactory
logger
 
Constructor Summary
PortRangeSocketFactory()
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration config)
           
 java.net.Socket createSocket(java.lang.String host, int port)
          create a connected stream Socket.
 java.net.Socket doCreateSocket(java.lang.String host, int port, int timeout)
           
 boolean isSSL(java.net.Socket socket)
           
 
Methods inherited from class org.jacorb.orb.factory.AbstractSocketFactory
createSocket
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_PROP

public static final java.lang.String MIN_PROP
See Also:
Constant Field Values

MAX_PROP

public static final java.lang.String MAX_PROP
See Also:
Constant Field Values
Constructor Detail

PortRangeSocketFactory

public PortRangeSocketFactory()
Method Detail

configure

public void configure(org.apache.avalon.framework.configuration.Configuration config)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Overrides:
configure in class AbstractSocketFactory
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port)
                             throws java.io.IOException,
                                    java.net.UnknownHostException
Description copied from interface: SocketFactory
create a connected stream Socket.

Parameters:
host - the host name
port - the port number
Returns:
a connected stream Socket
Throws:
java.io.IOException
java.net.UnknownHostException

isSSL

public boolean isSSL(java.net.Socket socket)
Returns:
true if the specified socket supports SSL.

doCreateSocket

public java.net.Socket doCreateSocket(java.lang.String host,
                                      int port,
                                      int timeout)
                               throws java.io.IOException
Specified by:
doCreateSocket in class AbstractSocketFactory
Throws:
java.io.IOException