redis.clients.jedis.executors.DefaultCommandExecutor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jedis Show documentation
Show all versions of jedis Show documentation
Jedis is a blazingly small and sane Redis java client.
package redis.clients.jedis.executors;
import redis.clients.jedis.CommandObject;
import redis.clients.jedis.Connection;
import redis.clients.jedis.util.IOUtils;
import redis.clients.jedis.providers.ConnectionProvider;
public class DefaultCommandExecutor implements CommandExecutor {
protected final ConnectionProvider provider;
public DefaultCommandExecutor(ConnectionProvider provider) {
this.provider = provider;
}
@Override
public void close() {
IOUtils.closeQuietly(this.provider);
}
@Override
public final T executeCommand(CommandObject commandObject) {
try (Connection connection = provider.getConnection(commandObject.getArguments())) {
return connection.executeCommand(commandObject);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy