commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sandy...@apache.org
Subject svn commit: r473646 [2/2] - in /jakarta/commons/proper/pool/trunk/src: java/org/apache/commons/pool/ java/org/apache/commons/pool/composite/ java/org/apache/commons/pool/impl/ test/org/apache/commons/pool/ test/org/apache/commons/pool/composite/
Date Sat, 11 Nov 2006 05:57:38 GMT
Modified: jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java?view=diff&rev=473646&r1=473645&r2=473646
==============================================================================
--- jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
(original)
+++ jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
Fri Nov 10 21:57:35 2006
@@ -125,6 +125,7 @@
  * @author Dirk Verbeeck
  * @author Sandy McArthur
  * @version $Revision$ $Date$
+ * @since Pool 1.0
  */
 public class GenericObjectPool extends BaseObjectPool implements ObjectPool {
 
@@ -503,6 +504,7 @@
      * When less than 0, the {@link #borrowObject} method
      * may block indefinitely.
      *
+     * @return maximum number of milliseconds to block when borrowing an object.
      * @see #setMaxWait
      * @see #setWhenExhaustedAction
      * @see #WHEN_EXHAUSTED_BLOCK
@@ -521,6 +523,7 @@
      * When less than 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
@@ -584,6 +587,7 @@
      * 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
      */
     public synchronized boolean getTestOnBorrow() {
@@ -598,6 +602,7 @@
      * 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 synchronized void setTestOnBorrow(boolean testOnBorrow) {
@@ -610,6 +615,7 @@
      * 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 synchronized boolean getTestOnReturn() {
@@ -622,6 +628,7 @@
      * 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 synchronized void setTestOnReturn(boolean testOnReturn) {
@@ -634,6 +641,7 @@
      * When non-positive, no idle object evictor thread will be
      * run.
      *
+     * @return number of milliseconds to sleep between evictor runs.
      * @see #setTimeBetweenEvictionRunsMillis
      */
     public synchronized long getTimeBetweenEvictionRunsMillis() {
@@ -646,6 +654,7 @@
      * When non-positive, no idle object evictor thread will be
      * run.
      *
+     * @param timeBetweenEvictionRunsMillis number of milliseconds to sleep between evictor
runs.
      * @see #getTimeBetweenEvictionRunsMillis
      */
     public synchronized void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
{
@@ -657,6 +666,7 @@
      * 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
      */
@@ -672,6 +682,7 @@
      * tests will be run.  I.e., when the value is <i>-n</i>, roughly one <i>n</i>th
of the
      * idle objects will be tested per run.
      *
+     * @param numTestsPerEvictionRun max number of objects to examine during each evictor
run.
      * @see #getNumTestsPerEvictionRun
      * @see #setTimeBetweenEvictionRunsMillis
      */
@@ -684,6 +695,7 @@
      * 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
      */
@@ -697,7 +709,7 @@
      * (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
      */
@@ -711,6 +723,7 @@
      * (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.
      * @see #setSoftMinEvictableIdleTimeMillis
      */
     public synchronized long getSoftMinEvictableIdleTimeMillis() {
@@ -725,6 +738,7 @@
      * 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.
      * @see #getSoftMinEvictableIdleTimeMillis
      */
     public synchronized void setSoftMinEvictableIdleTimeMillis(long softMinEvictableIdleTimeMillis)
{
@@ -737,6 +751,7 @@
      * 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
      */
@@ -750,6 +765,7 @@
      * 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
      */
@@ -759,6 +775,8 @@
 
     /**
      * Sets my configuration.
+     *
+     * @param conf configuration to use.
      * @see GenericObjectPool.Config
      */
     public synchronized void setConfig(GenericObjectPool.Config conf) {
@@ -998,6 +1016,11 @@
         }
     }
 
+    /**
+     * Make one pass of the idle object evictor.
+     *
+     * @throws Exception if the pool is closed or eviction fails.
+     */
     public synchronized void evict() throws Exception {
         assertOpen();
         if(!_pool.isEmpty()) {
@@ -1058,6 +1081,8 @@
     /**
      * Check to see if we are below our minimum number of objects
      * if so enough to bring us back to our minimum.
+     *
+     * @throws Exception when {@link #addObject()} fails.
      */
     private void ensureMinIdle() throws Exception {
         // this method isn't synchronized so the
@@ -1099,6 +1124,8 @@
      * Start the eviction thread or service, or when
      * <i>delay</i> is non-positive, stop it
      * if it is already running.
+     *
+     * @param delay milliseconds between evictor runs.
      */
     protected synchronized void startEvictor(long delay) {
         if(null != _evictor) {
@@ -1161,17 +1188,53 @@
      * @see GenericObjectPool#setConfig
      */
     public static class Config {
+        /**
+         * @see GenericObjectPool#setMaxIdle
+         */
         public int maxIdle = GenericObjectPool.DEFAULT_MAX_IDLE;
+        /**
+         * @see GenericObjectPool#setMinIdle
+         */
         public int minIdle = GenericObjectPool.DEFAULT_MIN_IDLE;
+        /**
+         * @see GenericObjectPool#setMaxActive
+         */
         public int maxActive = GenericObjectPool.DEFAULT_MAX_ACTIVE;
+        /**
+         * @see GenericObjectPool#setMaxWait
+         */
         public long maxWait = GenericObjectPool.DEFAULT_MAX_WAIT;
+        /**
+         * @see GenericObjectPool#setWhenExhaustedAction
+         */
         public byte whenExhaustedAction = GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION;
+        /**
+         * @see GenericObjectPool#setTestOnBorrow
+         */
         public boolean testOnBorrow = GenericObjectPool.DEFAULT_TEST_ON_BORROW;
+        /**
+         * @see GenericObjectPool#setTestOnReturn
+         */
         public boolean testOnReturn = GenericObjectPool.DEFAULT_TEST_ON_RETURN;
+        /**
+         * @see GenericObjectPool#setTestWhileIdle
+         */
         public boolean testWhileIdle = GenericObjectPool.DEFAULT_TEST_WHILE_IDLE;
+        /**
+         * @see GenericObjectPool#setTimeBetweenEvictionRunsMillis
+         */
         public long timeBetweenEvictionRunsMillis = GenericObjectPool.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS;
+        /**
+         * @see GenericObjectPool#setNumTestsPerEvictionRun
+         */
         public int numTestsPerEvictionRun =  GenericObjectPool.DEFAULT_NUM_TESTS_PER_EVICTION_RUN;
+        /**
+         * @see GenericObjectPool#setMinEvictableIdleTimeMillis
+         */
         public long minEvictableIdleTimeMillis = GenericObjectPool.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS;
+        /**
+         * @see GenericObjectPool#setSoftMinEvictableIdleTimeMillis
+         */
         public long softMinEvictableIdleTimeMillis = GenericObjectPool.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS;
     }
 

Modified: jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPoolFactory.java?view=diff&rev=473646&r1=473645&r2=473646
==============================================================================
--- jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPoolFactory.java
(original)
+++ jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPoolFactory.java
Fri Nov 10 21:57:35 2006
@@ -28,44 +28,159 @@
  *
  * @author Rodney Waldhoff
  * @version $Revision$ $Date$
+ * @since Pool 1.0
  */
 public class GenericObjectPoolFactory implements ObjectPoolFactory {
+    /**
+     * Create a new GenericObjectPoolFactory.
+     *
+     * @param factory the PoolableObjectFactory used by created pools.
+     * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory)
+     */
     public GenericObjectPoolFactory(PoolableObjectFactory factory) {
         this(factory,GenericObjectPool.DEFAULT_MAX_ACTIVE,GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION,GenericObjectPool.DEFAULT_MAX_WAIT,GenericObjectPool.DEFAULT_MAX_IDLE,GenericObjectPool.DEFAULT_MIN_IDLE,GenericObjectPool.DEFAULT_TEST_ON_BORROW,GenericObjectPool.DEFAULT_TEST_ON_RETURN,GenericObjectPool.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,GenericObjectPool.DEFAULT_NUM_TESTS_PER_EVICTION_RUN,GenericObjectPool.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS,GenericObjectPool.DEFAULT_TEST_WHILE_IDLE);
     }
 
-    public GenericObjectPoolFactory(PoolableObjectFactory factory, GenericObjectPool.Config
config) {
+    /**
+     * Create a new GenericObjectPoolFactory.
+     *
+     * @param factory the PoolableObjectFactory used by created pools.
+     * @param config a non-<code>null</code> GenericObjectPool.Config describing
the configuration.
+     * @throws NullPointerException when config is <code>null</code>.
+     * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, GenericObjectPool.Config)
+     */
+    public GenericObjectPoolFactory(PoolableObjectFactory factory, GenericObjectPool.Config
config) throws NullPointerException {
         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);
     }
 
+    /**
+     * Create a new GenericObjectPoolFactory.
+     *
+     * @param factory the PoolableObjectFactory used by created pools.
+     * @param maxActive maximum number of objects that can be borrowed from created pools
at one time.
+     * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, int)
+     */
     public GenericObjectPoolFactory(PoolableObjectFactory factory, int maxActive) {
         this(factory,maxActive,GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION,GenericObjectPool.DEFAULT_MAX_WAIT,GenericObjectPool.DEFAULT_MAX_IDLE,GenericObjectPool.DEFAULT_MIN_IDLE,GenericObjectPool.DEFAULT_TEST_ON_BORROW,GenericObjectPool.DEFAULT_TEST_ON_RETURN,GenericObjectPool.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,GenericObjectPool.DEFAULT_NUM_TESTS_PER_EVICTION_RUN,GenericObjectPool.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS,GenericObjectPool.DEFAULT_TEST_WHILE_IDLE);
     }
 
+    /**
+     * Create a new GenericObjectPoolFactory.
+     *
+     * @param factory the PoolableObjectFactory used by created pools.
+     * @param maxActive maximum number of objects that can be borrowed from created pools
at one time.
+     * @param whenExhaustedAction the action to take when the pool is exhausted.
+     * @param maxWait the maximum amount of time to wait for an idle object when the pool
is exhausted.
+     * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, int, byte, long)
+     */
     public GenericObjectPoolFactory(PoolableObjectFactory factory, int maxActive, byte whenExhaustedAction,
long maxWait) {
         this(factory,maxActive,whenExhaustedAction,maxWait,GenericObjectPool.DEFAULT_MAX_IDLE,GenericObjectPool.DEFAULT_MIN_IDLE,GenericObjectPool.DEFAULT_TEST_ON_BORROW,GenericObjectPool.DEFAULT_TEST_ON_RETURN,GenericObjectPool.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,GenericObjectPool.DEFAULT_NUM_TESTS_PER_EVICTION_RUN,GenericObjectPool.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS,GenericObjectPool.DEFAULT_TEST_WHILE_IDLE);
     }
 
+    /**
+     * Create a new GenericObjectPoolFactory.
+     *
+     * @param factory the PoolableObjectFactory used by created pools.
+     * @param maxActive maximum number of objects that can be borrowed from created pools
at one time.
+     * @param whenExhaustedAction the action to take when the pool is exhausted.
+     * @param maxWait the maximum amount of time to wait for an idle object when the pool
is exhausted.
+     * @param testOnBorrow whether to validate objects before they are returned by the borrowObject.
+     * @param testOnReturn whether to validate objects after they are returned to the returnObject.
+     * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, int, byte, long, boolean,
boolean)
+     */
     public GenericObjectPoolFactory(PoolableObjectFactory factory, int maxActive, byte whenExhaustedAction,
long maxWait, boolean testOnBorrow, boolean testOnReturn) {
         this(factory,maxActive,whenExhaustedAction,maxWait,GenericObjectPool.DEFAULT_MAX_IDLE,GenericObjectPool.DEFAULT_MIN_IDLE,testOnBorrow,testOnReturn,GenericObjectPool.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,GenericObjectPool.DEFAULT_NUM_TESTS_PER_EVICTION_RUN,GenericObjectPool.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS,GenericObjectPool.DEFAULT_TEST_WHILE_IDLE);
     }
 
+    /**
+     * Create a new GenericObjectPoolFactory.
+     *
+     * @param factory the PoolableObjectFactory used by created pools.
+     * @param maxActive maximum number of objects that can be borrowed from created pools
at one time.
+     * @param whenExhaustedAction the action to take when the pool is exhausted.
+     * @param maxWait the maximum amount of time to wait for an idle object when the pool
is exhausted.
+     * @param maxIdle the maximum number of idle objects in my pool.
+     * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, int, byte, long, int)
+     */
     public GenericObjectPoolFactory(PoolableObjectFactory factory, int maxActive, byte whenExhaustedAction,
long maxWait, int maxIdle) {
         this(factory,maxActive,whenExhaustedAction,maxWait,maxIdle,GenericObjectPool.DEFAULT_MIN_IDLE,GenericObjectPool.DEFAULT_TEST_ON_BORROW,GenericObjectPool.DEFAULT_TEST_ON_RETURN,GenericObjectPool.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,GenericObjectPool.DEFAULT_NUM_TESTS_PER_EVICTION_RUN,GenericObjectPool.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS,GenericObjectPool.DEFAULT_TEST_WHILE_IDLE);
     }
 
+    /**
+     * Create a new GenericObjectPoolFactory.
+     *
+     * @param factory the PoolableObjectFactory used by created pools.
+     * @param maxActive maximum number of objects that can be borrowed from created pools
at one time.
+     * @param whenExhaustedAction the action to take when the pool is exhausted.
+     * @param maxWait the maximum amount of time to wait for an idle object when the pool
is exhausted.
+     * @param maxIdle the maximum number of idle objects in my pool.
+     * @param testOnBorrow whether to validate objects before they are returned by the borrowObject.
+     * @param testOnReturn whether to validate objects after they are returned to the returnObject.
+     * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, int, byte, long, int,
boolean, boolean)
+     */
     public GenericObjectPoolFactory(PoolableObjectFactory factory, int maxActive, byte whenExhaustedAction,
long maxWait, int maxIdle, boolean testOnBorrow, boolean testOnReturn) {
         this(factory,maxActive,whenExhaustedAction,maxWait,maxIdle,GenericObjectPool.DEFAULT_MIN_IDLE,testOnBorrow,testOnReturn,GenericObjectPool.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,GenericObjectPool.DEFAULT_NUM_TESTS_PER_EVICTION_RUN,GenericObjectPool.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS,GenericObjectPool.DEFAULT_TEST_WHILE_IDLE);
     }
 
+    /**
+     * Create a new GenericObjectPoolFactory.
+     *
+     * @param factory the PoolableObjectFactory used by created pools.
+     * @param maxActive maximum number of objects that can be borrowed from created pools
at one time.
+     * @param whenExhaustedAction the action to take when the pool is exhausted.
+     * @param maxWait the maximum amount of time to wait for an idle object when the pool
is exhausted.
+     * @param maxIdle the maximum number of idle objects in my pool.
+     * @param testOnBorrow whether to validate objects before they are returned by the borrowObject.
+     * @param testOnReturn whether to validate objects after they are returned to the returnObject.
+     * @param timeBetweenEvictionRunsMillis the number of milliseconds to sleep between examining
idle objects for eviction.
+     * @param numTestsPerEvictionRun the number of idle objects to examine per run within
the idle object eviction thread.
+     * @param minEvictableIdleTimeMillis the minimum number of milliseconds an object can
sit idle in the pool before it is eligible for evcition.
+     * @param testWhileIdle whether or not to validate objects in the idle object eviction
thread.
+     * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, int, byte, long, int,
boolean, boolean, long, int, long, boolean)
+     */
     public GenericObjectPoolFactory(PoolableObjectFactory 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,GenericObjectPool.DEFAULT_MIN_IDLE,testOnBorrow,testOnReturn,timeBetweenEvictionRunsMillis,numTestsPerEvictionRun,minEvictableIdleTimeMillis,testWhileIdle,
GenericObjectPool.DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS);
     }
     
+    /**
+     * Create a new GenericObjectPoolFactory.
+     *
+     * @param factory the PoolableObjectFactory used by created pools.
+     * @param maxActive maximum number of objects that can be borrowed from created pools
at one time.
+     * @param whenExhaustedAction the action to take when the pool is exhausted.
+     * @param maxWait the maximum amount of time to wait for an idle object when the pool
is exhausted.
+     * @param maxIdle the maximum number of idle objects in my pool.
+     * @param minIdle the minimum number of idle objects in my pool.
+     * @param testOnBorrow whether to validate objects before they are returned by the borrowObject.
+     * @param testOnReturn whether to validate objects after they are returned to the returnObject.
+     * @param timeBetweenEvictionRunsMillis the number of milliseconds to sleep between examining
idle objects for eviction.
+     * @param numTestsPerEvictionRun the number of idle objects to examine per run within
the idle object eviction thread.
+     * @param minEvictableIdleTimeMillis the minimum number of milliseconds an object can
sit idle in the pool before it is eligible for evcition.
+     * @param testWhileIdle whether or not to validate objects in the idle object eviction
thread.
+     * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, int, byte, long, int,
int, boolean, boolean, long, int, long, boolean)
+     */
     public GenericObjectPoolFactory(PoolableObjectFactory 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,
GenericObjectPool.DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS);
     }
 
+    /**
+     * Create a new GenericObjectPoolFactory.
+     *
+     * @param factory the PoolableObjectFactory used by created pools.
+     * @param maxActive maximum number of objects that can be borrowed from created pools
at one time.
+     * @param whenExhaustedAction the action to take when the pool is exhausted.
+     * @param maxWait the maximum amount of time to wait for an idle object when the pool
is exhausted.
+     * @param maxIdle the maximum number of idle objects in my pool.
+     * @param minIdle the minimum number of idle objects in my pool.
+     * @param testOnBorrow whether to validate objects before they are returned by the borrowObject.
+     * @param testOnReturn whether to validate objects after they are returned to the returnObject.
+     * @param timeBetweenEvictionRunsMillis the number of milliseconds to sleep between examining
idle objects for eviction.
+     * @param numTestsPerEvictionRun the number of idle objects to examine per run within
the idle object eviction thread.
+     * @param minEvictableIdleTimeMillis the minimum number of milliseconds an object can
sit idle in the pool before it is eligible for evcition.
+     * @param testWhileIdle whether or not to validate objects in the idle object eviction
thread.
+     * @param softMinEvictableIdleTimeMillis the minimum number of milliseconds an object
can sit idle in the pool before it is eligible for evcition with the extra condition that
at least "minIdle" amount of object remain in the pool.
+     * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, int, byte, long, int,
int, boolean, boolean, long, int, long, boolean, long)
+     */
     public GenericObjectPoolFactory(PoolableObjectFactory 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)
{
         _maxIdle = maxIdle;
         _minIdle = minIdle;

Modified: jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/SoftReferenceObjectPool.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/SoftReferenceObjectPool.java?view=diff&rev=473646&r1=473645&r2=473646
==============================================================================
--- jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/SoftReferenceObjectPool.java
(original)
+++ jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/SoftReferenceObjectPool.java
Fri Nov 10 21:57:35 2006
@@ -36,6 +36,7 @@
  * @author Rodney Waldhoff
  * @author Sandy McArthur
  * @version $Revision$ $Date$
+ * @since Pool 1.0
  */
 public class SoftReferenceObjectPool extends BaseObjectPool implements ObjectPool {
     /**
@@ -65,6 +66,7 @@
      * Create a <code>SoftReferenceObjectPool</code> with the specified factory
and initial idle object count.
      *
      * @param factory object factory to use.
+     * @param initSize initial size to attempt to prefill the pool.
      * @throws Exception when there is a problem prefilling the pool.
      * @throws IllegalArgumentException when <code>factory</code> is <code>null</code>.
      * @deprecated because this is a SoftReference pool, prefilled idle obejects may be garbage
collected before they are used.

Modified: jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java?view=diff&rev=473646&r1=473645&r2=473646
==============================================================================
--- jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java
(original)
+++ jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java
Fri Nov 10 21:57:35 2006
@@ -42,6 +42,7 @@
  * @author Sandy McArthur
  * @version $Revision$ $Date$
  * @see Stack
+ * @since Pool 1.0
  */
 public class StackKeyedObjectPool extends BaseKeyedObjectPool implements KeyedObjectPool
{
     /**

Modified: jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPoolFactory.java?view=diff&rev=473646&r1=473645&r2=473646
==============================================================================
--- jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPoolFactory.java
(original)
+++ jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPoolFactory.java
Fri Nov 10 21:57:35 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2004,2006 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,29 +27,69 @@
  * @see KeyedObjectPoolFactory
  *
  * @author Rodney Waldhoff
- * @version $Revision$ $Date$ 
+ * @version $Revision$ $Date$
+ * @since Pool 1.0
  */
 public class StackKeyedObjectPoolFactory implements KeyedObjectPoolFactory {
+    /**
+     * Create a new StackKeyedObjectPoolFactory.
+     *
+     * @see StackKeyedObjectPool#StackKeyedObjectPool()
+     */
     public StackKeyedObjectPoolFactory() {
         this((KeyedPoolableObjectFactory)null,StackKeyedObjectPool.DEFAULT_MAX_SLEEPING,StackKeyedObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
     }
 
+    /**
+     * Create a new StackKeyedObjectPoolFactory.
+     *
+     * @param max cap on the number of "sleeping" instances in the pool.
+     * @see StackKeyedObjectPool#StackKeyedObjectPool(int)
+     */
     public StackKeyedObjectPoolFactory(int max) {
         this((KeyedPoolableObjectFactory)null,max,StackKeyedObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
     }
 
+    /**
+     * Create a new StackKeyedObjectPoolFactory.
+     *
+     * @param max cap on the number of "sleeping" instances in the pool.
+     * @param init initial size of the pool (this specifies the size of the container, it
does not cause the pool to be pre-populated.)
+     * @see StackKeyedObjectPool#StackKeyedObjectPool(int, int)
+     */
     public StackKeyedObjectPoolFactory(int max, int init) {
         this((KeyedPoolableObjectFactory)null,max,init);
     }
 
+    /**
+     * Create a new StackKeyedObjectPoolFactory.
+     *
+     * @param factory the KeyedPoolableObjectFactory used by created pools.
+     * @see StackKeyedObjectPool#StackKeyedObjectPool(KeyedPoolableObjectFactory)
+     */
     public StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory factory) {
         this(factory,StackKeyedObjectPool.DEFAULT_MAX_SLEEPING,StackKeyedObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
     }
 
+    /**
+     * Create a new StackKeyedObjectPoolFactory.
+     *
+     * @param factory the KeyedPoolableObjectFactory used by created pools.
+     * @param max cap on the number of "sleeping" instances in the pool.
+     * @see StackKeyedObjectPool#StackKeyedObjectPool(KeyedPoolableObjectFactory, int)
+     */
     public StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory factory, int max) {
         this(factory,max,StackKeyedObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
     }
 
+    /**
+     * Create a new StackKeyedObjectPoolFactory.
+     *
+     * @param factory the KeyedPoolableObjectFactory used by created pools.
+     * @param max cap on the number of "sleeping" instances in the pool.
+     * @param init initial size of the pool (this specifies the size of the container, it
does not cause the pool to be pre-populated.)
+     * @see StackKeyedObjectPool#StackKeyedObjectPool(KeyedPoolableObjectFactory, int, int)
+     */
     public StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory factory, int max, int init)
{
         _factory = factory;
         _maxSleeping = max;

Modified: jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackObjectPool.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackObjectPool.java?view=diff&rev=473646&r1=473645&r2=473646
==============================================================================
--- jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackObjectPool.java
(original)
+++ jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackObjectPool.java
Fri Nov 10 21:57:35 2006
@@ -40,6 +40,7 @@
  * @author Dirk Verbeeck
  * @author Sandy McArthur
  * @version $Revision$ $Date$
+ * @since Pool 1.0
  */
 public class StackObjectPool extends BaseObjectPool implements ObjectPool {
     /**

Modified: jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackObjectPoolFactory.java?view=diff&rev=473646&r1=473645&r2=473646
==============================================================================
--- jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackObjectPoolFactory.java
(original)
+++ jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackObjectPoolFactory.java
Fri Nov 10 21:57:35 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2004,2006 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,33 +27,71 @@
  * @see StackKeyedObjectPoolFactory
  *
  * @author Rodney Waldhoff
- * @version $Revision$ $Date$ 
+ * @version $Revision$ $Date$
+ * @since Pool 1.0
  */
 public class StackObjectPoolFactory implements ObjectPoolFactory {
+    /**
+     * Create a new StackObjectPoolFactory.
+     * 
+     * @see StackObjectPool#StackObjectPool()
+     */
     public StackObjectPoolFactory() {
         this((PoolableObjectFactory)null,StackObjectPool.DEFAULT_MAX_SLEEPING,StackObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
     }
 
+    /**
+     * Create a new StackObjectPoolFactory.
+     *
+     * @param maxIdle cap on the number of "sleeping" instances in the pool.
+     * @see StackObjectPool#StackObjectPool(int)
+     */
     public StackObjectPoolFactory(int maxIdle) {
         this((PoolableObjectFactory)null,maxIdle,StackObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
     }
 
-    public StackObjectPoolFactory(int maxIdle, int init) {
-        this((PoolableObjectFactory)null,maxIdle,init);
+    /**
+     * Create a new StackObjectPoolFactory.
+     *
+     * @param maxIdle cap on the number of "sleeping" instances in the pool.
+     * @param initIdleCapacity - initial size of the pool (this specifies the size of the
container, it does not cause the pool to be pre-populated.)
+     * @see StackObjectPool#StackObjectPool(int, int)
+     */
+    public StackObjectPoolFactory(int maxIdle, int initIdleCapacity) {
+        this((PoolableObjectFactory)null,maxIdle,initIdleCapacity);
     }
 
+    /**
+     * Create a new StackObjectPoolFactory.
+     *
+     * @param factory the PoolableObjectFactory used by created pools.
+     * @see StackObjectPool#StackObjectPool(PoolableObjectFactory)
+     */
     public StackObjectPoolFactory(PoolableObjectFactory factory) {
         this(factory,StackObjectPool.DEFAULT_MAX_SLEEPING,StackObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
     }
 
+    /**
+     * Create a new StackObjectPoolFactory.
+     *
+     * @param factory the PoolableObjectFactory used by created pools.
+     * @param maxIdle cap on the number of "sleeping" instances in the pool.
+     */
     public StackObjectPoolFactory(PoolableObjectFactory factory, int maxIdle) {
         this(factory,maxIdle,StackObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
     }
 
-    public StackObjectPoolFactory(PoolableObjectFactory factory, int maxIdle, int init) {
+    /**
+     * Create a new StackObjectPoolFactory.
+     *
+     * @param factory the PoolableObjectFactory used by created pools.
+     * @param maxIdle cap on the number of "sleeping" instances in the pool.
+     * @param initIdleCapacity - initial size of the pool (this specifies the size of the
container, it does not cause the pool to be pre-populated.)
+     */
+    public StackObjectPoolFactory(PoolableObjectFactory factory, int maxIdle, int initIdleCapacity)
{
         _factory = factory;
         _maxSleeping = maxIdle;
-        _initCapacity = init;
+        _initCapacity = initIdleCapacity;
     }
 
     public ObjectPool createPool() {

Modified: jakarta/commons/proper/pool/trunk/src/test/org/apache/commons/pool/TestBaseKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/pool/trunk/src/test/org/apache/commons/pool/TestBaseKeyedObjectPool.java?view=diff&rev=473646&r1=473645&r2=473646
==============================================================================
--- jakarta/commons/proper/pool/trunk/src/test/org/apache/commons/pool/TestBaseKeyedObjectPool.java
(original)
+++ jakarta/commons/proper/pool/trunk/src/test/org/apache/commons/pool/TestBaseKeyedObjectPool.java
Fri Nov 10 21:57:35 2006
@@ -89,12 +89,12 @@
             return; // skip redundant tests
         }
         KeyedObjectPool pool = new BaseKeyedObjectPool() { 
-            public Object borrowObject(Object key) throws Exception {
+            public Object borrowObject(Object key) {
                 return null;
             }
-            public void returnObject(Object key, Object obj) throws Exception {         
      
+            public void returnObject(Object key, Object obj) {
             }
-            public void invalidateObject(Object key, Object obj) throws Exception {     
          
+            public void invalidateObject(Object key, Object obj) {
             }            
         };
         

Modified: jakarta/commons/proper/pool/trunk/src/test/org/apache/commons/pool/TestBaseObjectPool.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/pool/trunk/src/test/org/apache/commons/pool/TestBaseObjectPool.java?view=diff&rev=473646&r1=473645&r2=473646
==============================================================================
--- jakarta/commons/proper/pool/trunk/src/test/org/apache/commons/pool/TestBaseObjectPool.java
(original)
+++ jakarta/commons/proper/pool/trunk/src/test/org/apache/commons/pool/TestBaseObjectPool.java
Fri Nov 10 21:57:35 2006
@@ -75,12 +75,12 @@
             return; // skip redundant tests
         }
         ObjectPool pool = new BaseObjectPool() { 
-            public Object borrowObject() throws Exception {
+            public Object borrowObject() {
                 return null;
             }
-            public void returnObject(Object obj) throws Exception {                
+            public void returnObject(Object obj) {
             }
-            public void invalidateObject(Object obj) throws Exception {                
+            public void invalidateObject(Object obj) {
             }            
         };   
 
@@ -111,12 +111,12 @@
 
     public void testClose() throws Exception {
         ObjectPool pool = new BaseObjectPool() {
-            public Object borrowObject() throws Exception {
+            public Object borrowObject() {
                 return null;
             }
-            public void returnObject(Object obj) throws Exception {
+            public void returnObject(Object obj) {
             }
-            public void invalidateObject(Object obj) throws Exception {
+            public void invalidateObject(Object obj) {
             }
         };
 

Modified: jakarta/commons/proper/pool/trunk/src/test/org/apache/commons/pool/composite/PerformanceTest.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/pool/trunk/src/test/org/apache/commons/pool/composite/PerformanceTest.java?view=diff&rev=473646&r1=473645&r2=473646
==============================================================================
--- jakarta/commons/proper/pool/trunk/src/test/org/apache/commons/pool/composite/PerformanceTest.java
(original)
+++ jakarta/commons/proper/pool/trunk/src/test/org/apache/commons/pool/composite/PerformanceTest.java
Fri Nov 10 21:57:35 2006
@@ -34,7 +34,7 @@
  * A collection of benchmarks to confirm and establish performance properties.
  *
  * @author Sandy McArthur
- * @since #.#
+ * @since Pool 2.0
  * @version $Revision$ $Date$
  */
 public class PerformanceTest {

Modified: jakarta/commons/proper/pool/trunk/src/test/org/apache/commons/pool/composite/TestCompositeObjectPool.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/pool/trunk/src/test/org/apache/commons/pool/composite/TestCompositeObjectPool.java?view=diff&rev=473646&r1=473645&r2=473646
==============================================================================
--- jakarta/commons/proper/pool/trunk/src/test/org/apache/commons/pool/composite/TestCompositeObjectPool.java
(original)
+++ jakarta/commons/proper/pool/trunk/src/test/org/apache/commons/pool/composite/TestCompositeObjectPool.java
Fri Nov 10 21:57:35 2006
@@ -37,7 +37,7 @@
  * Test {@link CompositeObjectPool} and it's components.
  *
  * @author Sandy McArthur
- * @since #.#
+ * @since Pool 2.0
  * @version $Revision$ $Date$
  */
 public class TestCompositeObjectPool extends TestObjectPool {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message