    001    /*
    002     * Licensed to the Apache Software Foundation (ASF) under one or more
    003     * contributor license agreements.  See the NOTICE file distributed with
    004     * this work for additional information regarding copyright ownership.
    005     * The ASF licenses this file to You under the Apache License, Version 2.0
    006     * (the "License"); you may not use this file except in compliance with
    007     * the License.  You may obtain a copy of the License at
    008     *
    009     *      http://www.apache.org/licenses/LICENSE-2.0
    010     *
    011     * Unless required by applicable law or agreed to in writing, software
    012     * distributed under the License is distributed on an "AS IS" BASIS,
    013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    014     * See the License for the specific language governing permissions and
    015     * limitations under the License.
    016     */
    017
    018    package org.apache.commons.pool.impl;
    019
    020    import org.apache.commons.pool.ObjectPool;
    021    import org.apache.commons.pool.ObjectPoolFactory;
    022    import org.apache.commons.pool.PoolableObjectFactory;
    023
    024    /**
    025     * A factory for creating {@link GenericObjectPool} instances.
    026     *
    027     * @see GenericObjectPool
    028     * @see ObjectPoolFactory
    029     *
    030     * @author Rodney Waldhoff
    031     * @version $Revision: 965326 $ $Date: 2010-07-18 16:49:04 -0700 (Sun, 18 Jul 2010) $
    032     * @since Pool 1.0
    033     */
    034    public class GenericObjectPoolFactory implements ObjectPoolFactory {
    035        /**
    036         * Create a new GenericObjectPoolFactory.
    037         *
    038         * @param factory the PoolableObjectFactory used by created pools.
    039         * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory)
    040         */
    041        public GenericObjectPoolFactory(PoolableObjectFactory factory) {
    042            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);
    043        }
    044
    045        /**
    046         * Create a new GenericObjectPoolFactory.
    047         *
    048         * @param factory the PoolableObjectFactory used by created pools.
    049         * @param config a non-<code>null</code> GenericObjectPool.Config describing the configuration.
    050         * @throws NullPointerException when config is <code>null</code>.
    051         * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, GenericObjectPool.Config)
    052         */
    053        public GenericObjectPoolFactory(PoolableObjectFactory factory, GenericObjectPool.Config config) throws NullPointerException {
    054            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);
    055        }
    056
    057        /**
    058         * Create a new GenericObjectPoolFactory.
    059         *
    060         * @param factory the PoolableObjectFactory used by created pools.
    061         * @param maxActive maximum number of objects that can be borrowed from created pools at one time.
    062         * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, int)
    063         */
    064        public GenericObjectPoolFactory(PoolableObjectFactory factory, int maxActive) {
    065            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);
    066        }
    067
    068        /**
    069         * Create a new GenericObjectPoolFactory.
    070         *
    071         * @param factory the PoolableObjectFactory used by created pools.
    072         * @param maxActive maximum number of objects that can be borrowed from created pools at one time.
    073         * @param whenExhaustedAction the action to take when the pool is exhausted.
    074         * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted.
    075         * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, int, byte, long)
    076         */
    077        public GenericObjectPoolFactory(PoolableObjectFactory factory, int maxActive, byte whenExhaustedAction, long maxWait) {
    078            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);
    079        }
    080
    081        /**
    082         * Create a new GenericObjectPoolFactory.
    083         *
    084         * @param factory the PoolableObjectFactory used by created pools.
    085         * @param maxActive maximum number of objects that can be borrowed from created pools at one time.
    086         * @param whenExhaustedAction the action to take when the pool is exhausted.
    087         * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted.
    088         * @param testOnBorrow whether to validate objects before they are returned by the borrowObject.
    089         * @param testOnReturn whether to validate objects after they are returned to the returnObject.
    090         * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, int, byte, long, boolean, boolean)
    091         */
    092        public GenericObjectPoolFactory(PoolableObjectFactory factory, int maxActive, byte whenExhaustedAction, long maxWait, boolean testOnBorrow, boolean testOnReturn) {
    093            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);
    094        }
    095
    096        /**
    097         * Create a new GenericObjectPoolFactory.
    098         *
    099         * @param factory the PoolableObjectFactory used by created pools.
    100         * @param maxActive maximum number of objects that can be borrowed from created pools at one time.
    101         * @param whenExhaustedAction the action to take when the pool is exhausted.
    102         * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted.
    103         * @param maxIdle the maximum number of idle objects in my pool.
    104         * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, int, byte, long, int)
    105         */
    106        public GenericObjectPoolFactory(PoolableObjectFactory factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle) {
    107            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);
    108        }
    109
    110        /**
    111         * Create a new GenericObjectPoolFactory.
    112         *
    113         * @param factory the PoolableObjectFactory used by created pools.
    114         * @param maxActive maximum number of objects that can be borrowed from created pools at one time.
    115         * @param whenExhaustedAction the action to take when the pool is exhausted.
    116         * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted.
    117         * @param maxIdle the maximum number of idle objects in my pool.
    118         * @param testOnBorrow whether to validate objects before they are returned by the borrowObject.
    119         * @param testOnReturn whether to validate objects after they are returned to the returnObject.
    120         * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, int, byte, long, int, boolean, boolean)
    121         */
    122        public GenericObjectPoolFactory(PoolableObjectFactory factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, boolean testOnBorrow, boolean testOnReturn) {
    123            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);
    124        }
    125
    126        /**
    127         * Create a new GenericObjectPoolFactory.
    128         *
    129         * @param factory the PoolableObjectFactory used by created pools.
    130         * @param maxActive maximum number of objects that can be borrowed from created pools at one time.
    131         * @param whenExhaustedAction the action to take when the pool is exhausted.
    132         * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted.
    133         * @param maxIdle the maximum number of idle objects in my pool.
    134         * @param testOnBorrow whether to validate objects before they are returned by the borrowObject.
    135         * @param testOnReturn whether to validate objects after they are returned to the returnObject.
    136         * @param timeBetweenEvictionRunsMillis the number of milliseconds to sleep between examining idle objects for eviction.
    137         * @param numTestsPerEvictionRun the number of idle objects to examine per run within the idle object eviction thread.
    138         * @param minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction.
    139         * @param testWhileIdle whether or not to validate objects in the idle object eviction thread.
    140         * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, int, byte, long, int, boolean, boolean, long, int, long, boolean)
    141         */
    142        public GenericObjectPoolFactory(PoolableObjectFactory factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle) {
    143            this(factory,maxActive,whenExhaustedAction,maxWait,maxIdle,GenericObjectPool.DEFAULT_MIN_IDLE,testOnBorrow,testOnReturn,timeBetweenEvictionRunsMillis,numTestsPerEvictionRun,minEvictableIdleTimeMillis,testWhileIdle, GenericObjectPool.DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS);
    144        }
    145
    146        /**
    147         * Create a new GenericObjectPoolFactory.
    148         *
    149         * @param factory the PoolableObjectFactory used by created pools.
    150         * @param maxActive maximum number of objects that can be borrowed from created pools at one time.
    151         * @param whenExhaustedAction the action to take when the pool is exhausted.
    152         * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted.
    153         * @param maxIdle the maximum number of idle objects in my pool.
    154         * @param minIdle the minimum number of idle objects in my pool.
    155         * @param testOnBorrow whether to validate objects before they are returned by the borrowObject.
    156         * @param testOnReturn whether to validate objects after they are returned to the returnObject.
    157         * @param timeBetweenEvictionRunsMillis the number of milliseconds to sleep between examining idle objects for eviction.
    158         * @param numTestsPerEvictionRun the number of idle objects to examine per run within the idle object eviction thread.
    159         * @param minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction.
    160         * @param testWhileIdle whether or not to validate objects in the idle object eviction thread.
    161         * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, int, byte, long, int, int, boolean, boolean, long, int, long, boolean)
    162         */
    163        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) {
    164            this(factory,maxActive,whenExhaustedAction,maxWait,maxIdle,minIdle,testOnBorrow,testOnReturn,timeBetweenEvictionRunsMillis,numTestsPerEvictionRun,minEvictableIdleTimeMillis,testWhileIdle, GenericObjectPool.DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS);
    165        }
    166
    167        /**
    168         * Create a new GenericObjectPoolFactory.
    169         *
    170         * @param factory the PoolableObjectFactory used by created pools.
    171         * @param maxActive maximum number of objects that can be borrowed from created pools at one time.
    172         * @param whenExhaustedAction the action to take when the pool is exhausted.
    173         * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted.
    174         * @param maxIdle the maximum number of idle objects in my pool.
    175         * @param minIdle the minimum number of idle objects in my pool.
    176         * @param testOnBorrow whether to validate objects before they are returned by the borrowObject.
    177         * @param testOnReturn whether to validate objects after they are returned to the returnObject.
    178         * @param timeBetweenEvictionRunsMillis the number of milliseconds to sleep between examining idle objects for eviction.
    179         * @param numTestsPerEvictionRun the number of idle objects to examine per run within the idle object eviction thread.
    180         * @param minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction.
    181         * @param testWhileIdle whether or not to validate objects in the idle object eviction thread.
    182         * @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.
    183         * @since Pool 1.3
    184         * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, int, byte, long, int, int, boolean, boolean, long, int, long, boolean, long)
    185         */
    186        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) {
    187            this(factory,maxActive,whenExhaustedAction,maxWait,maxIdle,minIdle,testOnBorrow,testOnReturn,timeBetweenEvictionRunsMillis,numTestsPerEvictionRun,minEvictableIdleTimeMillis,testWhileIdle,softMinEvictableIdleTimeMillis, GenericObjectPool.DEFAULT_LIFO);
    188        }
    189
    190        /**
    191         * Create a new GenericObjectPoolFactory.
    192         *
    193         * @param factory the PoolableObjectFactory used by created pools.
    194         * @param maxActive maximum number of objects that can be borrowed from created pools at one time.
    195         * @param whenExhaustedAction the action to take when the pool is exhausted.
    196         * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted.
    197         * @param maxIdle the maximum number of idle objects in my pool.
    198         * @param minIdle the minimum number of idle objects in my pool.
    199         * @param testOnBorrow whether to validate objects before they are returned by the borrowObject.
    200         * @param testOnReturn whether to validate objects after they are returned to the returnObject.
    201         * @param timeBetweenEvictionRunsMillis the number of milliseconds to sleep between examining idle objects for eviction.
    202         * @param numTestsPerEvictionRun the number of idle objects to examine per run within the idle object eviction thread.
    203         * @param minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction.
    204         * @param testWhileIdle whether or not to validate objects in the idle object eviction thread.
    205         * @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.
    206         * @param lifo whether or not objects are returned in last-in-first-out order from the idle object pool.
    207         * @since Pool 1.4
    208         * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, int, byte, long, int, int, boolean, boolean, long, int, long, boolean, long, boolean)
    209         */
    210        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, boolean lifo) {
    211            _maxIdle = maxIdle;
    212            _minIdle = minIdle;
    213            _maxActive = maxActive;
    214            _maxWait = maxWait;
    215            _whenExhaustedAction = whenExhaustedAction;
    216            _testOnBorrow = testOnBorrow;
    217            _testOnReturn = testOnReturn;
    218            _testWhileIdle = testWhileIdle;
    219            _timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
    220            _numTestsPerEvictionRun = numTestsPerEvictionRun;
    221            _minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
    222            _softMinEvictableIdleTimeMillis = softMinEvictableIdleTimeMillis;
    223            _lifo = lifo;
    224            _factory = factory;
    225        }
    226
    227        /**
    228         * {@inheritDoc}
    229         */
    230        public ObjectPool createPool() {
    231            return new GenericObjectPool(_factory,_maxActive,_whenExhaustedAction,_maxWait,_maxIdle,_minIdle,_testOnBorrow,_testOnReturn,_timeBetweenEvictionRunsMillis,_numTestsPerEvictionRun,_minEvictableIdleTimeMillis,_testWhileIdle,_softMinEvictableIdleTimeMillis,_lifo);
    232        }
    233
    234
    235        /**
    236         * @return the {@link GenericObjectPool#getMaxIdle() maxIdle} setting for pools created by this factory.
    237         * @since 1.5.5
    238         */
    239        public int getMaxIdle() {
    240            return _maxIdle;
    241        }
    242
    243        /**
    244         * @return the {@link GenericObjectPool#getMinIdle() minIdle} setting for pools created by this factory.
    245         * @since 1.5.5
    246         */
    247        public int getMinIdle() {
    248            return _minIdle;
    249        }
    250
    251        /**
    252         * @return the {@link GenericObjectPool#getMaxActive() maxActive} setting for pools created by this factory.
    253         * @since 1.5.5
    254         */
    255        public int getMaxActive() {
    256            return _maxActive;
    257        }
    258
    259        /**
    260         * @return the {@link GenericObjectPool#getMaxWait() maxWait} setting for pools created by this factory.
    261         * @since 1.5.5
    262         */
    263        public long getMaxWait() {
    264            return _maxWait;
    265        }
    266
    267        /**
    268         * @return the {@link GenericObjectPool#getWhenExhaustedAction() whenExhaustedAction} setting for pools
    269         * created by this factory.
    270         * @since 1.5.5
    271         */
    272        public byte getWhenExhaustedAction() {
    273            return _whenExhaustedAction;
    274        }
    275
    276        /**
    277         * @return the {@link GenericObjectPool#getTestOnBorrow() testOnBorrow} setting for pools
    278         * created by this factory.
    279         * @since 1.5.5
    280         */
    281        public boolean getTestOnBorrow() {
    282            return _testOnBorrow;
    283        }
    284
    285        /**
    286         * @return the {@link GenericObjectPool#getTestOnReturn() testOnReturn} setting for pools
    287         * created by this factory.
    288         * @since 1.5.5
    289         */
    290        public boolean getTestOnReturn() {
    291            return _testOnReturn;
    292        }
    293
    294        /**
    295         * @return the {@link GenericObjectPool#getTestWhileIdle() testWhileIdle} setting for pools
    296         * created by this factory.
    297         * @since 1.5.5
    298         */
    299        public boolean getTestWhileIdle() {
    300            return _testWhileIdle;
    301        }
    302
    303        /**
    304         * @return the {@link GenericObjectPool#getTimeBetweenEvictionRunsMillis() timeBetweenEvictionRunsMillis}
    305         * setting for pools created by this factory.
    306         * @since 1.5.5
    307         */
    308        public long getTimeBetweenEvictionRunsMillis() {
    309            return _timeBetweenEvictionRunsMillis;
    310        }
    311
    312        /**
    313         * @return the {@link GenericObjectPool#getNumTestsPerEvictionRun() numTestsPerEvictionRun}
    314         * setting for pools created by this factory.
    315         * @since 1.5.5
    316         */
    317        public int getNumTestsPerEvictionRun() {
    318            return _numTestsPerEvictionRun;
    319        }
    320
    321        /**
    322         * @return the {@link GenericObjectPool#getMinEvictableIdleTimeMillis() minEvictableIdleTimeMillis}
    323         * setting for pools created by this factory.
    324         * @since 1.5.5
    325         */
    326        public long getMinEvictableIdleTimeMillis() {
    327            return _minEvictableIdleTimeMillis;
    328        }
    329
    330        /**
    331         * @return the {@link GenericObjectPool#getSoftMinEvictableIdleTimeMillis() softMinEvicatableIdleTimeMillis}
    332         * setting for pools created by this factory.
    333         * @since 1.5.5
    334         */
    335        public long getSoftMinEvictableIdleTimeMillis() {
    336            return _softMinEvictableIdleTimeMillis;
    337        }
    338
    339        /**
    340         * @return the {@link GenericObjectPool#getLifo() lifo} setting for pools created by this factory.
    341         * @since 1.5.5
    342         */
    343        public boolean getLifo() {
    344            return _lifo;
    345        }
    346
    347        /**
    348         * @return the {@link PoolableObjectFactory} used by pools created by this factory
    349         */
    350        public PoolableObjectFactory getFactory() {
    351            return _factory;
    352        }
    353
    354        /**
    355         * The {@link GenericObjectPool#getMaxIdle() maxIdle} setting for pools created by this factory.
    356         * @deprecated to be removed in pool 2.0.  Use {@link #getMaxIdle()}.
    357         */
    358        protected int _maxIdle = GenericObjectPool.DEFAULT_MAX_IDLE;
    359
    360        /**
    361         * The {@link GenericObjectPool#getMinIdle() minIdle} setting for pools created by this factory.
    362         * @deprecated to be removed in pool 2.0.  Use {@link #getMinIdle()}.
    363         */
    364        protected int _minIdle = GenericObjectPool.DEFAULT_MIN_IDLE;
    365
    366        /**
    367         * The {@link GenericObjectPool#getMaxActive() maxActive} setting for pools created by this factory.
    368         * @deprecated to be removed in pool 2.0.  Use {@link #getMaxActive()}.
    369         */
    370        protected int _maxActive = GenericObjectPool.DEFAULT_MAX_ACTIVE;
    371
    372        /**
    373         * The {@link GenericObjectPool#getMaxWait() maxWait} setting for pools created by this factory.
    374         * @deprecated to be removed in pool 2.0.  Use {@link #getMaxWait()}.
    375         */
    376        protected long _maxWait = GenericObjectPool.DEFAULT_MAX_WAIT;
    377
    378        /**
    379         * The {@link GenericObjectPool#getWhenExhaustedAction() whenExhaustedAction} setting for pools
    380         * created by this factory.
    381         * @deprecated to be removed in pool 2.0.  Use {@link #getWhenExhaustedAction()}.
    382         */
    383        protected byte _whenExhaustedAction = GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION;
    384
    385        /**
    386         * The {@link GenericObjectPool#getTestOnBorrow() testOnBorrow} setting for pools created by this factory.
    387         * @deprecated to be removed in pool 2.0.  Use {@link #getTestOnBorrow()}.
    388         */
    389        protected boolean _testOnBorrow = GenericObjectPool.DEFAULT_TEST_ON_BORROW;
    390
    391        /**
    392         * The {@link GenericObjectPool#getTestOnReturn() testOnReturn} setting for pools created by this factory.
    393         * @deprecated to be removed in pool 2.0.  Use {@link #getTestOnReturn()}.
    394         */
    395        protected boolean _testOnReturn = GenericObjectPool.DEFAULT_TEST_ON_RETURN;
    396
    397        /**
    398         * The {@link GenericObjectPool#getTestWhileIdle() testWhileIdle} setting for pools created by this factory.
    399         * @deprecated to be removed in pool 2.0.  Use {@link #getTestWhileIdle()}.
    400         */
    401        protected boolean _testWhileIdle = GenericObjectPool.DEFAULT_TEST_WHILE_IDLE;
    402
    403        /**
    404         * The {@link GenericObjectPool#getTimeBetweenEvictionRunsMillis() timeBetweenEvictionRunsMillis}
    405         * setting for pools created by this factory.
    406         * @deprecated to be removed in pool 2.0.  Use {@link #getTimeBetweenEvictionRunsMillis()}.
    407         */
    408        protected long _timeBetweenEvictionRunsMillis = GenericObjectPool.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS;
    409
    410        /**
    411         * The {@link GenericObjectPool#getNumTestsPerEvictionRun() numTestsPerEvictionRun} setting
    412         * for pools created by this factory.
    413         * @deprecated to be removed in pool 2.0.  Use {@link #getNumTestsPerEvictionRun()}.
    414         */
    415        protected int _numTestsPerEvictionRun =  GenericObjectPool.DEFAULT_NUM_TESTS_PER_EVICTION_RUN;
    416
    417        /**
    418         * The {@link GenericObjectPool#getMinEvictableIdleTimeMillis() minEvictableIdleTimeMillis}
    419         * setting for pools created by this factory.
    420         * @deprecated to be removed in pool 2.0.  Use {@link #getMinEvictableIdleTimeMillis()}.
    421         */
    422        protected long _minEvictableIdleTimeMillis = GenericObjectPool.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS;
    423
    424        /**
    425         * The {@link GenericObjectPool#getSoftMinEvictableIdleTimeMillis() softMinEvictableIdleTimeMillis}
    426         * setting for pools created by this factory.
    427         * @deprecated to be removed in pool 2.0.  Use {@link #getSoftMinEvictableIdleTimeMillis()}.
    428         */
    429        protected long _softMinEvictableIdleTimeMillis = GenericObjectPool.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS;
    430
    431        /**
    432         * The {@link GenericObjectPool#getLifo() lifo} setting for pools created by this factory.
    433         * @deprecated to be removed in pool 2.0.  Use {@link #getLifo()}.
    434         */
    435        protected boolean _lifo = GenericObjectPool.DEFAULT_LIFO;
    436
    437        /**
    438         * The {@link PoolableObjectFactory} used by pools created by this factory.
    439         * @deprecated to be removed in pool 2.0.  Use {@link #getFactory()}.
    440         */
    441        protected PoolableObjectFactory _factory = null;
    442
    443    }