Shadow client field from PipelineBlock and TransactionBlock

* it prevent from user accessing BinaryClient, while it is not treated to pipeline command
** it could make troubles when reading responses
This commit is contained in:
Jungtaek Lim
2014-01-20 14:35:42 +09:00
parent 2267c3318c
commit bc7cc5eddb
3 changed files with 17 additions and 1 deletions

View File

@@ -2,5 +2,9 @@ package redis.clients.jedis;
public abstract class PipelineBlock extends Pipeline {
// For shadowing
@SuppressWarnings("unused")
private Client client;
public abstract void execute();
}

View File

@@ -76,4 +76,8 @@ public class Transaction extends MultiKeyPipelineBase {
return client.getStatusCodeReply();
}
public void setClient(Client client) {
this.client = client;
}
}

View File

@@ -3,6 +3,10 @@ package redis.clients.jedis;
import redis.clients.jedis.exceptions.JedisException;
public abstract class TransactionBlock extends Transaction {
// For shadowing
@SuppressWarnings("unused")
private Client client;
public TransactionBlock(Client client) {
super(client);
}
@@ -13,6 +17,10 @@ public abstract class TransactionBlock extends Transaction {
public abstract void execute() throws JedisException;
public void setClient(Client client) {
this.client = client;
super.setClient(client);
}
public String discard() {
return super.discard();
}
}