org.apache.avalon.cornerstone.blocks.sockets
Class AbstractTLSSocketFactory

java.lang.Object
  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.

Author:
Greg Steuck

Field Summary
protected  int m_socketTimeOut
           
 
Constructor Summary
AbstractTLSSocketFactory()
           
 
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

m_socketTimeOut

protected int m_socketTimeOut
Constructor Detail

AbstractTLSSocketFactory

public AbstractTLSSocketFactory()
Method Detail

contextualize

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
Parameters:
context - the context. Must not be null.

configure

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

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

initialize

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

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

visitBuilder

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.