|
|
|
@ -3,6 +3,7 @@ package com.fr.plugin.db.redis.core.pool;
|
|
|
|
|
import com.fr.config.ConfigContext; |
|
|
|
|
import com.fanruan.api.conf.BaseConfiguration; |
|
|
|
|
import com.fanruan.api.conf.HolderKit; |
|
|
|
|
import com.fr.config.holder.Conf; |
|
|
|
|
|
|
|
|
|
import javax.xml.ws.Holder; |
|
|
|
|
|
|
|
|
@ -27,12 +28,12 @@ public class RedisConnectionPoolConfig extends BaseConfiguration {
|
|
|
|
|
private static final int MAX_WAIT = -1; |
|
|
|
|
private static final int TIME_OUT = 100 * 1000; |
|
|
|
|
|
|
|
|
|
private HolderKit.Conf<Integer> maxTotal = HolderKit.simple(MAX_TOTAL); |
|
|
|
|
private HolderKit.Conf<Integer> maxWait = HolderKit.simple(MAX_WAIT); |
|
|
|
|
private HolderKit.Conf<Integer> maxIdle = HolderKit.simple(MAX_IDLE); |
|
|
|
|
private HolderKit.Conf<Boolean> blockWhenExhausted = HolderKit.simple(true); |
|
|
|
|
private HolderKit.Conf<Boolean> lifo = HolderKit.simple(true); |
|
|
|
|
private HolderKit.Conf<Integer> timeout = HolderKit.simple(TIME_OUT); |
|
|
|
|
private Conf<Integer> maxTotal = HolderKit.simple(MAX_TOTAL); |
|
|
|
|
private Conf<Integer> maxWait = HolderKit.simple(MAX_WAIT); |
|
|
|
|
private Conf<Integer> maxIdle = HolderKit.simple(MAX_IDLE); |
|
|
|
|
private Conf<Boolean> blockWhenExhausted = HolderKit.simple(true); |
|
|
|
|
private Conf<Boolean> lifo = HolderKit.simple(true); |
|
|
|
|
private Conf<Integer> timeout = HolderKit.simple(TIME_OUT); |
|
|
|
|
|
|
|
|
|
public int getMaxTotal() { |
|
|
|
|
return maxTotal.get(); |
|
|
|
@ -85,12 +86,12 @@ public class RedisConnectionPoolConfig extends BaseConfiguration {
|
|
|
|
|
@Override |
|
|
|
|
public Object clone() throws CloneNotSupportedException { |
|
|
|
|
RedisConnectionPoolConfig cloned = (RedisConnectionPoolConfig) super.clone(); |
|
|
|
|
cloned.maxTotal = (HolderKit.Conf<Integer>) maxTotal.clone(); |
|
|
|
|
cloned.maxWait = (HolderKit.Conf<Integer>) maxWait.clone(); |
|
|
|
|
cloned.maxIdle = (HolderKit.Conf<Integer>) maxIdle.clone(); |
|
|
|
|
cloned.blockWhenExhausted = (HolderKit.Conf<Boolean>) blockWhenExhausted.clone(); |
|
|
|
|
cloned.lifo = (HolderKit.Conf<Boolean>) lifo.clone(); |
|
|
|
|
cloned.timeout = (HolderKit.Conf<Integer>) timeout.clone(); |
|
|
|
|
cloned.maxTotal = (Conf<Integer>) maxTotal.clone(); |
|
|
|
|
cloned.maxWait = (Conf<Integer>) maxWait.clone(); |
|
|
|
|
cloned.maxIdle = (Conf<Integer>) maxIdle.clone(); |
|
|
|
|
cloned.blockWhenExhausted = (Conf<Boolean>) blockWhenExhausted.clone(); |
|
|
|
|
cloned.lifo = (Conf<Boolean>) lifo.clone(); |
|
|
|
|
cloned.timeout = (Conf<Integer>) timeout.clone(); |
|
|
|
|
return cloned; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|