All Downloads are FREE. Search and download functionalities are using the official Maven repository.

redis.clients.jedis.ConnectionPool Maven / Gradle / Ivy

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;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy