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, SocketManager
- public class DefaultSocketManager
- extends AbstractLogEnabled
- implements SocketManager, Contextualizable, Configurable, Initializable
Implementation of SocketManager.
- Author:
- Federico Barbieri, Peter Donald
Fields inherited from interface org.apache.avalon.cornerstone.services.sockets.SocketManager |
ROLE |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
DefaultSocketManager
public DefaultSocketManager()
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
- Throws:
Exception
setupServerSocketFactory
protected void setupServerSocketFactory(String name,
String className,
Configuration configuration)
throws Exception
- Throws:
Exception
setupClientSocketFactory
protected void setupClientSocketFactory(String name,
String className,
Configuration configuration)
throws Exception
- Throws:
Exception
createFactory
protected Object createFactory(String name,
String className,
Configuration configuration)
throws Exception
- Throws:
Exception
getServerSocketFactory
public ServerSocketFactory getServerSocketFactory(String name)
throws Exception
- Retrieve a server socket factory by name.
- Specified by:
getServerSocketFactory
in interface SocketManager
- Parameters:
name
- the name of server socket factory
- Returns:
- the ServerSocketFactory
- Throws:
Exception
- if server socket factory is not available
getSocketFactory
public SocketFactory getSocketFactory(String name)
throws Exception
- Retrieve a client socket factory by name.
- Specified by:
getSocketFactory
in interface SocketManager
- Parameters:
name
- the name of client socket factory
- Returns:
- the SocketFactory
- Throws:
Exception
- if socket factory is not available
Copyright © Apache Software Foundation. All Rights Reserved.