Class AbstractTLSSocketFactory

  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.cornerstone.blocks.sockets.AbstractTLSSocketFactory
All Implemented Interfaces:
Configurable, Contextualizable, Initializable, LogEnabled
Direct Known Subclasses:
TLSServerSocketFactory, TLSSocketFactory

public abstract class AbstractTLSSocketFactory
extends AbstractLogEnabled
implements Contextualizable, Configurable, Initializable

Contains the code common for both TLS socket factories. They both need to use an SSLFactoryBuilder which is configured using configuration and context given by the container. Then, they both set timeouts on the manufactured sockets.

Greg Steuck

Field Summary
protected  int m_socketTimeOut
Constructor Summary
Method Summary
 void configure(Configuration configuration)
          Configures the factory.
 void contextualize(Context context)
          Pass the Context to the component.
 void initialize()
          Creates an SSL factory using the confuration values.
protected abstract  void visitBuilder(SSLFactoryBuilder builder)
          The child factories have to use an instance of SSLFactoryBuilder to obtain their factories.
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


protected int m_socketTimeOut
Constructor Detail


public AbstractTLSSocketFactory()
Method Detail


public void contextualize(Context context)
Description copied from interface: Contextualizable
Pass the Context to the component. This method is called after the LogEnabled.enableLogging( Logger ) (if present) method and before any other method.

Specified by:
contextualize in interface Contextualizable
context - the context. Must not be null.


public void configure(Configuration configuration)
               throws ConfigurationException
Configures the factory.

Specified by:
configure in interface Configurable
configuration - the Configuration
ConfigurationException - if an error occurs


public void initialize()
                throws java.lang.Exception
Creates an SSL factory using the confuration values.

Specified by:
initialize in interface Initializable
java.lang.Exception - if an error occurs


protected abstract void visitBuilder(SSLFactoryBuilder builder)
The child factories have to use an instance of SSLFactoryBuilder to obtain their factories. So they are given an instance when it's ready. Another alternative was to have the SSLFactoryBuilder export buildContext method, but that would mean SSLContext which is deep in Sun guts will be aired in 3-4 classes instead of 1.

Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.