Package de.intarsys.tools.pool
Class GenericPool
- java.lang.Object
-
- de.intarsys.tools.pool.GenericPool
-
-
Constructor Summary
Constructors Constructor Description GenericPool(IPoolObjectFactory objectFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidactivateObject(java.lang.Object object)protected voidassertOpen()voidcheckin(java.lang.Object object)Add an object to the pool.java.lang.Objectcheckout(long timeout)Get an object from the pool.voidclose()Close the pool.protected java.lang.ObjectcreateObject()protected voiddeactivateObject(java.lang.Object object)voiddestroy(java.lang.Object object)Destroy an object previously allocated from the pool.protected voiddestroyObject(java.lang.Object object)protected booleanisClosed()
-
-
-
Constructor Detail
-
GenericPool
public GenericPool(IPoolObjectFactory objectFactory)
-
-
Method Detail
-
checkin
public void checkin(java.lang.Object object) throws java.lang.ExceptionDescription copied from interface:IPoolAdd an object to the pool.
-
deactivateObject
protected void deactivateObject(java.lang.Object object) throws java.lang.Exception- Throws:
java.lang.Exception
-
destroyObject
protected void destroyObject(java.lang.Object object) throws java.lang.Exception- Throws:
java.lang.Exception
-
isClosed
protected boolean isClosed()
-
assertOpen
protected void assertOpen()
-
checkout
public java.lang.Object checkout(long timeout) throws java.lang.ExceptionDescription copied from interface:IPoolGet an object from the pool.This may be a reused object or a new one, up to the pool strategy and size.
-
activateObject
protected void activateObject(java.lang.Object object) throws java.lang.Exception- Throws:
java.lang.Exception
-
createObject
protected java.lang.Object createObject() throws java.lang.Exception- Throws:
java.lang.Exception
-
close
public void close() throws java.lang.ExceptionDescription copied from interface:IPoolClose the pool.
-
-