redis.clients.util
Class Pool<T>

java.lang.Object
  extended by redis.clients.util.Pool<T>
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
JedisPool, JedisSentinelPool, ShardedJedisPool

public abstract class Pool<T>
extends Object
implements Closeable


Field Summary
protected  org.apache.commons.pool2.impl.GenericObjectPool<T> internalPool
           
 
Constructor Summary
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)
           
 
Method Summary
 void close()
           
protected  void closeInternalPool()
           
 void destroy()
           
 T getResource()
           
 void initPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig, org.apache.commons.pool2.PooledObjectFactory<T> factory)
           
 boolean isClosed()
           
 void returnBrokenResource(T resource)
           
protected  void returnBrokenResourceObject(T resource)
           
 void returnResource(T resource)
           
 void returnResourceObject(T resource)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

internalPool

protected org.apache.commons.pool2.impl.GenericObjectPool<T> internalPool
Constructor Detail

Pool

public Pool()
Using this constructor means you have to set and initialize the internalPool yourself.


Pool

public Pool(org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig,
            org.apache.commons.pool2.PooledObjectFactory<T> factory)
Method Detail

close

public void close()
Specified by:
close in interface Closeable

isClosed

public boolean isClosed()

initPool

public void initPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig,
                     org.apache.commons.pool2.PooledObjectFactory<T> factory)

getResource

public T getResource()

returnResourceObject

public void returnResourceObject(T resource)

returnBrokenResource

public void returnBrokenResource(T resource)

returnResource

public void returnResource(T resource)

destroy

public void destroy()

returnBrokenResourceObject

protected void returnBrokenResourceObject(T resource)

closeInternalPool

protected void closeInternalPool()


Copyright © 2014. All rights reserved.