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