T
- Connection type.public class RedisConnectionPool<T> extends Object implements Closeable
Constructor and Description |
---|
RedisConnectionPool(com.lambdaworks.redis.RedisConnectionPool.RedisConnectionProvider<T> redisConnectionProvider,
int maxActive,
int maxIdle,
long maxWait)
Create a new connection pool
|
Modifier and Type | Method and Description |
---|---|
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() |
public RedisConnectionPool(com.lambdaworks.redis.RedisConnectionPool.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).
The connections returned by this method are proxies to the underlying connections.public void freeConnection(T t)
t
- the connection.public int getNumIdle()
public int getNumActive()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2016. All rights reserved.