/** * Subclasses can override this if they want to return a specific Commons pool. * They should apply any configuration properties to the pool here. * <p>Default is a GenericObjectPool instance with the given pool size. * @return an empty Commons {@code ObjectPool}. * @see org.apache.commons.pool.impl.GenericObjectPool * @see #setMaxSize */ protected ObjectPool createObjectPool() { GenericObjectPool gop = new GenericObjectPool(this); gop.setMaxActive(getMaxSize()); gop.setMaxIdle(getMaxIdle()); gop.setMinIdle(getMinIdle()); gop.setMaxWait(getMaxWait()); gop.setTimeBetweenEvictionRunsMillis(getTimeBetweenEvictionRunsMillis()); gop.setMinEvictableIdleTimeMillis(getMinEvictableIdleTimeMillis()); gop.setWhenExhaustedAction(getWhenExhaustedAction()); return gop; }
/** * Subclasses can override this if they want to return a specific Commons pool. * They should apply any configuration properties to the pool here. * <p>Default is a GenericObjectPool instance with the given pool size. * @return an empty Commons <code>ObjectPool</code>. * @see org.apache.commons.pool.impl.GenericObjectPool * @see #setMaxSize */ protected ObjectPool createObjectPool() { GenericObjectPool gop = new GenericObjectPool(this); gop.setMaxActive(getMaxSize()); gop.setMaxIdle(getMaxIdle()); gop.setMinIdle(getMinIdle()); gop.setMaxWait(getMaxWait()); gop.setTimeBetweenEvictionRunsMillis(getTimeBetweenEvictionRunsMillis()); gop.setMinEvictableIdleTimeMillis(getMinEvictableIdleTimeMillis()); gop.setWhenExhaustedAction(getWhenExhaustedAction()); return gop; }