jicarilla-sandbox/platform/components/http/impl/src/java/org/jicarilla/net SocketServerImpl.java,1.7,1.8
Leo Simons <[email protected]> Thu, 15 Apr 2004 09:42:56 +0000
| Newsgroups | gmane.comp.java.jicarilla.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/jicarilla/jicarilla-sandbox/platform/components/http/impl/src/java/org/jicarilla/net
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4871/platform/components/http/impl/src/java/org/jicarilla/net
Modified Files:
SocketServerImpl.java
Log Message:
I forgot to commit some work the other day. Mostly plumbing work on the HTTP server.
Index: SocketServerImpl.java
===================================================================
RCS file: /cvsroot/jicarilla/jicarilla-sandbox/platform/components/http/impl/src/java/org/jicarilla/net/SocketServerImpl.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- SocketServerImpl.java 23 Mar 2004 13:37:50 -0000 1.7
+++ SocketServerImpl.java 15 Apr 2004 09:42:53 -0000 1.8
@@ -367,7 +367,8 @@
event.setChannel( channel );
// run the channel
- setPoolReturningSink( handler, event );
+ setPoolReturningSink(
+ m_threadPool, m_handlerPool, m_eventPool, handler, event );
handler.put( event );
}
@@ -378,18 +379,24 @@
*
* @param handler
* @param event
+ * @todo Refactor this thing and move it out of the socker server
*/
- protected final void setPoolReturningSink(
+ public final static void setPoolReturningSink(
+ final PooledExecutor threadPool,
+ final ObjectPool handlerPool,
+ final ObjectPool eventPool,
final Channel handler, final Event event )
throws InterruptedException
{
- final Sink sink = new PoolReturningSinkSink( handler );
- m_threadPool.execute(
+ final Sink sink = new PoolReturningSinkSink( handler,
+ handlerPool, eventPool );
+ threadPool.execute(
new PoolReturningWorker( handler, sink, event )
);
}
- protected void handleRequestException( final SocketChannel channel, final Exception ex )
+ protected void handleRequestException( final SocketChannel channel,
+ final Exception ex )
{
try
{
@@ -468,21 +475,27 @@
// Inner Class: PoolReturningSink
// ----------------------------------------------------------------------
- protected class PoolReturningSinkSink implements Sink
+ protected static class PoolReturningSinkSink implements Sink
{
protected final Channel m_handler;
+ protected final ObjectPool m_handlerPool;
+ protected final ObjectPool m_eventPool;
- protected PoolReturningSinkSink( final Channel handler )
+ protected PoolReturningSinkSink( final Channel handler,
+ final ObjectPool handlerPool,
+ final ObjectPool eventPool )
{
m_handler = handler;
+ m_handlerPool = handlerPool;
+ m_eventPool = eventPool;
}
public void put( final Object o )
{
- try { getHandlerPool().returnObject( m_handler ); }
+ try { m_handlerPool.returnObject( m_handler ); }
catch( Exception e ) {}
- try { getEventPool().returnObject( o ); }
+ try { m_handlerPool.returnObject( o ); }
catch( Exception e ) {}
}
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click