winstone
Class ObjectPool

java.lang.Object
  extended by winstone.ObjectPool

public class ObjectPool
extends java.lang.Object

Holds the object pooling code for Winstone. Presently this is only responses and requests, but may increase.

Version:
$Id: ObjectPool.java,v 1.9 2006/11/18 14:56:59 rickknowles Exp $
Author:
Rick Knowles

Constructor Summary
ObjectPool(java.util.Map args)
          Constructs an instance of the object pool, including handlers, requests and responses
 
Method Summary
 void destroy()
           
 WinstoneRequest getRequestFromPool()
          An attempt at pooling request objects for reuse.
 WinstoneResponse getResponseFromPool()
          An attempt at pooling request objects for reuse.
 void handleRequest(java.net.Socket socket, Listener listener)
          Once the socket request comes in, this method is called.
 void releaseRequestToPool(WinstoneRequest req)
           
 void releaseResponseToPool(WinstoneResponse rsp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectPool

public ObjectPool(java.util.Map args)
           throws java.io.IOException
Constructs an instance of the object pool, including handlers, requests and responses

Throws:
java.io.IOException
Method Detail

destroy

public void destroy()

handleRequest

public void handleRequest(java.net.Socket socket,
                          Listener listener)
                   throws java.io.IOException,
                          java.lang.InterruptedException
Once the socket request comes in, this method is called. It reserves a request handler, then delegates the socket to that class. When it finishes, the handler is released back into the pool.

Throws:
java.io.IOException
java.lang.InterruptedException

getRequestFromPool

public WinstoneRequest getRequestFromPool()
                                   throws java.io.IOException
An attempt at pooling request objects for reuse.

Throws:
java.io.IOException

releaseRequestToPool

public void releaseRequestToPool(WinstoneRequest req)

getResponseFromPool

public WinstoneResponse getResponseFromPool()
An attempt at pooling request objects for reuse.


releaseResponseToPool

public void releaseResponseToPool(WinstoneResponse rsp)


Copyright © 2013. All Rights Reserved.