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 |
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) |
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()
public void returnResourceObject(T resource)
public void returnBrokenResource(T resource)
public void returnResource(T resource)
public void destroy()
protected void returnBrokenResourceObject(T resource)
protected void closeInternalPool()
Copyright © 2014. All rights reserved.