upgrade to commons-pool 2
This commit is contained in:
@@ -1,28 +1,8 @@
|
||||
package redis.clients.jedis;
|
||||
|
||||
import org.apache.commons.pool.impl.GenericObjectPool.Config;
|
||||
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
|
||||
|
||||
/**
|
||||
* Subclass of org.apache.commons.pool.impl.GenericObjectPool.Config that
|
||||
* includes getters/setters so it can be more easily configured by Spring and
|
||||
* other IoC frameworks.
|
||||
*
|
||||
* Spring example:
|
||||
*
|
||||
* <bean id="jedisConfig" class="redis.clients.jedis.JedisPoolConfig"> <property
|
||||
* name="testWhileIdle" value="true"/> </bean>
|
||||
*
|
||||
* <bean id="jedisPool" class="redis.clients.jedis.JedisPool"
|
||||
* destroy-method="destroy"> <constructor-arg ref="jedisConfig" />
|
||||
* <constructor-arg value="localhost" /> <constructor-arg type="int"
|
||||
* value="6379" /> </bean>
|
||||
*
|
||||
* For information on parameters refer to:
|
||||
*
|
||||
* http://commons.apache.org/pool/apidocs/org/apache/commons/pool/impl/
|
||||
* GenericObjectPool.html
|
||||
*/
|
||||
public class JedisPoolConfig extends Config {
|
||||
public class JedisPoolConfig extends GenericObjectPoolConfig {
|
||||
public JedisPoolConfig() {
|
||||
// defaults to make your life with connection pool easier :)
|
||||
setTestWhileIdle(true);
|
||||
@@ -30,103 +10,4 @@ public class JedisPoolConfig extends Config {
|
||||
setTimeBetweenEvictionRunsMillis(30000);
|
||||
setNumTestsPerEvictionRun(-1);
|
||||
}
|
||||
|
||||
public int getMaxIdle() {
|
||||
return maxIdle;
|
||||
}
|
||||
|
||||
public void setMaxIdle(int maxIdle) {
|
||||
this.maxIdle = maxIdle;
|
||||
}
|
||||
|
||||
public int getMinIdle() {
|
||||
return minIdle;
|
||||
}
|
||||
|
||||
public void setMinIdle(int minIdle) {
|
||||
this.minIdle = minIdle;
|
||||
}
|
||||
|
||||
public int getMaxActive() {
|
||||
return maxActive;
|
||||
}
|
||||
|
||||
public void setMaxActive(int maxActive) {
|
||||
this.maxActive = maxActive;
|
||||
}
|
||||
|
||||
public long getMaxWait() {
|
||||
return maxWait;
|
||||
}
|
||||
|
||||
public void setMaxWait(long maxWait) {
|
||||
this.maxWait = maxWait;
|
||||
}
|
||||
|
||||
public byte getWhenExhaustedAction() {
|
||||
return whenExhaustedAction;
|
||||
}
|
||||
|
||||
public void setWhenExhaustedAction(byte whenExhaustedAction) {
|
||||
this.whenExhaustedAction = whenExhaustedAction;
|
||||
}
|
||||
|
||||
public boolean isTestOnBorrow() {
|
||||
return testOnBorrow;
|
||||
}
|
||||
|
||||
public void setTestOnBorrow(boolean testOnBorrow) {
|
||||
this.testOnBorrow = testOnBorrow;
|
||||
}
|
||||
|
||||
public boolean isTestOnReturn() {
|
||||
return testOnReturn;
|
||||
}
|
||||
|
||||
public void setTestOnReturn(boolean testOnReturn) {
|
||||
this.testOnReturn = testOnReturn;
|
||||
}
|
||||
|
||||
public boolean isTestWhileIdle() {
|
||||
return testWhileIdle;
|
||||
}
|
||||
|
||||
public void setTestWhileIdle(boolean testWhileIdle) {
|
||||
this.testWhileIdle = testWhileIdle;
|
||||
}
|
||||
|
||||
public long getTimeBetweenEvictionRunsMillis() {
|
||||
return timeBetweenEvictionRunsMillis;
|
||||
}
|
||||
|
||||
public void setTimeBetweenEvictionRunsMillis(
|
||||
long timeBetweenEvictionRunsMillis) {
|
||||
this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
|
||||
}
|
||||
|
||||
public int getNumTestsPerEvictionRun() {
|
||||
return numTestsPerEvictionRun;
|
||||
}
|
||||
|
||||
public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun) {
|
||||
this.numTestsPerEvictionRun = numTestsPerEvictionRun;
|
||||
}
|
||||
|
||||
public long getMinEvictableIdleTimeMillis() {
|
||||
return minEvictableIdleTimeMillis;
|
||||
}
|
||||
|
||||
public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) {
|
||||
this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
|
||||
}
|
||||
|
||||
public long getSoftMinEvictableIdleTimeMillis() {
|
||||
return softMinEvictableIdleTimeMillis;
|
||||
}
|
||||
|
||||
public void setSoftMinEvictableIdleTimeMillis(
|
||||
long softMinEvictableIdleTimeMillis) {
|
||||
this.softMinEvictableIdleTimeMillis = softMinEvictableIdleTimeMillis;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user