|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.intarsys.tools.pool.GenericPool
public class GenericPool
A very simple implementation of a generic IPool
.
Constructor Summary | |
---|---|
GenericPool(IPoolObjectFactory objectFactory)
|
Method Summary | |
---|---|
protected void |
activateObject(java.lang.Object object)
|
protected void |
assertOpen()
|
void |
checkin(java.lang.Object object)
Add an object to the pool. |
java.lang.Object |
checkout(long timeout)
Get an object from the pool. |
void |
close()
Close the pool. |
protected java.lang.Object |
createObject()
|
protected void |
deactivateObject(java.lang.Object object)
|
void |
destroy(java.lang.Object object)
Destroy an object previously allocated from the pool. |
protected void |
destroyObject(java.lang.Object object)
|
protected boolean |
isClosed()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GenericPool(IPoolObjectFactory objectFactory)
Method Detail |
---|
public void checkin(java.lang.Object object) throws java.lang.Exception
IPool
checkin
in interface IPool
object
- The object to be added to the pool.
java.lang.Exception
protected void deactivateObject(java.lang.Object object) throws java.lang.Exception
java.lang.Exception
protected void destroyObject(java.lang.Object object) throws java.lang.Exception
java.lang.Exception
protected boolean isClosed()
protected void assertOpen()
public java.lang.Object checkout(long timeout) throws java.lang.Exception
IPool
This may be a reused object or a new one, up to the pool strategy and size.
checkout
in interface IPool
timeout
- The maximum time to wait for an instance to be available in
milliseconds. -1 will wait indefinitely, 0 will not wait.
java.lang.Exception
protected void activateObject(java.lang.Object object) throws java.lang.Exception
java.lang.Exception
protected java.lang.Object createObject() throws java.lang.Exception
java.lang.Exception
public void close() throws java.lang.Exception
IPool
close
in interface IPool
java.lang.Exception
public void destroy(java.lang.Object object) throws java.lang.Exception
IPool
destroy
in interface IPool
object
- The object to be destroyed.
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |