| |
|
| java.lang.Object org.jicarilla.lang.AbstractActive org.jicarilla.net.SocketServerImpl
SocketServerImpl | public class SocketServerImpl extends AbstractActive implements SocketServer(Code) | | This is a basic New-I/O socket server.
On startup, a configurable number of threads is
created which listen for requests and delegate
them to the handler once basic parsing has been
done.
All other processing is then delegated to a handler
from the handler pool.
In case of any unusual failure, a fallback error
handler is used.
This is a mostly type-3-compatible IoC component with
two additional lifecycle methods: initialize() and
releaseInstance(). The additional lifecycle is neccessary
because we should not create threads in the
constructor.
author: Leo Simons version: $Id: SocketServerImpl.java,v 1.7 2004/03/23 13:37:50 lsimons Exp $ |
Inner Class :protected interface StoppableRunnable extends Runnable | |
Inner Class :protected static class RequestHandlingWorker implements StoppableRunnable | |
Inner Class :protected class PoolReturningSinkSink implements Sink | |
Inner Class :protected static class PoolReturningWorker implements Runnable | |
MAXIMUM_PORT_NUMBER | final public static int MAXIMUM_PORT_NUMBER(Code) | | |
SLEEP_DURING_DISPOSE | final public static int SLEEP_DURING_DISPOSE(Code) | | |
m_backlog | protected int m_backlog(Code) | | |
m_eventPool | protected ObjectPool m_eventPool(Code) | | |
m_handlerPool | protected ObjectPool m_handlerPool(Code) | | |
m_numThreads | protected int m_numThreads(Code) | | |
m_port | protected int m_port(Code) | | |
m_runners | protected StoppableRunnable[] m_runners(Code) | | |
m_threadPool | protected PooledExecutor m_threadPool(Code) | | |
SocketServerImpl | protected SocketServerImpl()(Code) | | |
getBacklog | protected int getBacklog()(Code) | | |
getErrorHandler | protected Sink getErrorHandler()(Code) | | |
getEventPool | protected ObjectPool getEventPool()(Code) | | |
getHandlerPool | protected ObjectPool getHandlerPool()(Code) | | |
getNumThreads | protected int getNumThreads()(Code) | | |
getPort | protected int getPort()(Code) | | |
getRunners | protected StoppableRunnable[] getRunners()(Code) | | |
getThreadPool | protected PooledExecutor getThreadPool()(Code) | | |
handleRequest | protected void handleRequest() throws InterruptedException(Code) | | Called from worker threads to accept new socket
connections.
|
setBacklog | protected void setBacklog(int backlog)(Code) | | |
setErrorHandler | protected void setErrorHandler(Sink errorHandler)(Code) | | |
setEventPool | protected void setEventPool(ObjectPool eventPool)(Code) | | |
setHandlerPool | protected void setHandlerPool(ObjectPool handlerPool)(Code) | | |
setNumThreads | protected void setNumThreads(int numThreads)(Code) | | |
setPoolReturningSink | final protected void setPoolReturningSink(Channel handler, Event event) throws InterruptedException(Code) | | Appends a handler to the end of an event handler
chain that will return pooled objects back to
from whence they came.
Parameters: handler - Parameters: event - |
setPort | protected void setPort(int port)(Code) | | |
setRootDirectory | protected void setRootDirectory(String rootDirectory)(Code) | | |
setThreadPool | protected void setThreadPool(PooledExecutor threadPool)(Code) | | |
|
|
|