GenericObjectPoolConfig
数量控制参数
maxTotal
链接池中最⼤连接数,默认为8
maxIdle
链接池中最⼤空闲的连接数,默认也为8
minIdle
汤阴岳飞庙连接池中最少空闲的连接数,默认为0
类很简单,继承了BaOjectPoolConfig抽象类,对上⾯的⼏种变量设置默认始值以及对应getter、tter。另外是⼀个克隆⽅法。
package s.pool2.impl;
家用冰箱public class GenericObjectPoolConfig extends BaObjectPoolConfig { public static final int DEFAULT_MAX_TOTAL = 8;
public static final int DEFAULT_MAX_IDLE = 8;
public static final int DEFAULT_MIN_IDLE = 0;
private int maxTotal = DEFAULT_MAX_TOTAL;
private int maxIdle = DEFAULT_MAX_IDLE;
private int minIdle = DEFAULT_MIN_IDLE;
public int getMaxTotal() {
return maxTotal;
}
public void tMaxTotal(int maxTotal) {
this.maxTotal = maxTotal;
}
public int getMaxIdle() {
上气接下气打一字return maxIdle;
}
public void tMaxIdle(int maxIdle) {
脚底湿疹
this.maxIdle = maxIdle;情人的诗句
}
public int getMinIdle() {
return minIdle;
西安房价走势最新消息}
public void tMinIdle(int minIdle) {
this.minIdle = minIdle;
}
@Override
public GenericObjectPoolConfig clone() {
元宵要煮多久
try {
return (GenericObjectPoolConfig) super.clone();学写字
} catch (CloneNotSupportedException e) {
throw new AsrtionError(); // Can't happen
}
}
}