public final class PoolUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
PoolUtils.PoolWork<T,V>
A unit of work that utilizes a pooled resource.
|
| Modifier and Type | Method and Description |
|---|---|
static redis.clients.util.Pool<redis.clients.jedis.Jedis> |
createJedisPool(Config jesqueConfig)
A simple helper method that creates a pool of connections to Redis using
the supplied Config and the default pool config.
|
static redis.clients.util.Pool<redis.clients.jedis.Jedis> |
createJedisPool(Config jesqueConfig,
org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig)
A simple helper method that creates a pool of connections to Redis using
the supplied configurations.
|
static <T,V> V |
doWorkInPool(redis.clients.util.Pool<T> pool,
PoolUtils.PoolWork<T,V> work)
Perform the given work with a resource from the given pool.
|
static <T,V> V |
doWorkInPoolNicely(redis.clients.util.Pool<T> pool,
PoolUtils.PoolWork<T,V> work)
Perform the given work with a resource from the given pool.
|
static org.apache.commons.pool2.impl.GenericObjectPoolConfig |
getDefaultPoolConfig() |
public static <T,V> V doWorkInPool(redis.clients.util.Pool<T> pool,
PoolUtils.PoolWork<T,V> work)
throws Exception
T - the resource typeV - the result typepool - the resource poolwork - the work to performException - if something went wrongpublic static <T,V> V doWorkInPoolNicely(redis.clients.util.Pool<T> pool,
PoolUtils.PoolWork<T,V> work)
T - the resource typeV - the result typepool - the resource poolwork - the work to performpublic static org.apache.commons.pool2.impl.GenericObjectPoolConfig getDefaultPoolConfig()
public static redis.clients.util.Pool<redis.clients.jedis.Jedis> createJedisPool(Config jesqueConfig)
jesqueConfig - the config used to create the pooled Jedis connectionpublic static redis.clients.util.Pool<redis.clients.jedis.Jedis> createJedisPool(Config jesqueConfig, org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig)
jesqueConfig - the config used to create the pooled Jedis connectionspoolConfig - the config used to create the poolCopyright © 2011-2015. All Rights Reserved.