org.jacorb.orb.factory
Class AbstractSocketFactory

java.lang.Object
  extended by org.jacorb.orb.factory.AbstractSocketFactory
All Implemented Interfaces:
org.jacorb.config.Configurable, SocketFactory
Direct Known Subclasses:
DefaultSocketFactory, FixedAddressSocketFactory, PortRangeSocketFactory

public abstract class AbstractSocketFactory
extends java.lang.Object
implements SocketFactory, org.jacorb.config.Configurable

abstract base class for JacORB's default SocketFactory implementations.

Version:
$Id: AbstractSocketFactory.java,v 1.8 2009-05-03 21:35:55 andre.spiegel Exp $
Author:
Alphonse Bendt

Field Summary
protected  org.slf4j.Logger logger
           
 
Constructor Summary
AbstractSocketFactory()
           
 
Method Summary
 void configure(org.jacorb.config.Configuration configuration)
           
 java.net.Socket createSocket(java.lang.String host, int port, int timeout)
          to ensure we throw the correct exception in case a timeout occurs we provide a final implementation of this method here, delegate to subclass-specific implementations and handle the correct conversion of the exception in one place.
protected abstract  java.net.Socket doCreateSocket(java.lang.String host, int port, int timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jacorb.orb.factory.SocketFactory
createSocket, isSSL
 

Field Detail

logger

protected org.slf4j.Logger logger
Constructor Detail

AbstractSocketFactory

public AbstractSocketFactory()
Method Detail

configure

public void configure(org.jacorb.config.Configuration configuration)
               throws org.jacorb.config.ConfigurationException
Specified by:
configure in interface org.jacorb.config.Configurable
Throws:
org.jacorb.config.ConfigurationException

createSocket

public final java.net.Socket createSocket(java.lang.String host,
                                          int port,
                                          int timeout)
                                   throws java.net.UnknownHostException,
                                          java.io.IOException
to ensure we throw the correct exception in case a timeout occurs we provide a final implementation of this method here, delegate to subclass-specific implementations and handle the correct conversion of the exception in one place.

Specified by:
createSocket in interface SocketFactory
Parameters:
host - the host name
port - the port number
timeout - the timeout value to be used in milliseconds
Returns:
a connected stream Socket
Throws:
java.io.IOException
java.net.UnknownHostException

doCreateSocket

protected abstract java.net.Socket doCreateSocket(java.lang.String host,
                                                  int port,
                                                  int timeout)
                                           throws java.io.IOException,
                                                  java.net.UnknownHostException
Throws:
java.io.IOException
java.net.UnknownHostException