public abstract class Pool<T> extends Object implements Closeable
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.pool2.impl.GenericObjectPool<T> |
internalPool |
Constructor and Description |
---|
Pool()
Using this constructor means you have to set and initialize the internalPool yourself.
|
Pool(org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig,
org.apache.commons.pool2.PooledObjectFactory<T> factory) |
Modifier and Type | Method and Description |
---|---|
void |
addObjects(int count) |
void |
close() |
protected void |
closeInternalPool() |
void |
destroy() |
long |
getMaxBorrowWaitTimeMillis()
Returns the maximum waiting time spent by threads to obtain a resource
from this pool.
|
long |
getMeanBorrowWaitTimeMillis()
Returns the mean waiting time spent by threads to obtain a resource from
this pool.
|
int |
getNumActive()
Returns the number of instances currently borrowed from this pool.
|
int |
getNumIdle()
Returns the number of instances currently idle in this pool.
|
int |
getNumWaiters()
Returns an estimate of the number of threads currently blocked waiting for
a resource from this pool.
|
T |
getResource() |
void |
initPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig,
org.apache.commons.pool2.PooledObjectFactory<T> factory) |
boolean |
isClosed() |
void |
returnBrokenResource(T resource)
Deprecated.
starting from Jedis 3.0 this method will not be exposed. Resource cleanup should be
done using @see
Jedis.close() |
protected void |
returnBrokenResourceObject(T resource) |
void |
returnResource(T resource)
Deprecated.
starting from Jedis 3.0 this method will not be exposed. Resource cleanup should be
done using @see
Jedis.close() |
void |
returnResourceObject(T resource)
Deprecated.
starting from Jedis 3.0 this method will not be exposed. Resource cleanup should be
done using @see
Jedis.close() |
protected org.apache.commons.pool2.impl.GenericObjectPool<T> internalPool
public Pool()
public Pool(org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig, org.apache.commons.pool2.PooledObjectFactory<T> factory)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public boolean isClosed()
public void initPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig, org.apache.commons.pool2.PooledObjectFactory<T> factory)
public T getResource()
@Deprecated public void returnResourceObject(T resource)
Jedis.close()
@Deprecated public void returnBrokenResource(T resource)
Jedis.close()
@Deprecated public void returnResource(T resource)
Jedis.close()
public void destroy()
protected void returnBrokenResourceObject(T resource)
protected void closeInternalPool()
public int getNumActive()
public int getNumIdle()
public int getNumWaiters()
public long getMeanBorrowWaitTimeMillis()
public long getMaxBorrowWaitTimeMillis()
public void addObjects(int count)
Copyright © 2019. All rights reserved.