1 16 17 package org.apache.commons.pool.impl; 18 19 import org.apache.commons.pool.KeyedObjectPool; 20 import org.apache.commons.pool.KeyedObjectPoolFactory; 21 import org.apache.commons.pool.KeyedPoolableObjectFactory; 22 23 32 public class StackKeyedObjectPoolFactory implements KeyedObjectPoolFactory { 33 public StackKeyedObjectPoolFactory() { 34 this((KeyedPoolableObjectFactory)null,StackKeyedObjectPool.DEFAULT_MAX_SLEEPING,StackKeyedObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY); 35 } 36 37 public StackKeyedObjectPoolFactory(int max) { 38 this((KeyedPoolableObjectFactory)null,max,StackKeyedObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY); 39 } 40 41 public StackKeyedObjectPoolFactory(int max, int init) { 42 this((KeyedPoolableObjectFactory)null,max,init); 43 } 44 45 public StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory factory) { 46 this(factory,StackKeyedObjectPool.DEFAULT_MAX_SLEEPING,StackKeyedObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY); 47 } 48 49 public StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory factory, int max) { 50 this(factory,max,StackKeyedObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY); 51 } 52 53 public StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory factory, int max, int init) { 54 _factory = factory; 55 _maxSleeping = max; 56 _initCapacity = init; 57 } 58 59 public KeyedObjectPool createPool() { 60 return new StackKeyedObjectPool(_factory,_maxSleeping,_initCapacity); 61 } 62 63 protected KeyedPoolableObjectFactory _factory = null; 64 protected int _maxSleeping = StackKeyedObjectPool.DEFAULT_MAX_SLEEPING; 65 protected int _initCapacity = StackKeyedObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY; 66 67 } 68 | Popular Tags |