redis.clients.jedis.ConnectionPool Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jedis_preview Show documentation
Show all versions of jedis_preview Show documentation
Jedis is a blazingly small and sane Redis java client.
The newest version!
package redis.clients.jedis;
import org.apache.commons.pool2.PooledObjectFactory;
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
import redis.clients.jedis.util.Pool;
public class ConnectionPool extends Pool {
public ConnectionPool(HostAndPort hostAndPort, JedisClientConfig clientConfig) {
this(new ConnectionFactory(hostAndPort, clientConfig));
}
public ConnectionPool(HostAndPort hostAndPort, JedisClientConfig clientConfig, ClientSideCache csCache) {
this(new ConnectionFactory(hostAndPort, clientConfig, csCache));
}
public ConnectionPool(PooledObjectFactory factory) {
super(factory);
}
public ConnectionPool(HostAndPort hostAndPort, JedisClientConfig clientConfig,
GenericObjectPoolConfig poolConfig) {
this(new ConnectionFactory(hostAndPort, clientConfig), poolConfig);
}
public ConnectionPool(HostAndPort hostAndPort, JedisClientConfig clientConfig, ClientSideCache csCache,
GenericObjectPoolConfig poolConfig) {
this(new ConnectionFactory(hostAndPort, clientConfig, csCache), poolConfig);
}
public ConnectionPool(PooledObjectFactory factory,
GenericObjectPoolConfig poolConfig) {
super(factory, poolConfig);
}
@Override
public Connection getResource() {
Connection conn = super.getResource();
conn.setHandlingPool(this);
return conn;
}
}