From 774b52ab2fb881cf054881760baee0d1d597503a Mon Sep 17 00:00:00 2001 From: zjz1993 <1429595365@qq.com> Date: Fri, 30 Aug 2019 14:43:03 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E5=B0=86holderKit.Conf=E8=BF=98?= =?UTF-8?q?=E5=8E=9F=E4=B8=BAConf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../redis/core/RedisDatabaseConnection.java | 13 +++++----- .../fr/plugin/db/redis/core/RedisNode.java | 13 +++++----- .../db/redis/core/RedisScriptTableData.java | 13 +++++----- .../plugin/db/redis/core/RedisTableData.java | 18 +++++++------ .../core/pool/RedisConnectionPoolConfig.java | 25 ++++++++++--------- .../core/pool/RedisConnectionProxyConfig.java | 25 ++++++++++--------- 6 files changed, 57 insertions(+), 50 deletions(-) diff --git a/src/main/java/com/fr/plugin/db/redis/core/RedisDatabaseConnection.java b/src/main/java/com/fr/plugin/db/redis/core/RedisDatabaseConnection.java index 39b6962..265c4d0 100755 --- a/src/main/java/com/fr/plugin/db/redis/core/RedisDatabaseConnection.java +++ b/src/main/java/com/fr/plugin/db/redis/core/RedisDatabaseConnection.java @@ -13,6 +13,7 @@ import com.fanruan.api.util.StringKit; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; import com.fr.third.redis.clients.jedis.Jedis; +import com.fr.config.holder.Conf; import java.util.ArrayList; import java.util.Collection; @@ -23,9 +24,9 @@ public class RedisDatabaseConnection extends AbstractDatabaseConnection { private static final int DEFAULT_REDIS_PORT = 6379; - private HolderKit.Conf host = HolderKit.simple(StringKit.EMPTY); - private HolderKit.Conf port = HolderKit.simple(DEFAULT_REDIS_PORT); - private HolderKit.Conf password = HolderKit.simple(StringKit.EMPTY); + private Conf host = HolderKit.simple(StringKit.EMPTY); + private Conf port = HolderKit.simple(DEFAULT_REDIS_PORT); + private Conf password = HolderKit.simple(StringKit.EMPTY); public RedisDatabaseConnection() { @@ -167,9 +168,9 @@ public class RedisDatabaseConnection extends AbstractDatabaseConnection { @Override public Object clone() throws CloneNotSupportedException { com.fr.plugin.db.redis.core.RedisDatabaseConnection cloned = (com.fr.plugin.db.redis.core.RedisDatabaseConnection) super.clone(); - cloned.host = (HolderKit.Conf) host.clone(); - cloned.port = (HolderKit.Conf) port.clone(); - cloned.password = (HolderKit.Conf) password.clone(); + cloned.host = (Conf) host.clone(); + cloned.port = (Conf) port.clone(); + cloned.password = (Conf) password.clone(); return cloned; } } \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/db/redis/core/RedisNode.java b/src/main/java/com/fr/plugin/db/redis/core/RedisNode.java index 3dd84e1..d8d214b 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/RedisNode.java +++ b/src/main/java/com/fr/plugin/db/redis/core/RedisNode.java @@ -4,6 +4,7 @@ import com.fanruan.api.conf.HolderKit; import com.fanruan.api.conf.BaseUniqueKey; import com.fanruan.api.util.AssistKit; import com.fanruan.api.util.StringKit; +import com.fr.config.holder.Conf; /** * @author richie @@ -14,9 +15,9 @@ public class RedisNode extends BaseUniqueKey { public static final int DEFAULT_REDIS_PORT = 6379; - private HolderKit.Conf host = HolderKit.simple(StringKit.EMPTY); - private HolderKit.Conf port = HolderKit.simple(DEFAULT_REDIS_PORT); - private HolderKit.Conf password = HolderKit.simple(StringKit.EMPTY); + private Conf host = HolderKit.simple(StringKit.EMPTY); + private Conf port = HolderKit.simple(DEFAULT_REDIS_PORT); + private Conf password = HolderKit.simple(StringKit.EMPTY); public RedisNode(String host, int port, String password) { this.setHost(host); @@ -64,9 +65,9 @@ public class RedisNode extends BaseUniqueKey { @Override public Object clone() throws CloneNotSupportedException { RedisNode cloned = (RedisNode) super.clone(); - cloned.host = (HolderKit.Conf) host.clone(); - cloned.port = (HolderKit.Conf) port.clone(); - cloned.password = (HolderKit.Conf) password.clone(); + cloned.host = (Conf) host.clone(); + cloned.port = (Conf) port.clone(); + cloned.password = (Conf) password.clone(); return cloned; } } diff --git a/src/main/java/com/fr/plugin/db/redis/core/RedisScriptTableData.java b/src/main/java/com/fr/plugin/db/redis/core/RedisScriptTableData.java index fbce027..f1529f8 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/RedisScriptTableData.java +++ b/src/main/java/com/fr/plugin/db/redis/core/RedisScriptTableData.java @@ -22,6 +22,7 @@ import com.fr.stable.ParameterProvider; import com.fanruan.api.util.StringKit; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; +import com.fr.config.holder.Conf; /** * @author richie @@ -33,9 +34,9 @@ public class RedisScriptTableData extends AbstractParameterTableData { private static final long serialVersionUID = 1525853354993816818L; - private HolderKit.Conf database = HolderKit.obj(null, Connection.class); - private HolderKit.Conf dbIndex = XmlHolders.obj(new NumberOrderValue(0), OrderValue.class, OrderValue.XML_TAG); - private HolderKit.Conf script = HolderKit.simple(StringKit.EMPTY); + private Conf database = HolderKit.obj(null, Connection.class); + private Conf dbIndex = XmlHolders.obj(new NumberOrderValue(0), OrderValue.class, OrderValue.XML_TAG); + private Conf script = HolderKit.simple(StringKit.EMPTY); public void setDatabase(Connection c) { this.database.set(c); @@ -135,9 +136,9 @@ public class RedisScriptTableData extends AbstractParameterTableData { @Override public Object clone() throws CloneNotSupportedException { RedisScriptTableData cloned = (RedisScriptTableData) super.clone(); - cloned.database = (HolderKit.Conf) database.clone(); - cloned.script = (HolderKit.Conf) script.clone(); - cloned.dbIndex = (HolderKit.Conf) dbIndex.clone(); + cloned.database = (Conf) database.clone(); + cloned.script = (Conf) script.clone(); + cloned.dbIndex = (Conf) dbIndex.clone(); return cloned; } } diff --git a/src/main/java/com/fr/plugin/db/redis/core/RedisTableData.java b/src/main/java/com/fr/plugin/db/redis/core/RedisTableData.java index a5b2734..6d120ab 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/RedisTableData.java +++ b/src/main/java/com/fr/plugin/db/redis/core/RedisTableData.java @@ -24,6 +24,8 @@ import com.fanruan.api.util.StringKit; import com.fr.stable.ParameterProvider; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; +import com.fr.config.holder.Conf; + import java.util.HashMap; import java.util.Map; @@ -33,10 +35,10 @@ import java.util.Map; public class RedisTableData extends AbstractParameterTableData { private static final long serialVersionUID = 7017455818551800001L; - private HolderKit.Conf database = HolderKit.obj(null, Connection.class); - private HolderKit.Conf dbIndex = XmlHolders.obj(new NumberOrderValue(0), OrderValue.class, OrderValue.XML_TAG); - private HolderKit.Conf query = HolderKit.simple(StringKit.EMPTY); - private HolderKit.Conf script = HolderKit.simple(StringKit.EMPTY); + private Conf database = HolderKit.obj(null, Connection.class); + private Conf dbIndex = XmlHolders.obj(new NumberOrderValue(0), OrderValue.class, OrderValue.XML_TAG); + private Conf query = HolderKit.simple(StringKit.EMPTY); + private Conf script = HolderKit.simple(StringKit.EMPTY); public void setDatabase(Connection c) { this.database.set(c); @@ -153,10 +155,10 @@ public class RedisTableData extends AbstractParameterTableData { @Override public Object clone() throws CloneNotSupportedException { RedisTableData cloned = (RedisTableData) super.clone(); - cloned.database = (HolderKit.Conf) database.clone(); - cloned.query = (HolderKit.Conf) query.clone(); - cloned.script = (HolderKit.Conf) script.clone(); - cloned.dbIndex = (HolderKit.Conf) dbIndex.clone(); + cloned.database = (Conf) database.clone(); + cloned.query = (Conf) query.clone(); + cloned.script = (Conf) script.clone(); + cloned.dbIndex = (Conf) dbIndex.clone(); return cloned; } } \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionPoolConfig.java b/src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionPoolConfig.java index 467a73a..ed8ab16 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionPoolConfig.java +++ b/src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionPoolConfig.java @@ -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 maxTotal = HolderKit.simple(MAX_TOTAL); - private HolderKit.Conf maxWait = HolderKit.simple(MAX_WAIT); - private HolderKit.Conf maxIdle = HolderKit.simple(MAX_IDLE); - private HolderKit.Conf blockWhenExhausted = HolderKit.simple(true); - private HolderKit.Conf lifo = HolderKit.simple(true); - private HolderKit.Conf timeout = HolderKit.simple(TIME_OUT); + private Conf maxTotal = HolderKit.simple(MAX_TOTAL); + private Conf maxWait = HolderKit.simple(MAX_WAIT); + private Conf maxIdle = HolderKit.simple(MAX_IDLE); + private Conf blockWhenExhausted = HolderKit.simple(true); + private Conf lifo = HolderKit.simple(true); + private Conf 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) maxTotal.clone(); - cloned.maxWait = (HolderKit.Conf) maxWait.clone(); - cloned.maxIdle = (HolderKit.Conf) maxIdle.clone(); - cloned.blockWhenExhausted = (HolderKit.Conf) blockWhenExhausted.clone(); - cloned.lifo = (HolderKit.Conf) lifo.clone(); - cloned.timeout = (HolderKit.Conf) timeout.clone(); + cloned.maxTotal = (Conf) maxTotal.clone(); + cloned.maxWait = (Conf) maxWait.clone(); + cloned.maxIdle = (Conf) maxIdle.clone(); + cloned.blockWhenExhausted = (Conf) blockWhenExhausted.clone(); + cloned.lifo = (Conf) lifo.clone(); + cloned.timeout = (Conf) timeout.clone(); return cloned; } } diff --git a/src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionProxyConfig.java b/src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionProxyConfig.java index cb8fbc7..1800ebd 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionProxyConfig.java +++ b/src/main/java/com/fr/plugin/db/redis/core/pool/RedisConnectionProxyConfig.java @@ -5,6 +5,7 @@ import com.fanruan.api.conf.BaseConfiguration; import com.fanruan.api.conf.HolderKit; import com.fanruan.api.security.SecurityKit; import com.fanruan.api.util.StringKit; +import com.fr.config.holder.Conf; /** * @author richie @@ -22,17 +23,17 @@ public class RedisConnectionProxyConfig extends BaseConfiguration { return instance; } - private HolderKit.Conf open = HolderKit.simple(false); + private Conf open = HolderKit.simple(false); - private HolderKit.Conf host = HolderKit.simple(StringKit.EMPTY); + private Conf host = HolderKit.simple(StringKit.EMPTY); - private HolderKit.Conf port = HolderKit.simple(22); + private Conf port = HolderKit.simple(22); - private HolderKit.Conf username = HolderKit.simple(StringKit.EMPTY); + private Conf username = HolderKit.simple(StringKit.EMPTY); - private HolderKit.Conf password = HolderKit.simple(StringKit.EMPTY); + private Conf password = HolderKit.simple(StringKit.EMPTY); - private HolderKit.Conf privateKeyPath = HolderKit.simple(StringKit.EMPTY); + private Conf privateKeyPath = HolderKit.simple(StringKit.EMPTY); public boolean isOpen() { @@ -87,12 +88,12 @@ public class RedisConnectionProxyConfig extends BaseConfiguration { @Override public Object clone() throws CloneNotSupportedException { RedisConnectionProxyConfig cloned = (RedisConnectionProxyConfig) super.clone(); - cloned.open = (HolderKit.Conf) open.clone(); - cloned.host = (HolderKit.Conf) host.clone(); - cloned.port = (HolderKit.Conf) port.clone(); - cloned.username = (HolderKit.Conf) username.clone(); - cloned.password = (HolderKit.Conf) password.clone(); - cloned.privateKeyPath = (HolderKit.Conf) privateKeyPath.clone(); + cloned.open = (Conf) open.clone(); + cloned.host = (Conf) host.clone(); + cloned.port = (Conf) port.clone(); + cloned.username = (Conf) username.clone(); + cloned.password = (Conf) password.clone(); + cloned.privateKeyPath = (Conf) privateKeyPath.clone(); return cloned; } }