commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1102194 [2/3] - in /commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl: GenericObjectPool.java GenericObjectPoolFactory.java
Date Thu, 12 May 2011 07:54:47 GMT

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPool.java?rev=1102194&r1=1102193&r2=1102194&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPool.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPool.java Thu May 12 07:54:47 2011
@@ -39,206 +39,189 @@ import org.apache.commons.pool2.Poolable
  * <p>
  * A <tt>GenericObjectPool</tt> provides a number of configurable parameters:
  * <ul>
- *  <li>
+ * <li>
  *    {@link #setMaxActive <i>maxActive</i>} controls the maximum number of
- *    objects that can be allocated by the pool (checked out to clients, or
- *    idle awaiting checkout) at a given time.  When non-positive, there is no
- *    limit to the number of objects that can be managed by the pool at one time.
- *    When {@link #setMaxActive <i>maxActive</i>} is reached, the pool is said
- *    to be exhausted. The default setting for this parameter is 8.
- *  </li>
- *  <li>
+ * objects that can be allocated by the pool (checked out to clients, or idle
+ * awaiting checkout) at a given time. When non-positive, there is no limit to
+ * the number of objects that can be managed by the pool at one time. When
+ * {@link #setMaxActive <i>maxActive</i>} is reached, the pool is said to be
+ * exhausted. The default setting for this parameter is 8.</li>
+ * <li>
  *    {@link #setMaxIdle <i>maxIdle</i>} controls the maximum number of objects
- *    that can sit idle in the pool at any time.  When negative, there is no
- *    limit to the number of objects that may be idle at one time. The default
- *    setting for this parameter is 8.
- *  </li>
- *  <li>
+ * that can sit idle in the pool at any time. When negative, there is no limit
+ * to the number of objects that may be idle at one time. The default setting
+ * for this parameter is 8.</li>
+ * <li>
  *    {@link #setWhenExhaustedAction <i>whenExhaustedAction</i>} specifies the
- *    behavior of the {@link #borrowObject} method when the pool is exhausted:
- *    <ul>
- *    <li>
- *      When {@link #setWhenExhaustedAction <i>whenExhaustedAction</i>} is
- *      {@link #WHEN_EXHAUSTED_FAIL}, {@link #borrowObject} will throw
- *      a {@link NoSuchElementException}
- *    </li>
- *    <li>
- *      When {@link #setWhenExhaustedAction <i>whenExhaustedAction</i>} is
- *      {@link #WHEN_EXHAUSTED_GROW}, {@link #borrowObject} will create a new
- *      object and return it (essentially making {@link #setMaxActive <i>maxActive</i>}
- *      meaningless.)
- *    </li>
- *    <li>
- *      When {@link #setWhenExhaustedAction <i>whenExhaustedAction</i>}
- *      is {@link #WHEN_EXHAUSTED_BLOCK}, {@link #borrowObject} will block
- *      (invoke {@link Object#wait()}) until a new or idle object is available.
- *      If a positive {@link #setMaxWait <i>maxWait</i>}
- *      value is supplied, then {@link #borrowObject} will block for at
- *      most that many milliseconds, after which a {@link NoSuchElementException}
- *      will be thrown.  If {@link #setMaxWait <i>maxWait</i>} is non-positive,
- *      the {@link #borrowObject} method will block indefinitely.
- *    </li>
- *    </ul>
- *    The default <code>whenExhaustedAction</code> setting is
- *    {@link #WHEN_EXHAUSTED_BLOCK} and the default <code>maxWait</code>
- *    setting is -1. By default, therefore, <code>borrowObject</code> will
- *    block indefinitely until an idle instance becomes available.
- *  </li>
- *  <li>
- *    When {@link #setTestOnBorrow <i>testOnBorrow</i>} is set, the pool will
- *    attempt to validate each object before it is returned from the
- *    {@link #borrowObject} method. (Using the provided factory's
- *    {@link PoolableObjectFactory#validateObject} method.)  Objects that fail
- *    to validate will be dropped from the pool, and a different object will
- *    be borrowed. The default setting for this parameter is
- *    <code>false.</code>
- *  </li>
- *  <li>
- *    When {@link #setTestOnReturn <i>testOnReturn</i>} is set, the pool will
- *    attempt to validate each object before it is returned to the pool in the
- *    {@link #returnObject} method. (Using the provided factory's
- *    {@link PoolableObjectFactory#validateObject}
- *    method.)  Objects that fail to validate will be dropped from the pool.
- *    The default setting for this parameter is <code>false.</code>
- *  </li>
+ * behavior of the {@link #borrowObject} method when the pool is exhausted:
+ * <ul>
+ * <li>When {@link #setWhenExhaustedAction <i>whenExhaustedAction</i>} is
+ * {@link #WHEN_EXHAUSTED_FAIL}, {@link #borrowObject} will throw a
+ * {@link NoSuchElementException}</li>
+ * <li>When {@link #setWhenExhaustedAction <i>whenExhaustedAction</i>} is
+ * {@link #WHEN_EXHAUSTED_GROW}, {@link #borrowObject} will create a new object
+ * and return it (essentially making {@link #setMaxActive <i>maxActive</i>}
+ * meaningless.)</li>
+ * <li>When {@link #setWhenExhaustedAction <i>whenExhaustedAction</i>} is
+ * {@link #WHEN_EXHAUSTED_BLOCK}, {@link #borrowObject} will block (invoke
+ * {@link Object#wait()}) until a new or idle object is available. If a positive
+ * {@link #setMaxWait <i>maxWait</i>} value is supplied, then
+ * {@link #borrowObject} will block for at most that many milliseconds, after
+ * which a {@link NoSuchElementException} will be thrown. If {@link #setMaxWait
+ * <i>maxWait</i>} is non-positive, the {@link #borrowObject} method will block
+ * indefinitely.</li>
+ * </ul>
+ * The default <code>whenExhaustedAction</code> setting is
+ * {@link #WHEN_EXHAUSTED_BLOCK} and the default <code>maxWait</code> setting is
+ * -1. By default, therefore, <code>borrowObject</code> will block indefinitely
+ * until an idle instance becomes available.</li>
+ * <li>When {@link #setTestOnBorrow <i>testOnBorrow</i>} is set, the pool will
+ * attempt to validate each object before it is returned from the
+ * {@link #borrowObject} method. (Using the provided factory's
+ * {@link PoolableObjectFactory#validateObject} method.) Objects that fail to
+ * validate will be dropped from the pool, and a different object will be
+ * borrowed. The default setting for this parameter is <code>false.</code></li>
+ * <li>When {@link #setTestOnReturn <i>testOnReturn</i>} is set, the pool will
+ * attempt to validate each object before it is returned to the pool in the
+ * {@link #returnObject} method. (Using the provided factory's
+ * {@link PoolableObjectFactory#validateObject} method.) Objects that fail to
+ * validate will be dropped from the pool. The default setting for this
+ * parameter is <code>false.</code></li>
  * </ul>
  * <p>
  * Optionally, one may configure the pool to examine and possibly evict objects
  * as they sit idle in the pool and to ensure that a minimum number of idle
- * objects are available. This is performed by an "idle object eviction"
- * thread, which runs asynchronously. Caution should be used when configuring
- * this optional feature. Eviction runs contend with client threads for access
- * to objects in the pool, so if they run too frequently performance issues may
+ * objects are available. This is performed by an "idle object eviction" thread,
+ * which runs asynchronously. Caution should be used when configuring this
+ * optional feature. Eviction runs contend with client threads for access to
+ * objects in the pool, so if they run too frequently performance issues may
  * result. The idle object eviction thread may be configured using the following
  * attributes:
  * <ul>
- *  <li>
- *   {@link #setTimeBetweenEvictionRunsMillis <i>timeBetweenEvictionRunsMillis</i>}
- *   indicates how long the eviction thread should sleep before "runs" of examining
- *   idle objects.  When non-positive, no eviction thread will be launched. The
- *   default setting for this parameter is -1 (i.e., idle object eviction is
- *   disabled by default).
- *  </li>
- *  <li>
- *   {@link #setMinEvictableIdleTimeMillis <i>minEvictableIdleTimeMillis</i>}
- *   specifies the minimum amount of time that an object may sit idle in the pool
- *   before it is eligible for eviction due to idle time.  When non-positive, no object
- *   will be dropped from the pool due to idle time alone. This setting has no
- *   effect unless <code>timeBetweenEvictionRunsMillis > 0.</code> The default
- *   setting for this parameter is 30 minutes.
- *  </li>
- *  <li>
- *   {@link #setTestWhileIdle <i>testWhileIdle</i>} indicates whether or not idle
- *   objects should be validated using the factory's
- *   {@link PoolableObjectFactory#validateObject} method. Objects that fail to
- *   validate will be dropped from the pool. This setting has no effect unless
- *   <code>timeBetweenEvictionRunsMillis > 0.</code>  The default setting for
- *   this parameter is <code>false.</code>
- *  </li>
- *  <li>
- *   {@link #setSoftMinEvictableIdleTimeMillis <i>softMinEvictableIdleTimeMillis</i>}
- *   specifies the minimum amount of time an object may sit idle in the pool
- *   before it is eligible for eviction by the idle object evictor
- *   (if any), with the extra condition that at least "minIdle" object instances
- *   remain in the pool.  When non-positive, no objects will be evicted from the pool
- *   due to idle time alone. This setting has no effect unless
- *   <code>timeBetweenEvictionRunsMillis > 0.</code> and it is superceded by
+ * <li>
+ *   {@link #setTimeBetweenEvictionRunsMillis
+ * <i>timeBetweenEvictionRunsMillis</i>} indicates how long the eviction thread
+ * should sleep before "runs" of examining idle objects. When non-positive, no
+ * eviction thread will be launched. The default setting for this parameter is
+ * -1 (i.e., idle object eviction is disabled by default).</li>
+ * <li>
  *   {@link #setMinEvictableIdleTimeMillis <i>minEvictableIdleTimeMillis</i>}
- *   (that is, if <code>minEvictableIdleTimeMillis</code> is positive, then
- *   <code>softMinEvictableIdleTimeMillis</code> is ignored). The default setting for
- *   this parameter is -1 (disabled).
- *  </li>
- *  <li>
+ * specifies the minimum amount of time that an object may sit idle in the pool
+ * before it is eligible for eviction due to idle time. When non-positive, no
+ * object will be dropped from the pool due to idle time alone. This setting has
+ * no effect unless <code>timeBetweenEvictionRunsMillis > 0.</code> The default
+ * setting for this parameter is 30 minutes.</li>
+ * <li>
+ *   {@link #setTestWhileIdle <i>testWhileIdle</i>} indicates whether or not
+ * idle objects should be validated using the factory's
+ * {@link PoolableObjectFactory#validateObject} method. Objects that fail to
+ * validate will be dropped from the pool. This setting has no effect unless
+ * <code>timeBetweenEvictionRunsMillis > 0.</code> The default setting for this
+ * parameter is <code>false.</code></li>
+ * <li>
+ *   {@link #setSoftMinEvictableIdleTimeMillis
+ * <i>softMinEvictableIdleTimeMillis</i>} specifies the minimum amount of time
+ * an object may sit idle in the pool before it is eligible for eviction by the
+ * idle object evictor (if any), with the extra condition that at least
+ * "minIdle" object instances remain in the pool. When non-positive, no objects
+ * will be evicted from the pool due to idle time alone. This setting has no
+ * effect unless <code>timeBetweenEvictionRunsMillis > 0.</code> and it is
+ * superceded by {@link #setMinEvictableIdleTimeMillis
+ * <i>minEvictableIdleTimeMillis</i>} (that is, if
+ * <code>minEvictableIdleTimeMillis</code> is positive, then
+ * <code>softMinEvictableIdleTimeMillis</code> is ignored). The default setting
+ * for this parameter is -1 (disabled).</li>
+ * <li>
  *   {@link #setNumTestsPerEvictionRun <i>numTestsPerEvictionRun</i>}
- *   determines the number of objects examined in each run of the idle object
- *   evictor. This setting has no effect unless
- *   <code>timeBetweenEvictionRunsMillis > 0.</code>  The default setting for
- *   this parameter is 3.
- *  </li>
+ * determines the number of objects examined in each run of the idle object
+ * evictor. This setting has no effect unless
+ * <code>timeBetweenEvictionRunsMillis > 0.</code> The default setting for this
+ * parameter is 3.</li>
  * </ul>
  * <p>
  * <p>
  * The pool can be configured to behave as a LIFO queue with respect to idle
- * objects - always returning the most recently used object from the pool,
- * or as a FIFO queue, where borrowObject always returns the oldest object
- * in the idle object pool.
+ * objects - always returning the most recently used object from the pool, or as
+ * a FIFO queue, where borrowObject always returns the oldest object in the idle
+ * object pool.
  * <ul>
- *  <li>
- *   {@link #setLifo <i>lifo</i>}
- *   determines whether or not the pool returns idle objects in
- *   last-in-first-out order. The default setting for this parameter is
- *   <code>true.</code>
- *  </li>
+ * <li>
+ *   {@link #setLifo <i>lifo</i>} determines whether or not the pool returns
+ * idle objects in last-in-first-out order. The default setting for this
+ * parameter is <code>true.</code></li>
  * </ul>
  * <p>
- * GenericObjectPool is not usable without a {@link PoolableObjectFactory}.  A
- * non-<code>null</code> factory must be provided either as a constructor argument
- * or via a call to {@link #setFactory} before the pool is used.
+ * GenericObjectPool is not usable without a {@link PoolableObjectFactory}. A
+ * non-<code>null</code> factory must be provided either as a constructor
+ * argument or via a call to {@link #setFactory} before the pool is used.
  * <p>
  * Implementation note: To prevent possible deadlocks, care has been taken to
  * ensure that no call to a factory method will occur within a synchronization
  * block. See POOL-125 and DBCP-44 for more information.
- *
+ * 
  * @see GenericKeyedObjectPool
- *
- * @param <T> Type of element pooled in this pool.
- *
+ * @param <T>
+ *            Type of element pooled in this pool.
  * @author Rodney Waldhoff
  * @author Dirk Verbeeck
  * @author Sandy McArthur
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2011-05-11 13:50:33 +0100 (Wed, 11 May
+ *          2011) $
  * @since Pool 1.0
  */
 public class GenericObjectPool<T> extends BaseObjectPool<T> {
 
-    //--- public constants -------------------------------------------
+    // --- public constants -------------------------------------------
 
     /**
-     * A "when exhausted action" type indicating that when the pool is
-     * exhausted (i.e., the maximum number of active objects has
-     * been reached), the {@link #borrowObject}
-     * method should fail, throwing a {@link NoSuchElementException}.
+     * A "when exhausted action" type indicating that when the pool is exhausted
+     * (i.e., the maximum number of active objects has been reached), the
+     * {@link #borrowObject} method should fail, throwing a
+     * {@link NoSuchElementException}.
+     * 
      * @see #WHEN_EXHAUSTED_BLOCK
      * @see #WHEN_EXHAUSTED_GROW
      * @see #setWhenExhaustedAction
      */
-    public static final byte WHEN_EXHAUSTED_FAIL   = 0;
+    public static final byte WHEN_EXHAUSTED_FAIL = 0;
 
     /**
-     * A "when exhausted action" type indicating that when the pool
-     * is exhausted (i.e., the maximum number
-     * of active objects has been reached), the {@link #borrowObject}
-     * method should block until a new object is available, or the
-     * {@link #getMaxWait maximum wait time} has been reached.
+     * A "when exhausted action" type indicating that when the pool is exhausted
+     * (i.e., the maximum number of active objects has been reached), the
+     * {@link #borrowObject} method should block until a new object is
+     * available, or the {@link #getMaxWait maximum wait time} has been reached.
+     * 
      * @see #WHEN_EXHAUSTED_FAIL
      * @see #WHEN_EXHAUSTED_GROW
      * @see #setMaxWait
      * @see #getMaxWait
      * @see #setWhenExhaustedAction
      */
-    public static final byte WHEN_EXHAUSTED_BLOCK  = 1;
+    public static final byte WHEN_EXHAUSTED_BLOCK = 1;
 
     /**
-     * A "when exhausted action" type indicating that when the pool is
-     * exhausted (i.e., the maximum number
-     * of active objects has been reached), the {@link #borrowObject}
-     * method should simply create a new object anyway.
+     * A "when exhausted action" type indicating that when the pool is exhausted
+     * (i.e., the maximum number of active objects has been reached), the
+     * {@link #borrowObject} method should simply create a new object anyway.
+     * 
      * @see #WHEN_EXHAUSTED_FAIL
      * @see #WHEN_EXHAUSTED_GROW
      * @see #setWhenExhaustedAction
      */
-    public static final byte WHEN_EXHAUSTED_GROW   = 2;
+    public static final byte WHEN_EXHAUSTED_GROW = 2;
 
     /**
      * The default cap on the number of "sleeping" instances in the pool.
+     * 
      * @see #getMaxIdle
      * @see #setMaxIdle
      */
-    public static final int DEFAULT_MAX_IDLE  = 8;
+    public static final int DEFAULT_MAX_IDLE = 8;
 
     /**
-     * The default minimum number of "sleeping" instances in the pool
-     * before before the evictor thread (if active) spawns new objects.
+     * The default minimum number of "sleeping" instances in the pool before
+     * before the evictor thread (if active) spawns new objects.
+     * 
      * @see #getMinIdle
      * @see #setMinIdle
      */
@@ -246,12 +229,14 @@ public class GenericObjectPool<T> extend
 
     /**
      * The default cap on the total number of active instances from the pool.
+     * 
      * @see #getMaxActive
      */
-    public static final int DEFAULT_MAX_ACTIVE  = 8;
+    public static final int DEFAULT_MAX_ACTIVE = 8;
 
     /**
      * The default "when exhausted action" for the pool.
+     * 
      * @see #WHEN_EXHAUSTED_BLOCK
      * @see #WHEN_EXHAUSTED_FAIL
      * @see #WHEN_EXHAUSTED_GROW
@@ -260,11 +245,12 @@ public class GenericObjectPool<T> extend
     public static final byte DEFAULT_WHEN_EXHAUSTED_ACTION = WHEN_EXHAUSTED_BLOCK;
 
     /**
-     * The default LIFO status. True means that borrowObject returns the
-     * most recently used ("last in") idle object in the pool (if there are
-     * idle instances available).  False means that the pool behaves as a FIFO
-     * queue - objects are taken from the idle object pool in the order that
-     * they are returned to the pool.
+     * The default LIFO status. True means that borrowObject returns the most
+     * recently used ("last in") idle object in the pool (if there are idle
+     * instances available). False means that the pool behaves as a FIFO queue -
+     * objects are taken from the idle object pool in the order that they are
+     * returned to the pool.
+     * 
      * @see #setLifo
      * @since 1.4
      */
@@ -272,10 +258,10 @@ public class GenericObjectPool<T> extend
 
     /**
      * The default maximum amount of time (in milliseconds) the
-     * {@link #borrowObject} method should block before throwing
-     * an exception when the pool is exhausted and the
-     * {@link #getWhenExhaustedAction "when exhausted" action} is
-     * {@link #WHEN_EXHAUSTED_BLOCK}.
+     * {@link #borrowObject} method should block before throwing an exception
+     * when the pool is exhausted and the {@link #getWhenExhaustedAction
+     * "when exhausted" action} is {@link #WHEN_EXHAUSTED_BLOCK}.
+     * 
      * @see #getMaxWait
      * @see #setMaxWait
      */
@@ -283,6 +269,7 @@ public class GenericObjectPool<T> extend
 
     /**
      * The default "test on borrow" value.
+     * 
      * @see #getTestOnBorrow
      * @see #setTestOnBorrow
      */
@@ -290,6 +277,7 @@ public class GenericObjectPool<T> extend
 
     /**
      * The default "test on return" value.
+     * 
      * @see #getTestOnReturn
      * @see #setTestOnReturn
      */
@@ -297,6 +285,7 @@ public class GenericObjectPool<T> extend
 
     /**
      * The default "test while idle" value.
+     * 
      * @see #getTestWhileIdle
      * @see #setTestWhileIdle
      * @see #getTimeBetweenEvictionRunsMillis
@@ -306,14 +295,16 @@ public class GenericObjectPool<T> extend
 
     /**
      * The default "time between eviction runs" value.
+     * 
      * @see #getTimeBetweenEvictionRunsMillis
      * @see #setTimeBetweenEvictionRunsMillis
      */
     public static final long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS = -1L;
 
     /**
-     * The default number of objects to examine per run in the
-     * idle object evictor.
+     * The default number of objects to examine per run in the idle object
+     * evictor.
+     * 
      * @see #getNumTestsPerEvictionRun
      * @see #setNumTestsPerEvictionRun
      * @see #getTimeBetweenEvictionRunsMillis
@@ -323,6 +314,7 @@ public class GenericObjectPool<T> extend
 
     /**
      * The default value for {@link #getMinEvictableIdleTimeMillis}.
+     * 
      * @see #getMinEvictableIdleTimeMillis
      * @see #setMinEvictableIdleTimeMillis
      */
@@ -330,259 +322,470 @@ public class GenericObjectPool<T> extend
 
     /**
      * The default value for {@link #getSoftMinEvictableIdleTimeMillis}.
+     * 
      * @see #getSoftMinEvictableIdleTimeMillis
      * @see #setSoftMinEvictableIdleTimeMillis
      */
     public static final long DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS = -1;
 
-    //--- constructors -----------------------------------------------
+    // --- constructors -----------------------------------------------
 
     /**
      * Create a new <tt>GenericObjectPool</tt> with default properties.
      */
     public GenericObjectPool() {
-        this(null, DEFAULT_MAX_ACTIVE, DEFAULT_WHEN_EXHAUSTED_ACTION, DEFAULT_MAX_WAIT, DEFAULT_MAX_IDLE,
-                DEFAULT_MIN_IDLE, DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_RETURN, DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,
-                DEFAULT_NUM_TESTS_PER_EVICTION_RUN, DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_TEST_WHILE_IDLE);
+        this(null, DEFAULT_MAX_ACTIVE, DEFAULT_WHEN_EXHAUSTED_ACTION,
+                DEFAULT_MAX_WAIT, DEFAULT_MAX_IDLE, DEFAULT_MIN_IDLE,
+                DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_RETURN,
+                DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,
+                DEFAULT_NUM_TESTS_PER_EVICTION_RUN,
+                DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_TEST_WHILE_IDLE);
     }
 
     /**
      * Create a new <tt>GenericObjectPool</tt> using the specified factory.
-     * @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use to create, validate and destroy objects
+     * 
+     * @param factory
+     *            the (possibly <tt>null</tt>)PoolableObjectFactory to use to
+     *            create, validate and destroy objects
      */
     public GenericObjectPool(PoolableObjectFactory<T> factory) {
-        this(factory, DEFAULT_MAX_ACTIVE, DEFAULT_WHEN_EXHAUSTED_ACTION, DEFAULT_MAX_WAIT, DEFAULT_MAX_IDLE,
-                DEFAULT_MIN_IDLE, DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_RETURN, DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,
-                DEFAULT_NUM_TESTS_PER_EVICTION_RUN, DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_TEST_WHILE_IDLE);
+        this(factory, DEFAULT_MAX_ACTIVE, DEFAULT_WHEN_EXHAUSTED_ACTION,
+                DEFAULT_MAX_WAIT, DEFAULT_MAX_IDLE, DEFAULT_MIN_IDLE,
+                DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_RETURN,
+                DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,
+                DEFAULT_NUM_TESTS_PER_EVICTION_RUN,
+                DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_TEST_WHILE_IDLE);
     }
 
     /**
      * Create a new <tt>GenericObjectPool</tt> using the specified values.
-     * @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use to create, validate and destroy objects
-     * @param config a non-<tt>null</tt> {@link GenericObjectPool.Config} describing my configuration
-     */
-    public GenericObjectPool(PoolableObjectFactory<T> factory, GenericObjectPool.Config config) {
-        this(factory, config.maxActive, config.whenExhaustedAction, config.maxWait, config.maxIdle, config.minIdle,
-                config.testOnBorrow, config.testOnReturn, config.timeBetweenEvictionRunsMillis, 
-                config.numTestsPerEvictionRun, config.minEvictableIdleTimeMillis, config.testWhileIdle, 
+     * 
+     * @param factory
+     *            the (possibly <tt>null</tt>)PoolableObjectFactory to use to
+     *            create, validate and destroy objects
+     * @param config
+     *            a non-<tt>null</tt> {@link GenericObjectPool.Config}
+     *            describing my configuration
+     */
+    public GenericObjectPool(PoolableObjectFactory<T> factory,
+            GenericObjectPool.Config config) {
+        this(factory, config.maxActive, config.whenExhaustedAction,
+                config.maxWait, config.maxIdle, config.minIdle,
+                config.testOnBorrow, config.testOnReturn,
+                config.timeBetweenEvictionRunsMillis,
+                config.numTestsPerEvictionRun,
+                config.minEvictableIdleTimeMillis, config.testWhileIdle,
                 config.softMinEvictableIdleTimeMillis, config.lifo);
     }
 
     /**
      * Create a new <tt>GenericObjectPool</tt> using the specified values.
-     * @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use to create, validate and destroy objects
-     * @param maxActive the maximum number of objects that can be borrowed from me at one time (see {@link #setMaxActive})
+     * 
+     * @param factory
+     *            the (possibly <tt>null</tt>)PoolableObjectFactory to use to
+     *            create, validate and destroy objects
+     * @param maxActive
+     *            the maximum number of objects that can be borrowed from me at
+     *            one time (see {@link #setMaxActive})
      */
     public GenericObjectPool(PoolableObjectFactory<T> factory, int maxActive) {
-        this(factory, maxActive, DEFAULT_WHEN_EXHAUSTED_ACTION, DEFAULT_MAX_WAIT, DEFAULT_MAX_IDLE, DEFAULT_MIN_IDLE,
-                DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_RETURN, DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,
-                DEFAULT_NUM_TESTS_PER_EVICTION_RUN, DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_TEST_WHILE_IDLE);
+        this(factory, maxActive, DEFAULT_WHEN_EXHAUSTED_ACTION,
+                DEFAULT_MAX_WAIT, DEFAULT_MAX_IDLE, DEFAULT_MIN_IDLE,
+                DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_RETURN,
+                DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,
+                DEFAULT_NUM_TESTS_PER_EVICTION_RUN,
+                DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_TEST_WHILE_IDLE);
     }
 
     /**
      * Create a new <tt>GenericObjectPool</tt> using the specified values.
-     * @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use to create, validate and destroy objects
-     * @param maxActive the maximum number of objects that can be borrowed from me at one time (see {@link #setMaxActive})
-     * @param whenExhaustedAction the action to take when the pool is exhausted (see {@link #getWhenExhaustedAction})
-     * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted an and
-     * <i>whenExhaustedAction</i> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see {@link #getMaxWait})
-     */
-    public GenericObjectPool(PoolableObjectFactory<T> factory, int maxActive, byte whenExhaustedAction, long maxWait) {
-        this(factory, maxActive, whenExhaustedAction, maxWait, DEFAULT_MAX_IDLE, DEFAULT_MIN_IDLE, DEFAULT_TEST_ON_BORROW,
-                DEFAULT_TEST_ON_RETURN, DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS, DEFAULT_NUM_TESTS_PER_EVICTION_RUN,
+     * 
+     * @param factory
+     *            the (possibly <tt>null</tt>)PoolableObjectFactory to use to
+     *            create, validate and destroy objects
+     * @param maxActive
+     *            the maximum number of objects that can be borrowed from me at
+     *            one time (see {@link #setMaxActive})
+     * @param whenExhaustedAction
+     *            the action to take when the pool is exhausted (see
+     *            {@link #getWhenExhaustedAction})
+     * @param maxWait
+     *            the maximum amount of time to wait for an idle object when the
+     *            pool is exhausted an and <i>whenExhaustedAction</i> is
+     *            {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see
+     *            {@link #getMaxWait})
+     */
+    public GenericObjectPool(PoolableObjectFactory<T> factory, int maxActive,
+            byte whenExhaustedAction, long maxWait) {
+        this(factory, maxActive, whenExhaustedAction, maxWait,
+                DEFAULT_MAX_IDLE, DEFAULT_MIN_IDLE, DEFAULT_TEST_ON_BORROW,
+                DEFAULT_TEST_ON_RETURN,
+                DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,
+                DEFAULT_NUM_TESTS_PER_EVICTION_RUN,
                 DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_TEST_WHILE_IDLE);
     }
 
     /**
      * Create a new <tt>GenericObjectPool</tt> using the specified values.
-     * @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use to create, validate and destroy objects
-     * @param maxActive the maximum number of objects that can be borrowed at one time (see {@link #setMaxActive})
-     * @param whenExhaustedAction the action to take when the pool is exhausted (see {@link #getWhenExhaustedAction})
-     * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted an and
-     * <i>whenExhaustedAction</i> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see {@link #getMaxWait})
-     * @param testOnBorrow whether or not to validate objects before they are returned by the {@link #borrowObject} method
-     * (see {@link #getTestOnBorrow})
-     * @param testOnReturn whether or not to validate objects after they are returned to the {@link #returnObject} method
-     * (see {@link #getTestOnReturn})
-     */
-    public GenericObjectPool(PoolableObjectFactory<T> factory, int maxActive, byte whenExhaustedAction, long maxWait,
-            boolean testOnBorrow, boolean testOnReturn) {
-        this(factory, maxActive, whenExhaustedAction, maxWait, DEFAULT_MAX_IDLE, DEFAULT_MIN_IDLE, testOnBorrow,
-                testOnReturn, DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS, DEFAULT_NUM_TESTS_PER_EVICTION_RUN,
+     * 
+     * @param factory
+     *            the (possibly <tt>null</tt>)PoolableObjectFactory to use to
+     *            create, validate and destroy objects
+     * @param maxActive
+     *            the maximum number of objects that can be borrowed at one time
+     *            (see {@link #setMaxActive})
+     * @param whenExhaustedAction
+     *            the action to take when the pool is exhausted (see
+     *            {@link #getWhenExhaustedAction})
+     * @param maxWait
+     *            the maximum amount of time to wait for an idle object when the
+     *            pool is exhausted an and <i>whenExhaustedAction</i> is
+     *            {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see
+     *            {@link #getMaxWait})
+     * @param testOnBorrow
+     *            whether or not to validate objects before they are returned by
+     *            the {@link #borrowObject} method (see {@link #getTestOnBorrow}
+     *            )
+     * @param testOnReturn
+     *            whether or not to validate objects after they are returned to
+     *            the {@link #returnObject} method (see {@link #getTestOnReturn}
+     *            )
+     */
+    public GenericObjectPool(PoolableObjectFactory<T> factory, int maxActive,
+            byte whenExhaustedAction, long maxWait, boolean testOnBorrow,
+            boolean testOnReturn) {
+        this(factory, maxActive, whenExhaustedAction, maxWait,
+                DEFAULT_MAX_IDLE, DEFAULT_MIN_IDLE, testOnBorrow, testOnReturn,
+                DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,
+                DEFAULT_NUM_TESTS_PER_EVICTION_RUN,
                 DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_TEST_WHILE_IDLE);
     }
 
     /**
      * Create a new <tt>GenericObjectPool</tt> using the specified values.
-     * @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use to create, validate and destroy objects
-     * @param maxActive the maximum number of objects that can be borrowed at one time (see {@link #setMaxActive})
-     * @param whenExhaustedAction the action to take when the pool is exhausted (see {@link #getWhenExhaustedAction})
-     * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted and 
-     * <i>whenExhaustedAction</i> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see {@link #getMaxWait})
-     * @param maxIdle the maximum number of idle objects in my pool (see {@link #getMaxIdle})
-     */
-    public GenericObjectPool(PoolableObjectFactory<T> factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle) {
-        this(factory, maxActive, whenExhaustedAction, maxWait, maxIdle, DEFAULT_MIN_IDLE, DEFAULT_TEST_ON_BORROW,
-                DEFAULT_TEST_ON_RETURN, DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS, DEFAULT_NUM_TESTS_PER_EVICTION_RUN,
+     * 
+     * @param factory
+     *            the (possibly <tt>null</tt>)PoolableObjectFactory to use to
+     *            create, validate and destroy objects
+     * @param maxActive
+     *            the maximum number of objects that can be borrowed at one time
+     *            (see {@link #setMaxActive})
+     * @param whenExhaustedAction
+     *            the action to take when the pool is exhausted (see
+     *            {@link #getWhenExhaustedAction})
+     * @param maxWait
+     *            the maximum amount of time to wait for an idle object when the
+     *            pool is exhausted and <i>whenExhaustedAction</i> is
+     *            {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see
+     *            {@link #getMaxWait})
+     * @param maxIdle
+     *            the maximum number of idle objects in my pool (see
+     *            {@link #getMaxIdle})
+     */
+    public GenericObjectPool(PoolableObjectFactory<T> factory, int maxActive,
+            byte whenExhaustedAction, long maxWait, int maxIdle) {
+        this(factory, maxActive, whenExhaustedAction, maxWait, maxIdle,
+                DEFAULT_MIN_IDLE, DEFAULT_TEST_ON_BORROW,
+                DEFAULT_TEST_ON_RETURN,
+                DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,
+                DEFAULT_NUM_TESTS_PER_EVICTION_RUN,
                 DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_TEST_WHILE_IDLE);
     }
 
     /**
      * Create a new <tt>GenericObjectPool</tt> using the specified values.
-     * @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use to create, validate and destroy objects
-     * @param maxActive the maximum number of objects that can be borrowed at one time (see {@link #setMaxActive})
-     * @param whenExhaustedAction the action to take when the pool is exhausted (see {@link #getWhenExhaustedAction})
-     * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted and
-     * <i>whenExhaustedAction</i> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see {@link #getMaxWait})
-     * @param maxIdle the maximum number of idle objects in my pool (see {@link #getMaxIdle})
-     * @param testOnBorrow whether or not to validate objects before they are returned by the {@link #borrowObject} method
-     * (see {@link #getTestOnBorrow})
-     * @param testOnReturn whether or not to validate objects after they are returned to the {@link #returnObject} method
-     * (see {@link #getTestOnReturn})
-     */
-    public GenericObjectPool(PoolableObjectFactory<T> factory, int maxActive, byte whenExhaustedAction, long maxWait,
-            int maxIdle, boolean testOnBorrow, boolean testOnReturn) {
-        this(factory, maxActive, whenExhaustedAction, maxWait, maxIdle, DEFAULT_MIN_IDLE, testOnBorrow, testOnReturn,
-                DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS, DEFAULT_NUM_TESTS_PER_EVICTION_RUN,
+     * 
+     * @param factory
+     *            the (possibly <tt>null</tt>)PoolableObjectFactory to use to
+     *            create, validate and destroy objects
+     * @param maxActive
+     *            the maximum number of objects that can be borrowed at one time
+     *            (see {@link #setMaxActive})
+     * @param whenExhaustedAction
+     *            the action to take when the pool is exhausted (see
+     *            {@link #getWhenExhaustedAction})
+     * @param maxWait
+     *            the maximum amount of time to wait for an idle object when the
+     *            pool is exhausted and <i>whenExhaustedAction</i> is
+     *            {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see
+     *            {@link #getMaxWait})
+     * @param maxIdle
+     *            the maximum number of idle objects in my pool (see
+     *            {@link #getMaxIdle})
+     * @param testOnBorrow
+     *            whether or not to validate objects before they are returned by
+     *            the {@link #borrowObject} method (see {@link #getTestOnBorrow}
+     *            )
+     * @param testOnReturn
+     *            whether or not to validate objects after they are returned to
+     *            the {@link #returnObject} method (see {@link #getTestOnReturn}
+     *            )
+     */
+    public GenericObjectPool(PoolableObjectFactory<T> factory, int maxActive,
+            byte whenExhaustedAction, long maxWait, int maxIdle,
+            boolean testOnBorrow, boolean testOnReturn) {
+        this(factory, maxActive, whenExhaustedAction, maxWait, maxIdle,
+                DEFAULT_MIN_IDLE, testOnBorrow, testOnReturn,
+                DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,
+                DEFAULT_NUM_TESTS_PER_EVICTION_RUN,
                 DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_TEST_WHILE_IDLE);
     }
 
     /**
      * Create a new <tt>GenericObjectPool</tt> using the specified values.
-     * @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use to create, validate and destroy objects
-     * @param maxActive the maximum number of objects that can be borrowed at one time (see {@link #setMaxActive})
-     * @param whenExhaustedAction the action to take when the pool is exhausted (see {@link #setWhenExhaustedAction})
-     * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted and 
-     * <i>whenExhaustedAction</i> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see {@link #setMaxWait})
-     * @param maxIdle the maximum number of idle objects in my pool (see {@link #setMaxIdle})
-     * @param testOnBorrow whether or not to validate objects before they are returned by the {@link #borrowObject}
-     * method (see {@link #setTestOnBorrow})
-     * @param testOnReturn whether or not to validate objects after they are returned to the {@link #returnObject} method
-     * (see {@link #setTestOnReturn})
-     * @param timeBetweenEvictionRunsMillis the amount of time (in milliseconds) to sleep between examining idle objects
-     * for eviction (see {@link #setTimeBetweenEvictionRunsMillis})
-     * @param numTestsPerEvictionRun the number of idle objects to examine per run within the idle object eviction thread
-     * (if any) (see {@link #setNumTestsPerEvictionRun})
-     * @param minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it
-     * is eligible for eviction (see {@link #setMinEvictableIdleTimeMillis})
-     * @param testWhileIdle whether or not to validate objects in the idle object eviction thread, if any
-     * (see {@link #setTestWhileIdle})
-     */
-    public GenericObjectPool(PoolableObjectFactory<T> factory, int maxActive, byte whenExhaustedAction, long maxWait,
-            int maxIdle, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis,
-            int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle) {
-        this(factory, maxActive, whenExhaustedAction, maxWait, maxIdle, DEFAULT_MIN_IDLE, testOnBorrow, testOnReturn,
-                timeBetweenEvictionRunsMillis, numTestsPerEvictionRun, minEvictableIdleTimeMillis, testWhileIdle);
+     * 
+     * @param factory
+     *            the (possibly <tt>null</tt>)PoolableObjectFactory to use to
+     *            create, validate and destroy objects
+     * @param maxActive
+     *            the maximum number of objects that can be borrowed at one time
+     *            (see {@link #setMaxActive})
+     * @param whenExhaustedAction
+     *            the action to take when the pool is exhausted (see
+     *            {@link #setWhenExhaustedAction})
+     * @param maxWait
+     *            the maximum amount of time to wait for an idle object when the
+     *            pool is exhausted and <i>whenExhaustedAction</i> is
+     *            {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see
+     *            {@link #setMaxWait})
+     * @param maxIdle
+     *            the maximum number of idle objects in my pool (see
+     *            {@link #setMaxIdle})
+     * @param testOnBorrow
+     *            whether or not to validate objects before they are returned by
+     *            the {@link #borrowObject} method (see {@link #setTestOnBorrow}
+     *            )
+     * @param testOnReturn
+     *            whether or not to validate objects after they are returned to
+     *            the {@link #returnObject} method (see {@link #setTestOnReturn}
+     *            )
+     * @param timeBetweenEvictionRunsMillis
+     *            the amount of time (in milliseconds) to sleep between
+     *            examining idle objects for eviction (see
+     *            {@link #setTimeBetweenEvictionRunsMillis})
+     * @param numTestsPerEvictionRun
+     *            the number of idle objects to examine per run within the idle
+     *            object eviction thread (if any) (see
+     *            {@link #setNumTestsPerEvictionRun})
+     * @param minEvictableIdleTimeMillis
+     *            the minimum number of milliseconds an object can sit idle in
+     *            the pool before it is eligible for eviction (see
+     *            {@link #setMinEvictableIdleTimeMillis})
+     * @param testWhileIdle
+     *            whether or not to validate objects in the idle object eviction
+     *            thread, if any (see {@link #setTestWhileIdle})
+     */
+    public GenericObjectPool(PoolableObjectFactory<T> factory, int maxActive,
+            byte whenExhaustedAction, long maxWait, int maxIdle,
+            boolean testOnBorrow, boolean testOnReturn,
+            long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun,
+            long minEvictableIdleTimeMillis, boolean testWhileIdle) {
+        this(factory, maxActive, whenExhaustedAction, maxWait, maxIdle,
+                DEFAULT_MIN_IDLE, testOnBorrow, testOnReturn,
+                timeBetweenEvictionRunsMillis, numTestsPerEvictionRun,
+                minEvictableIdleTimeMillis, testWhileIdle);
     }
 
     /**
      * Create a new <tt>GenericObjectPool</tt> using the specified values.
-     * @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use to create, validate and destroy objects
-     * @param maxActive the maximum number of objects that can be borrowed at one time (see {@link #setMaxActive})
-     * @param whenExhaustedAction the action to take when the pool is exhausted (see {@link #setWhenExhaustedAction})
-     * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted and
-     *  <i>whenExhaustedAction</i> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see {@link #setMaxWait})
-     * @param maxIdle the maximum number of idle objects in my pool (see {@link #setMaxIdle})
-     * @param minIdle the minimum number of idle objects in my pool (see {@link #setMinIdle})
-     * @param testOnBorrow whether or not to validate objects before they are returned by the {@link #borrowObject} method
-     * (see {@link #setTestOnBorrow})
-     * @param testOnReturn whether or not to validate objects after they are returned to the {@link #returnObject} method
-     * (see {@link #setTestOnReturn})
-     * @param timeBetweenEvictionRunsMillis the amount of time (in milliseconds) to sleep between examining idle objects
-     * for eviction (see {@link #setTimeBetweenEvictionRunsMillis})
-     * @param numTestsPerEvictionRun the number of idle objects to examine per run within the idle object eviction thread
-     * (if any) (see {@link #setNumTestsPerEvictionRun})
-     * @param minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before
-     * it is eligible for eviction (see {@link #setMinEvictableIdleTimeMillis})
-     * @param testWhileIdle whether or not to validate objects in the idle object eviction thread, if any
-     *  (see {@link #setTestWhileIdle})
-     */
-    public GenericObjectPool(PoolableObjectFactory<T> factory, int maxActive, byte whenExhaustedAction, long maxWait,
-            int maxIdle, int minIdle, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis,
-            int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle) {
-        this(factory, maxActive, whenExhaustedAction, maxWait, maxIdle, minIdle, testOnBorrow, testOnReturn,
-                timeBetweenEvictionRunsMillis, numTestsPerEvictionRun, minEvictableIdleTimeMillis, testWhileIdle,
+     * 
+     * @param factory
+     *            the (possibly <tt>null</tt>)PoolableObjectFactory to use to
+     *            create, validate and destroy objects
+     * @param maxActive
+     *            the maximum number of objects that can be borrowed at one time
+     *            (see {@link #setMaxActive})
+     * @param whenExhaustedAction
+     *            the action to take when the pool is exhausted (see
+     *            {@link #setWhenExhaustedAction})
+     * @param maxWait
+     *            the maximum amount of time to wait for an idle object when the
+     *            pool is exhausted and <i>whenExhaustedAction</i> is
+     *            {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see
+     *            {@link #setMaxWait})
+     * @param maxIdle
+     *            the maximum number of idle objects in my pool (see
+     *            {@link #setMaxIdle})
+     * @param minIdle
+     *            the minimum number of idle objects in my pool (see
+     *            {@link #setMinIdle})
+     * @param testOnBorrow
+     *            whether or not to validate objects before they are returned by
+     *            the {@link #borrowObject} method (see {@link #setTestOnBorrow}
+     *            )
+     * @param testOnReturn
+     *            whether or not to validate objects after they are returned to
+     *            the {@link #returnObject} method (see {@link #setTestOnReturn}
+     *            )
+     * @param timeBetweenEvictionRunsMillis
+     *            the amount of time (in milliseconds) to sleep between
+     *            examining idle objects for eviction (see
+     *            {@link #setTimeBetweenEvictionRunsMillis})
+     * @param numTestsPerEvictionRun
+     *            the number of idle objects to examine per run within the idle
+     *            object eviction thread (if any) (see
+     *            {@link #setNumTestsPerEvictionRun})
+     * @param minEvictableIdleTimeMillis
+     *            the minimum number of milliseconds an object can sit idle in
+     *            the pool before it is eligible for eviction (see
+     *            {@link #setMinEvictableIdleTimeMillis})
+     * @param testWhileIdle
+     *            whether or not to validate objects in the idle object eviction
+     *            thread, if any (see {@link #setTestWhileIdle})
+     */
+    public GenericObjectPool(PoolableObjectFactory<T> factory, int maxActive,
+            byte whenExhaustedAction, long maxWait, int maxIdle, int minIdle,
+            boolean testOnBorrow, boolean testOnReturn,
+            long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun,
+            long minEvictableIdleTimeMillis, boolean testWhileIdle) {
+        this(factory, maxActive, whenExhaustedAction, maxWait, maxIdle,
+                minIdle, testOnBorrow, testOnReturn,
+                timeBetweenEvictionRunsMillis, numTestsPerEvictionRun,
+                minEvictableIdleTimeMillis, testWhileIdle,
                 DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS);
     }
 
     /**
      * Create a new <tt>GenericObjectPool</tt> using the specified values.
-     * @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use to create, validate and destroy objects
-     * @param maxActive the maximum number of objects that can be borrowed at one time (see {@link #setMaxActive})
-     * @param whenExhaustedAction the action to take when the pool is exhausted (see {@link #setWhenExhaustedAction})
-     * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted and
-     * <i>whenExhaustedAction</i> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see {@link #setMaxWait})
-     * @param maxIdle the maximum number of idle objects in my pool (see {@link #setMaxIdle})
-     * @param minIdle the minimum number of idle objects in my pool (see {@link #setMinIdle})
-     * @param testOnBorrow whether or not to validate objects before they are returned by the {@link #borrowObject}
-     * method (see {@link #setTestOnBorrow})
-     * @param testOnReturn whether or not to validate objects after they are returned to the {@link #returnObject}
-     * method (see {@link #setTestOnReturn})
-     * @param timeBetweenEvictionRunsMillis the amount of time (in milliseconds) to sleep between examining idle objects
-     * for eviction (see {@link #setTimeBetweenEvictionRunsMillis})
-     * @param numTestsPerEvictionRun the number of idle objects to examine per run within the idle object eviction thread
-     * (if any) (see {@link #setNumTestsPerEvictionRun})
-     * @param minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before
-     * it is eligible for eviction (see {@link #setMinEvictableIdleTimeMillis})
-     * @param testWhileIdle whether or not to validate objects in the idle object eviction thread, if any
-     * (see {@link #setTestWhileIdle})
-     * @param softMinEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it is
-     * eligible for eviction with the extra condition that at least "minIdle" amount of object remain in the pool.
-     * (see {@link #setSoftMinEvictableIdleTimeMillis})
+     * 
+     * @param factory
+     *            the (possibly <tt>null</tt>)PoolableObjectFactory to use to
+     *            create, validate and destroy objects
+     * @param maxActive
+     *            the maximum number of objects that can be borrowed at one time
+     *            (see {@link #setMaxActive})
+     * @param whenExhaustedAction
+     *            the action to take when the pool is exhausted (see
+     *            {@link #setWhenExhaustedAction})
+     * @param maxWait
+     *            the maximum amount of time to wait for an idle object when the
+     *            pool is exhausted and <i>whenExhaustedAction</i> is
+     *            {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see
+     *            {@link #setMaxWait})
+     * @param maxIdle
+     *            the maximum number of idle objects in my pool (see
+     *            {@link #setMaxIdle})
+     * @param minIdle
+     *            the minimum number of idle objects in my pool (see
+     *            {@link #setMinIdle})
+     * @param testOnBorrow
+     *            whether or not to validate objects before they are returned by
+     *            the {@link #borrowObject} method (see {@link #setTestOnBorrow}
+     *            )
+     * @param testOnReturn
+     *            whether or not to validate objects after they are returned to
+     *            the {@link #returnObject} method (see {@link #setTestOnReturn}
+     *            )
+     * @param timeBetweenEvictionRunsMillis
+     *            the amount of time (in milliseconds) to sleep between
+     *            examining idle objects for eviction (see
+     *            {@link #setTimeBetweenEvictionRunsMillis})
+     * @param numTestsPerEvictionRun
+     *            the number of idle objects to examine per run within the idle
+     *            object eviction thread (if any) (see
+     *            {@link #setNumTestsPerEvictionRun})
+     * @param minEvictableIdleTimeMillis
+     *            the minimum number of milliseconds an object can sit idle in
+     *            the pool before it is eligible for eviction (see
+     *            {@link #setMinEvictableIdleTimeMillis})
+     * @param testWhileIdle
+     *            whether or not to validate objects in the idle object eviction
+     *            thread, if any (see {@link #setTestWhileIdle})
+     * @param softMinEvictableIdleTimeMillis
+     *            the minimum number of milliseconds an object can sit idle in
+     *            the pool before it is eligible for eviction with the extra
+     *            condition that at least "minIdle" amount of object remain in
+     *            the pool. (see {@link #setSoftMinEvictableIdleTimeMillis})
      * @since Pool 1.3
      */
-    public GenericObjectPool(PoolableObjectFactory<T> factory, int maxActive, byte whenExhaustedAction, long maxWait,
-            int maxIdle, int minIdle, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis,
-            int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle,
+    public GenericObjectPool(PoolableObjectFactory<T> factory, int maxActive,
+            byte whenExhaustedAction, long maxWait, int maxIdle, int minIdle,
+            boolean testOnBorrow, boolean testOnReturn,
+            long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun,
+            long minEvictableIdleTimeMillis, boolean testWhileIdle,
             long softMinEvictableIdleTimeMillis) {
-        this(factory, maxActive, whenExhaustedAction, maxWait, maxIdle, minIdle, testOnBorrow, testOnReturn,
-                timeBetweenEvictionRunsMillis, numTestsPerEvictionRun, minEvictableIdleTimeMillis, testWhileIdle,
+        this(factory, maxActive, whenExhaustedAction, maxWait, maxIdle,
+                minIdle, testOnBorrow, testOnReturn,
+                timeBetweenEvictionRunsMillis, numTestsPerEvictionRun,
+                minEvictableIdleTimeMillis, testWhileIdle,
                 softMinEvictableIdleTimeMillis, DEFAULT_LIFO);
     }
 
     /**
      * Create a new <tt>GenericObjectPool</tt> using the specified values.
-     * @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use to create, validate and destroy objects
-     * @param maxActive the maximum number of objects that can be borrowed at one time (see {@link #setMaxActive})
-     * @param whenExhaustedAction the action to take when the pool is exhausted (see {@link #setWhenExhaustedAction})
-     * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted and
-     * <i>whenExhaustedAction</i> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see {@link #setMaxWait})
-     * @param maxIdle the maximum number of idle objects in my pool (see {@link #setMaxIdle})
-     * @param minIdle the minimum number of idle objects in my pool (see {@link #setMinIdle})
-     * @param testOnBorrow whether or not to validate objects before they are returned by the {@link #borrowObject}
-     * method (see {@link #setTestOnBorrow})
-     * @param testOnReturn whether or not to validate objects after they are returned to the {@link #returnObject}
-     * method (see {@link #setTestOnReturn})
-     * @param timeBetweenEvictionRunsMillis the amount of time (in milliseconds) to sleep between examining idle
-     * objects for eviction (see {@link #setTimeBetweenEvictionRunsMillis})
-     * @param numTestsPerEvictionRun the number of idle objects to examine per run within the idle object eviction
-     * thread (if any) (see {@link #setNumTestsPerEvictionRun})
-     * @param minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before
-     * it is eligible for eviction (see {@link #setMinEvictableIdleTimeMillis})
-     * @param testWhileIdle whether or not to validate objects in the idle object eviction thread, if any
-     * (see {@link #setTestWhileIdle})
-     * @param softMinEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the
-     * pool before it is eligible for eviction with the extra condition that at least "minIdle" amount of object
-     * remain in the pool. (see {@link #setSoftMinEvictableIdleTimeMillis})
-     * @param lifo whether or not objects are returned in last-in-first-out order from the idle object pool
-     * (see {@link #setLifo})
+     * 
+     * @param factory
+     *            the (possibly <tt>null</tt>)PoolableObjectFactory to use to
+     *            create, validate and destroy objects
+     * @param maxActive
+     *            the maximum number of objects that can be borrowed at one time
+     *            (see {@link #setMaxActive})
+     * @param whenExhaustedAction
+     *            the action to take when the pool is exhausted (see
+     *            {@link #setWhenExhaustedAction})
+     * @param maxWait
+     *            the maximum amount of time to wait for an idle object when the
+     *            pool is exhausted and <i>whenExhaustedAction</i> is
+     *            {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see
+     *            {@link #setMaxWait})
+     * @param maxIdle
+     *            the maximum number of idle objects in my pool (see
+     *            {@link #setMaxIdle})
+     * @param minIdle
+     *            the minimum number of idle objects in my pool (see
+     *            {@link #setMinIdle})
+     * @param testOnBorrow
+     *            whether or not to validate objects before they are returned by
+     *            the {@link #borrowObject} method (see {@link #setTestOnBorrow}
+     *            )
+     * @param testOnReturn
+     *            whether or not to validate objects after they are returned to
+     *            the {@link #returnObject} method (see {@link #setTestOnReturn}
+     *            )
+     * @param timeBetweenEvictionRunsMillis
+     *            the amount of time (in milliseconds) to sleep between
+     *            examining idle objects for eviction (see
+     *            {@link #setTimeBetweenEvictionRunsMillis})
+     * @param numTestsPerEvictionRun
+     *            the number of idle objects to examine per run within the idle
+     *            object eviction thread (if any) (see
+     *            {@link #setNumTestsPerEvictionRun})
+     * @param minEvictableIdleTimeMillis
+     *            the minimum number of milliseconds an object can sit idle in
+     *            the pool before it is eligible for eviction (see
+     *            {@link #setMinEvictableIdleTimeMillis})
+     * @param testWhileIdle
+     *            whether or not to validate objects in the idle object eviction
+     *            thread, if any (see {@link #setTestWhileIdle})
+     * @param softMinEvictableIdleTimeMillis
+     *            the minimum number of milliseconds an object can sit idle in
+     *            the pool before it is eligible for eviction with the extra
+     *            condition that at least "minIdle" amount of object remain in
+     *            the pool. (see {@link #setSoftMinEvictableIdleTimeMillis})
+     * @param lifo
+     *            whether or not objects are returned in last-in-first-out order
+     *            from the idle object pool (see {@link #setLifo})
      * @since Pool 1.4
      */
-    public GenericObjectPool(PoolableObjectFactory<T> factory, int maxActive, byte whenExhaustedAction, long maxWait,
-            int maxIdle, int minIdle, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis,
-            int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle,
+    public GenericObjectPool(PoolableObjectFactory<T> factory, int maxActive,
+            byte whenExhaustedAction, long maxWait, int maxIdle, int minIdle,
+            boolean testOnBorrow, boolean testOnReturn,
+            long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun,
+            long minEvictableIdleTimeMillis, boolean testWhileIdle,
             long softMinEvictableIdleTimeMillis, boolean lifo) {
         _factory = factory;
         _maxActive = maxActive;
         _lifo = lifo;
-        switch(whenExhaustedAction) {
-            case WHEN_EXHAUSTED_BLOCK:
-            case WHEN_EXHAUSTED_FAIL:
-            case WHEN_EXHAUSTED_GROW:
-                _whenExhaustedAction = whenExhaustedAction;
-                break;
-            default:
-                throw new IllegalArgumentException("whenExhaustedAction " + whenExhaustedAction + " not recognized.");
+        switch (whenExhaustedAction) {
+        case WHEN_EXHAUSTED_BLOCK:
+        case WHEN_EXHAUSTED_FAIL:
+        case WHEN_EXHAUSTED_GROW:
+            _whenExhaustedAction = whenExhaustedAction;
+            break;
+        default:
+            throw new IllegalArgumentException("whenExhaustedAction " +
+                    whenExhaustedAction + " not recognized.");
         }
         _maxWait = maxWait;
         _maxIdle = maxIdle;
@@ -601,17 +804,18 @@ public class GenericObjectPool<T> extend
         startEvictor(_timeBetweenEvictionRunsMillis);
     }
 
-    //--- public methods ---------------------------------------------
+    // --- public methods ---------------------------------------------
 
-    //--- configuration methods --------------------------------------
+    // --- configuration methods --------------------------------------
 
     /**
      * Returns the maximum number of objects that can be allocated by the pool
-     * (checked out to clients, or idle awaiting checkout) at a given time.
-     * When non-positive, there is no limit to the number of objects that can
-     * be managed by the pool at one time.
-     *
-     * @return the cap on the total number of object instances managed by the pool.
+     * (checked out to clients, or idle awaiting checkout) at a given time. When
+     * non-positive, there is no limit to the number of objects that can be
+     * managed by the pool at one time.
+     * 
+     * @return the cap on the total number of object instances managed by the
+     *         pool.
      * @see #setMaxActive
      */
     public int getMaxActive() {
@@ -622,10 +826,11 @@ public class GenericObjectPool<T> extend
      * Sets the cap on the number of objects that can be allocated by the pool
      * (checked out to clients, or idle awaiting checkout) at a given time. Use
      * a negative value for no limit.
-     *
-     * @param maxActive The cap on the total number of object instances managed by the pool.
-     * Negative values mean that there is no limit to the number of objects allocated
-     * by the pool.
+     * 
+     * @param maxActive
+     *            The cap on the total number of object instances managed by the
+     *            pool. Negative values mean that there is no limit to the
+     *            number of objects allocated by the pool.
      * @see #getMaxActive
      */
     public void setMaxActive(int maxActive) {
@@ -633,11 +838,12 @@ public class GenericObjectPool<T> extend
     }
 
     /**
-     * Returns the action to take when the {@link #borrowObject} method
-     * is invoked when the pool is exhausted (the maximum number
-     * of "active" objects has been reached).
-     *
-     * @return one of {@link #WHEN_EXHAUSTED_BLOCK}, {@link #WHEN_EXHAUSTED_FAIL} or {@link #WHEN_EXHAUSTED_GROW}
+     * Returns the action to take when the {@link #borrowObject} method is
+     * invoked when the pool is exhausted (the maximum number of "active"
+     * objects has been reached).
+     * 
+     * @return one of {@link #WHEN_EXHAUSTED_BLOCK},
+     *         {@link #WHEN_EXHAUSTED_FAIL} or {@link #WHEN_EXHAUSTED_GROW}
      * @see #setWhenExhaustedAction
      */
     public byte getWhenExhaustedAction() {
@@ -645,38 +851,36 @@ public class GenericObjectPool<T> extend
     }
 
     /**
-     * Sets the action to take when the {@link #borrowObject} method
-     * is invoked when the pool is exhausted (the maximum number
-     * of "active" objects has been reached).
-     *
-     * @param whenExhaustedAction the action code, which must be one of
-     *        {@link #WHEN_EXHAUSTED_BLOCK}, {@link #WHEN_EXHAUSTED_FAIL},
-     *        or {@link #WHEN_EXHAUSTED_GROW}
+     * Sets the action to take when the {@link #borrowObject} method is invoked
+     * when the pool is exhausted (the maximum number of "active" objects has
+     * been reached).
+     * 
+     * @param whenExhaustedAction
+     *            the action code, which must be one of
+     *            {@link #WHEN_EXHAUSTED_BLOCK}, {@link #WHEN_EXHAUSTED_FAIL},
+     *            or {@link #WHEN_EXHAUSTED_GROW}
      * @see #getWhenExhaustedAction
      */
     public void setWhenExhaustedAction(byte whenExhaustedAction) {
-        switch(whenExhaustedAction) {
-            case WHEN_EXHAUSTED_BLOCK:
-            case WHEN_EXHAUSTED_FAIL:
-            case WHEN_EXHAUSTED_GROW:
-                _whenExhaustedAction = whenExhaustedAction;
-                break;
-            default:
-                throw new IllegalArgumentException("whenExhaustedAction " + whenExhaustedAction + " not recognized.");
+        switch (whenExhaustedAction) {
+        case WHEN_EXHAUSTED_BLOCK:
+        case WHEN_EXHAUSTED_FAIL:
+        case WHEN_EXHAUSTED_GROW:
+            _whenExhaustedAction = whenExhaustedAction;
+            break;
+        default:
+            throw new IllegalArgumentException("whenExhaustedAction " +
+                    whenExhaustedAction + " not recognized.");
         }
     }
 
-
     /**
      * Returns the maximum amount of time (in milliseconds) the
-     * {@link #borrowObject} method should block before throwing
-     * an exception when the pool is exhausted and the
-     * {@link #setWhenExhaustedAction "when exhausted" action} is
-     * {@link #WHEN_EXHAUSTED_BLOCK}.
-     *
-     * When less than or equal to 0, the {@link #borrowObject} method
-     * may block indefinitely.
-     *
+     * {@link #borrowObject} method should block before throwing an exception
+     * when the pool is exhausted and the {@link #setWhenExhaustedAction
+     * "when exhausted" action} is {@link #WHEN_EXHAUSTED_BLOCK}. When less than
+     * or equal to 0, the {@link #borrowObject} method may block indefinitely.
+     * 
      * @return maximum number of milliseconds to block when borrowing an object.
      * @see #setMaxWait
      * @see #setWhenExhaustedAction
@@ -688,15 +892,14 @@ public class GenericObjectPool<T> extend
 
     /**
      * Sets the maximum amount of time (in milliseconds) the
-     * {@link #borrowObject} method should block before throwing
-     * an exception when the pool is exhausted and the
-     * {@link #setWhenExhaustedAction "when exhausted" action} is
-     * {@link #WHEN_EXHAUSTED_BLOCK}.
-     *
-     * When less than or equal to 0, the {@link #borrowObject} method
-     * may block indefinitely.
-     *
-     * @param maxWait maximum number of milliseconds to block when borrowing an object.
+     * {@link #borrowObject} method should block before throwing an exception
+     * when the pool is exhausted and the {@link #setWhenExhaustedAction
+     * "when exhausted" action} is {@link #WHEN_EXHAUSTED_BLOCK}. When less than
+     * or equal to 0, the {@link #borrowObject} method may block indefinitely.
+     * 
+     * @param maxWait
+     *            maximum number of milliseconds to block when borrowing an
+     *            object.
      * @see #getMaxWait
      * @see #setWhenExhaustedAction
      * @see #WHEN_EXHAUSTED_BLOCK
@@ -707,6 +910,7 @@ public class GenericObjectPool<T> extend
 
     /**
      * Returns the cap on the number of "idle" instances in the pool.
+     * 
      * @return the cap on the number of "idle" instances in the pool.
      * @see #setMaxIdle
      */
@@ -715,16 +919,18 @@ public class GenericObjectPool<T> extend
     }
 
     /**
-     * Sets the cap on the number of "idle" instances in the pool.
-     * If maxIdle is set too low on heavily loaded systems it is possible you
-     * will see objects being destroyed and almost immediately new objects
-     * being created. This is a result of the active threads momentarily
-     * returning objects faster than they are requesting them them, causing the
-     * number of idle objects to rise above maxIdle. The best value for maxIdle
-     * for heavily loaded system will vary but the default is a good starting
-     * point.
-     * @param maxIdle The cap on the number of "idle" instances in the pool.
-     * Use a negative value to indicate an unlimited number of idle instances.
+     * Sets the cap on the number of "idle" instances in the pool. If maxIdle is
+     * set too low on heavily loaded systems it is possible you will see objects
+     * being destroyed and almost immediately new objects being created. This is
+     * a result of the active threads momentarily returning objects faster than
+     * they are requesting them them, causing the number of idle objects to rise
+     * above maxIdle. The best value for maxIdle for heavily loaded system will
+     * vary but the default is a good starting point.
+     * 
+     * @param maxIdle
+     *            The cap on the number of "idle" instances in the pool. Use a
+     *            negative value to indicate an unlimited number of idle
+     *            instances.
      * @see #getMaxIdle
      */
     public void setMaxIdle(int maxIdle) {
@@ -732,14 +938,14 @@ public class GenericObjectPool<T> extend
     }
 
     /**
-     * Sets the minimum number of objects allowed in the pool
-     * before the evictor thread (if active) spawns new objects.
-     * Note that no objects are created when
-     * <code>numActive + numIdle >= maxActive.</code>
-     * This setting has no effect if the idle object evictor is disabled
-     * (i.e. if <code>timeBetweenEvictionRunsMillis <= 0</code>).
-     *
-     * @param minIdle The minimum number of objects.
+     * Sets the minimum number of objects allowed in the pool before the evictor
+     * thread (if active) spawns new objects. Note that no objects are created
+     * when <code>numActive + numIdle >= maxActive.</code> This setting has no
+     * effect if the idle object evictor is disabled (i.e. if
+     * <code>timeBetweenEvictionRunsMillis <= 0</code>).
+     * 
+     * @param minIdle
+     *            The minimum number of objects.
      * @see #getMinIdle
      * @see #getTimeBetweenEvictionRunsMillis()
      */
@@ -748,10 +954,10 @@ public class GenericObjectPool<T> extend
     }
 
     /**
-     * Returns the minimum number of objects allowed in the pool
-     * before the evictor thread (if active) spawns new objects.
-     * (Note no objects are created when: numActive + numIdle >= maxActive)
-     *
+     * Returns the minimum number of objects allowed in the pool before the
+     * evictor thread (if active) spawns new objects. (Note no objects are
+     * created when: numActive + numIdle >= maxActive)
+     * 
      * @return The minimum number of objects.
      * @see #setMinIdle
      */
@@ -761,12 +967,11 @@ public class GenericObjectPool<T> extend
 
     /**
      * When <tt>true</tt>, objects will be
-     * {@link PoolableObjectFactory#validateObject validated}
-     * before being returned by the {@link #borrowObject}
-     * method.  If the object fails to validate,
-     * it will be dropped from the pool, and we will attempt
-     * to borrow another.
-     *
+     * {@link PoolableObjectFactory#validateObject validated} before being
+     * returned by the {@link #borrowObject} method. If the object fails to
+     * validate, it will be dropped from the pool, and we will attempt to borrow
+     * another.
+     * 
      * @return <code>true</code> if objects are validated before being borrowed.
      * @see #setTestOnBorrow
      */
@@ -776,13 +981,14 @@ public class GenericObjectPool<T> extend
 
     /**
      * When <tt>true</tt>, objects will be
-     * {@link PoolableObjectFactory#validateObject validated}
-     * before being returned by the {@link #borrowObject}
-     * method.  If the object fails to validate,
-     * it will be dropped from the pool, and we will attempt
-     * to borrow another.
-     *
-     * @param testOnBorrow <code>true</code> if objects should be validated before being borrowed.
+     * {@link PoolableObjectFactory#validateObject validated} before being
+     * returned by the {@link #borrowObject} method. If the object fails to
+     * validate, it will be dropped from the pool, and we will attempt to borrow
+     * another.
+     * 
+     * @param testOnBorrow
+     *            <code>true</code> if objects should be validated before being
+     *            borrowed.
      * @see #getTestOnBorrow
      */
     public void setTestOnBorrow(boolean testOnBorrow) {
@@ -791,11 +997,11 @@ public class GenericObjectPool<T> extend
 
     /**
      * When <tt>true</tt>, objects will be
-     * {@link PoolableObjectFactory#validateObject validated}
-     * before being returned to the pool within the
-     * {@link #returnObject}.
-     *
-     * @return <code>true</code> when objects will be validated after returned to {@link #returnObject}.
+     * {@link PoolableObjectFactory#validateObject validated} before being
+     * returned to the pool within the {@link #returnObject}.
+     * 
+     * @return <code>true</code> when objects will be validated after returned
+     *         to {@link #returnObject}.
      * @see #setTestOnReturn
      */
     public boolean getTestOnReturn() {
@@ -804,11 +1010,12 @@ public class GenericObjectPool<T> extend
 
     /**
      * When <tt>true</tt>, objects will be
-     * {@link PoolableObjectFactory#validateObject validated}
-     * before being returned to the pool within the
-     * {@link #returnObject}.
-     *
-     * @param testOnReturn <code>true</code> so objects will be validated after returned to {@link #returnObject}.
+     * {@link PoolableObjectFactory#validateObject validated} before being
+     * returned to the pool within the {@link #returnObject}.
+     * 
+     * @param testOnReturn
+     *            <code>true</code> so objects will be validated after returned
+     *            to {@link #returnObject}.
      * @see #getTestOnReturn
      */
     public void setTestOnReturn(boolean testOnReturn) {
@@ -816,11 +1023,10 @@ public class GenericObjectPool<T> extend
     }
 
     /**
-     * Returns the number of milliseconds to sleep between runs of the
-     * idle object evictor thread.
-     * When non-positive, no idle object evictor thread will be
-     * run.
-     *
+     * Returns the number of milliseconds to sleep between runs of the idle
+     * object evictor thread. When non-positive, no idle object evictor thread
+     * will be run.
+     * 
      * @return number of milliseconds to sleep between evictor runs.
      * @see #setTimeBetweenEvictionRunsMillis
      */
@@ -829,23 +1035,24 @@ public class GenericObjectPool<T> extend
     }
 
     /**
-     * Sets the number of milliseconds to sleep between runs of the
-     * idle object evictor thread.
-     * When non-positive, no idle object evictor thread will be
+     * Sets the number of milliseconds to sleep between runs of the idle object
+     * evictor thread. When non-positive, no idle object evictor thread will be
      * run.
-     *
-     * @param timeBetweenEvictionRunsMillis number of milliseconds to sleep between evictor runs.
+     * 
+     * @param timeBetweenEvictionRunsMillis
+     *            number of milliseconds to sleep between evictor runs.
      * @see #getTimeBetweenEvictionRunsMillis
      */
-    public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) {
+    public void setTimeBetweenEvictionRunsMillis(
+            long timeBetweenEvictionRunsMillis) {
         _timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
         startEvictor(_timeBetweenEvictionRunsMillis);
     }
 
     /**
-     * Returns the max number of objects to examine during each run of the
-     * idle object evictor thread (if any).
-     *
+     * Returns the max number of objects to examine during each run of the idle
+     * object evictor thread (if any).
+     * 
      * @return max number of objects to examine during each evictor run.
      * @see #setNumTestsPerEvictionRun
      * @see #setTimeBetweenEvictionRunsMillis
@@ -855,16 +1062,18 @@ public class GenericObjectPool<T> extend
     }
 
     /**
-     * Sets the max number of objects to examine during each run of the
-     * idle object evictor thread (if any).
+     * Sets the max number of objects to examine during each run of the idle
+     * object evictor thread (if any).
      * <p>
-     * When a negative value is supplied, <tt>ceil({@link #getNumIdle})/abs({@link #getNumTestsPerEvictionRun})</tt>
-     * tests will be run.  That is, when the value is <i>-n</i>, roughly one <i>n</i>th of the
-     * idle objects will be tested per run. When the value is positive, the number of tests
-     * actually performed in each run will be the minimum of this value and the number of instances
-     * idle in the pool.
-     *
-     * @param numTestsPerEvictionRun max number of objects to examine during each evictor run.
+     * When a negative value is supplied,
+     * <tt>ceil({@link #getNumIdle})/abs({@link #getNumTestsPerEvictionRun})</tt>
+     * tests will be run. That is, when the value is <i>-n</i>, roughly one
+     * <i>n</i>th of the idle objects will be tested per run. When the value is
+     * positive, the number of tests actually performed in each run will be the
+     * minimum of this value and the number of instances idle in the pool.
+     * 
+     * @param numTestsPerEvictionRun
+     *            max number of objects to examine during each evictor run.
      * @see #getNumTestsPerEvictionRun
      * @see #setTimeBetweenEvictionRunsMillis
      */
@@ -874,10 +1083,10 @@ public class GenericObjectPool<T> extend
 
     /**
      * Returns the minimum amount of time an object may sit idle in the pool
-     * before it is eligible for eviction by the idle object evictor
-     * (if any).
-     *
-     * @return minimum amount of time an object may sit idle in the pool before it is eligible for eviction.
+     * before it is eligible for eviction by the idle object evictor (if any).
+     * 
+     * @return minimum amount of time an object may sit idle in the pool before
+     *         it is eligible for eviction.
      * @see #setMinEvictableIdleTimeMillis
      * @see #setTimeBetweenEvictionRunsMillis
      */
@@ -886,13 +1095,14 @@ public class GenericObjectPool<T> extend
     }
 
     /**
-     * Sets the minimum amount of time an object may sit idle in the pool
-     * before it is eligible for eviction by the idle object evictor
-     * (if any).
-     * When non-positive, no objects will be evicted from the pool
-     * due to idle time alone.
-     * @param minEvictableIdleTimeMillis minimum amount of time an object may sit idle in the pool before
-     * it is eligible for eviction.
+     * Sets the minimum amount of time an object may sit idle in the pool before
+     * it is eligible for eviction by the idle object evictor (if any). When
+     * non-positive, no objects will be evicted from the pool due to idle time
+     * alone.
+     * 
+     * @param minEvictableIdleTimeMillis
+     *            minimum amount of time an object may sit idle in the pool
+     *            before it is eligible for eviction.
      * @see #getMinEvictableIdleTimeMillis
      * @see #setTimeBetweenEvictionRunsMillis
      */
@@ -902,11 +1112,12 @@ public class GenericObjectPool<T> extend
 
     /**
      * Returns the minimum amount of time an object may sit idle in the pool
-     * before it is eligible for eviction by the idle object evictor
-     * (if any), with the extra condition that at least
-     * "minIdle" amount of object remain in the pool.
-     *
-     * @return minimum amount of time an object may sit idle in the pool before it is eligible for eviction.
+     * before it is eligible for eviction by the idle object evictor (if any),
+     * with the extra condition that at least "minIdle" amount of object remain
+     * in the pool.
+     * 
+     * @return minimum amount of time an object may sit idle in the pool before
+     *         it is eligible for eviction.
      * @since Pool 1.3
      * @see #setSoftMinEvictableIdleTimeMillis
      */
@@ -915,28 +1126,29 @@ public class GenericObjectPool<T> extend
     }
 
     /**
-     * Sets the minimum amount of time an object may sit idle in the pool
-     * before it is eligible for eviction by the idle object evictor
-     * (if any), with the extra condition that at least
-     * "minIdle" object instances remain in the pool.
-     * When non-positive, no objects will be evicted from the pool
-     * due to idle time alone.
-     *
-     * @param softMinEvictableIdleTimeMillis minimum amount of time an object may sit idle in the pool before
-     * it is eligible for eviction.
+     * Sets the minimum amount of time an object may sit idle in the pool before
+     * it is eligible for eviction by the idle object evictor (if any), with the
+     * extra condition that at least "minIdle" object instances remain in the
+     * pool. When non-positive, no objects will be evicted from the pool due to
+     * idle time alone.
+     * 
+     * @param softMinEvictableIdleTimeMillis
+     *            minimum amount of time an object may sit idle in the pool
+     *            before it is eligible for eviction.
      * @since Pool 1.3
      * @see #getSoftMinEvictableIdleTimeMillis
      */
-    public void setSoftMinEvictableIdleTimeMillis(long softMinEvictableIdleTimeMillis) {
+    public void setSoftMinEvictableIdleTimeMillis(
+            long softMinEvictableIdleTimeMillis) {
         _softMinEvictableIdleTimeMillis = softMinEvictableIdleTimeMillis;
     }
 
     /**
      * When <tt>true</tt>, objects will be
-     * {@link PoolableObjectFactory#validateObject validated}
-     * by the idle object evictor (if any).  If an object
-     * fails to validate, it will be dropped from the pool.
-     *
+     * {@link PoolableObjectFactory#validateObject validated} by the idle object
+     * evictor (if any). If an object fails to validate, it will be dropped from
+     * the pool.
+     * 
      * @return <code>true</code> when objects will be validated by the evictor.
      * @see #setTestWhileIdle
      * @see #setTimeBetweenEvictionRunsMillis
@@ -947,11 +1159,12 @@ public class GenericObjectPool<T> extend
 
     /**
      * When <tt>true</tt>, objects will be
-     * {@link PoolableObjectFactory#validateObject validated}
-     * by the idle object evictor (if any).  If an object
-     * fails to validate, it will be dropped from the pool.
-     *
-     * @param testWhileIdle <code>true</code> so objects will be validated by the evictor.
+     * {@link PoolableObjectFactory#validateObject validated} by the idle object
+     * evictor (if any). If an object fails to validate, it will be dropped from
+     * the pool.
+     * 
+     * @param testWhileIdle
+     *            <code>true</code> so objects will be validated by the evictor.
      * @see #getTestWhileIdle
      * @see #setTimeBetweenEvictionRunsMillis
      */
@@ -960,37 +1173,39 @@ public class GenericObjectPool<T> extend
     }
 
     /**
-     * Whether or not the idle object pool acts as a LIFO queue. True means
-     * that borrowObject returns the most recently used ("last in") idle object
-     * in the pool (if there are idle instances available).  False means that
-     * the pool behaves as a FIFO queue - objects are taken from the idle object
+     * Whether or not the idle object pool acts as a LIFO queue. True means that
+     * borrowObject returns the most recently used ("last in") idle object in
+     * the pool (if there are idle instances available). False means that the
+     * pool behaves as a FIFO queue - objects are taken from the idle object
      * pool in the order that they are returned to the pool.
-     *
+     * 
      * @return <code>true</true> if the pool is configured to act as a LIFO queue
      * @since 1.4
      */
-     public boolean getLifo() {
-         return _lifo;
-     }
-
-     /**
-      * Sets the LIFO property of the pool. True means that borrowObject returns
-      * the most recently used ("last in") idle object in the pool (if there are
-      * idle instances available).  False means that the pool behaves as a FIFO
-      * queue - objects are taken from the idle object pool in the order that
-      * they are returned to the pool.
-      *
-      * @param lifo the new value for the LIFO property
-      * @since 1.4
-      */
-     public void setLifo(boolean lifo) {
-         this._lifo = lifo;
-     }
+    public boolean getLifo() {
+        return _lifo;
+    }
+
+    /**
+     * Sets the LIFO property of the pool. True means that borrowObject returns
+     * the most recently used ("last in") idle object in the pool (if there are
+     * idle instances available). False means that the pool behaves as a FIFO
+     * queue - objects are taken from the idle object pool in the order that
+     * they are returned to the pool.
+     * 
+     * @param lifo
+     *            the new value for the LIFO property
+     * @since 1.4
+     */
+    public void setLifo(boolean lifo) {
+        this._lifo = lifo;
+    }
 
     /**
      * Sets my configuration.
-     *
-     * @param conf configuration to use.
+     * 
+     * @param conf
+     *            configuration to use.
      * @see GenericObjectPool.Config
      */
     public void setConfig(GenericObjectPool.Config conf) {
@@ -1009,38 +1224,54 @@ public class GenericObjectPool<T> extend
         setLifo(conf.lifo);
     }
 
-    //-- ObjectPool methods ------------------------------------------
+    // -- ObjectPool methods ------------------------------------------
 
     /**
-     * <p>Borrows an object from the pool.</p>
-     * 
-     * <p>If there is an idle instance available in the pool, then either the most-recently returned
-     * (if {@link #getLifo() lifo} == true) or "oldest" (lifo == false) instance sitting idle in the pool
-     * will be activated and returned.  If activation fails, or {@link #getTestOnBorrow() testOnBorrow} is set
-     * to true and validation fails, the instance is destroyed and the next available instance is examined.
-     * This continues until either a valid instance is returned or there are no more idle instances available.</p>
-     * 
-     * <p>If there are no idle instances available in the pool, behavior depends on the {@link #getMaxActive() maxActive}
-     * and (if applicable) {@link #getWhenExhaustedAction() whenExhaustedAction} and {@link #getMaxWait() maxWait}
-     * properties. If the number of instances checked out from the pool is less than <code>maxActive,</code> a new
-     * instance is created, activated and (if applicable) validated and returned to the caller.</p>
-     * 
-     * <p>If the pool is exhausted (no available idle instances and no capacity to create new ones),
-     * this method will either block ({@link #WHEN_EXHAUSTED_BLOCK}), throw a <code>NoSuchElementException</code>
-     * ({@link #WHEN_EXHAUSTED_FAIL}), or grow ({@link #WHEN_EXHAUSTED_GROW} - ignoring maxActive).
-     * The length of time that this method will block when <code>whenExhaustedAction == WHEN_EXHAUSTED_BLOCK</code>
-     * is determined by the {@link #getMaxWait() maxWait} property.</p>
-     * 
-     * <p>When the pool is exhausted, multiple calling threads may be simultaneously blocked waiting for instances
-     * to become available.  As of pool 1.5, a "fairness" algorithm has been implemented to ensure that threads receive
-     * available instances in request arrival order.</p>
+     * <p>
+     * Borrows an object from the pool.
+     * </p>
+     * <p>
+     * If there is an idle instance available in the pool, then either the
+     * most-recently returned (if {@link #getLifo() lifo} == true) or "oldest"
+     * (lifo == false) instance sitting idle in the pool will be activated and
+     * returned. If activation fails, or {@link #getTestOnBorrow() testOnBorrow}
+     * is set to true and validation fails, the instance is destroyed and the
+     * next available instance is examined. This continues until either a valid

[... 856 lines stripped ...]


Mime
View raw message