
com.github.ddth.redis.impl.JedisClientPool Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ddth-redis Show documentation
Show all versions of ddth-redis Show documentation
DDTH's Redis Libraries and Utilities
The newest version!
package com.github.ddth.redis.impl;
import org.apache.commons.pool2.PooledObjectFactory;
import com.github.ddth.redis.PoolConfig;
import com.github.ddth.redis.RedisClientPool;
/**
* Apache commons-pool2 of {@link JedisRedisClient} instances.
*
* @author Thanh Ba Nguyen
* @since 0.1.0
*/
public class JedisClientPool extends RedisClientPool {
public JedisClientPool(PooledObjectFactory factory, PoolConfig poolConfig) {
super(factory, poolConfig);
}
/**
* {@inheritDoc}
*/
@Override
public JedisRedisClient borrowObject() throws Exception {
JedisRedisClient redisClient = (JedisRedisClient) super.borrowObject();
if (redisClient != null) {
redisClient.setRedisClientPool(this);
}
return redisClient;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy