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

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLogEnabled
        |
        +--org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketManager
All Implemented Interfaces:
Configurable, Contextualizable, Initializable, LogEnabled, org.apache.avalon.cornerstone.services.sockets.SocketManager

public class DefaultSocketManager
extends AbstractLogEnabled
implements org.apache.avalon.cornerstone.services.sockets.SocketManager, Contextualizable, Configurable, Initializable

Implementation of SocketManager.

Author:
Federico Barbieri, Peter Donald

Field Summary
protected  Configuration m_configuration
           
protected  Context m_context
           
protected  HashMap m_serverSockets
           
protected  HashMap m_sockets
           
 
Fields inherited from interface org.apache.avalon.cornerstone.services.sockets.SocketManager
ROLE
 
Constructor Summary
DefaultSocketManager()
           
 
Method Summary
 void configure(Configuration configuration)
          Configure the SocketManager.
 void contextualize(Context context)
           
protected  Object createFactory(String name, String className, Configuration configuration)
           
 org.apache.avalon.cornerstone.services.sockets.ServerSocketFactory getServerSocketFactory(String name)
          Retrieve a server socket factory by name.
 org.apache.avalon.cornerstone.services.sockets.SocketFactory getSocketFactory(String name)
          Retrieve a client socket factory by name.
 void initialize()
           
protected  void setupClientSocketFactory(String name, String className, Configuration configuration)
           
protected  void setupServerSocketFactory(String name, String className, Configuration configuration)
           
 
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_serverSockets

protected final HashMap m_serverSockets

m_sockets

protected final HashMap m_sockets

m_context

protected Context m_context

m_configuration

protected Configuration m_configuration
Constructor Detail

DefaultSocketManager

public DefaultSocketManager()
Method Detail

contextualize

public void contextualize(Context context)
Specified by:
contextualize in interface Contextualizable

configure

public void configure(Configuration configuration)
               throws ConfigurationException
Configure the SocketManager.

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

initialize

public void initialize()
                throws Exception
Specified by:
initialize in interface Initializable
Exception

setupServerSocketFactory

protected void setupServerSocketFactory(String name,
                                        String className,
                                        Configuration configuration)
                                 throws Exception
Exception

setupClientSocketFactory

protected void setupClientSocketFactory(String name,
                                        String className,
                                        Configuration configuration)
                                 throws Exception
Exception

createFactory

protected Object createFactory(String name,
                               String className,
                               Configuration configuration)
                        throws Exception
Exception

getServerSocketFactory

public org.apache.avalon.cornerstone.services.sockets.ServerSocketFactory getServerSocketFactory(String name)
                                                                                          throws Exception
Retrieve a server socket factory by name.

Specified by:
getServerSocketFactory in interface org.apache.avalon.cornerstone.services.sockets.SocketManager
Parameters:
name - the name of server socket factory
Returns:
the ServerSocketFactory
Throws:
Exception - if server socket factory is not available

getSocketFactory

public org.apache.avalon.cornerstone.services.sockets.SocketFactory getSocketFactory(String name)
                                                                              throws Exception
Retrieve a client socket factory by name.

Specified by:
getSocketFactory in interface org.apache.avalon.cornerstone.services.sockets.SocketManager
Parameters:
name - the name of client socket factory
Returns:
the SocketFactory
Throws:
Exception - if socket factory is not available


Copyright © 2001-2003 Apache Software Foundation. All Rights Reserved.