List of usage examples for org.apache.commons.pool.impl GenericObjectPoolFactory GenericObjectPoolFactory
public GenericObjectPoolFactory(PoolableObjectFactory factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle)
From source file:org.yosemite.jcsadra.impl.SimpleCassandraClientPool.java
/** * this construct method wamaxWaitWhenBlockExhausteds for unit test, for regulary usage, should not given the client factory *//* w ww .ja v a 2s .c o m*/ protected SimpleCassandraClientPool(String serviceURL, int port, PoolableObjectFactory clientfactory, int maxActive, ExhaustedAction exhaustedAction, long maxWait, int maxIdle) { this.serviceURL = serviceURL; this.port = port; this.maxActive = maxActive; this.exhaustedAction = exhaustedAction; this.maxWaitWhenBlockByExhausted = maxWait; this.maxIdle = maxIdle; // if not give a client factory, will create the default PoolableClientFactory if (clientfactory == null) { this._clientfactory = new PoolableClientFactory(); _poolfactory = new GenericObjectPoolFactory(_clientfactory, maxActive, getObjectPoolExhaustedAction(exhaustedAction), maxWait, maxIdle); } else { _poolfactory = new GenericObjectPoolFactory(clientfactory, maxActive, getObjectPoolExhaustedAction(exhaustedAction), maxWait, maxIdle); } _pool = (GenericObjectPool) _poolfactory.createPool(); }