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 Show documentation
Show all versions of jedis Show documentation
Jedis is a blazingly small and sane Redis java client.
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(PooledObjectFactory factory) {
super(factory);
}
public ConnectionPool(HostAndPort hostAndPort, JedisClientConfig clientConfig,
GenericObjectPoolConfig poolConfig) {
this(new ConnectionFactory(hostAndPort, clientConfig), poolConfig);
}
public ConnectionPool(PooledObjectFactory factory,
GenericObjectPoolConfig poolConfig) {
super(factory, poolConfig);
}
@Override
public Connection getResource() {
Connection conn = super.getResource();
conn.setHandlingPool(this);
return conn;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy