T - Connection type.public class RedisConnectionPool<T> extends Object implements Closeable
| Constructor and Description |
|---|
RedisConnectionPool(com.lambdaworks.redis.RedisConnectionProvider<T> redisConnectionProvider,
int maxActive,
int maxIdle,
long maxWait)
Create a new connection pool
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(CloseEvents.CloseListener listener)
Adds a CloseListener.
|
T |
allocateConnection()
Allocate a connection from the pool.
|
void |
close()
Close the pool and close all idle connections.
|
void |
freeConnection(T t)
Return a connection into the pool.
|
Class<? extends T> |
getComponentType() |
int |
getNumActive() |
int |
getNumIdle() |
void |
removeListener(CloseEvents.CloseListener listener)
Removes a CloseListener.
|
public RedisConnectionPool(com.lambdaworks.redis.RedisConnectionProvider<T> redisConnectionProvider, int maxActive, int maxIdle, long maxWait)
redisConnectionProvider - the connection providermaxActive - max active connectionsmaxIdle - max idle connectionsmaxWait - max wait time (ms) for a connectionpublic T allocateConnection()
close() on
the connection).public void freeConnection(T t)
t - the connection.public int getNumIdle()
public int getNumActive()
public void close()
close in interface Closeableclose in interface AutoCloseablepublic Class<? extends T> getComponentType()
public void addListener(CloseEvents.CloseListener listener)
listener - the listenerpublic void removeListener(CloseEvents.CloseListener listener)
listener - the listenerCopyright © 2016. All rights reserved.