diff --git a/fine-jedis/src/com/fr/third/redis/clients/jedis/JedisCluster.java b/fine-jedis/src/com/fr/third/redis/clients/jedis/JedisCluster.java index 500f96acc..beebc6998 100755 --- a/fine-jedis/src/com/fr/third/redis/clients/jedis/JedisCluster.java +++ b/fine-jedis/src/com/fr/third/redis/clients/jedis/JedisCluster.java @@ -1976,4 +1976,14 @@ public class JedisCluster extends BinaryJedisCluster implements JedisClusterComm } }.run(key); } -} + + //暴露出Client, 方便上层解耦 + public Client getClient() { + + Jedis jedis = this.connectionHandler.getConnection(); + if (jedis != null) { + return jedis.getClient(); + } + return null; + } +} \ No newline at end of file diff --git a/fine-jedis/src/com/fr/third/redis/clients/jedis/JedisPubSub.java b/fine-jedis/src/com/fr/third/redis/clients/jedis/JedisPubSub.java index 4520bb9af..b9d287091 100755 --- a/fine-jedis/src/com/fr/third/redis/clients/jedis/JedisPubSub.java +++ b/fine-jedis/src/com/fr/third/redis/clients/jedis/JedisPubSub.java @@ -21,6 +21,14 @@ public abstract class JedisPubSub { private int subscribedChannels = 0; private volatile Client client; + public JedisPubSub() { + + } + + public JedisPubSub(Client client) { + this.client = client; + } + public void onMessage(String channel, String message) { } @@ -176,4 +184,4 @@ public abstract class JedisPubSub { public int getSubscribedChannels() { return subscribedChannels; } -} +} \ No newline at end of file