|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.portlet.forums.helper.AbstractPool
public abstract class AbstractPool
A simple object pool designed for extensibility. There is no resizer thread so far.
Constructor Summary | |
---|---|
protected |
AbstractPool()
|
Method Summary | |
---|---|
protected void |
_acquire(java.lang.Object instance)
The method does nothing bu default, called when the client release an instance. |
protected abstract java.lang.Object |
_create()
Called when the pool need a new instance. |
protected void |
_destroy(java.lang.Object instance)
The method does nothing bu default, called when the client release an instance. |
protected void |
_release(java.lang.Object instance)
The method does nothing bu default, called when the client release an instance. |
java.lang.Object |
acquire()
Returns an object instance. |
protected void |
initialize(int maxSize,
int initialSize)
Initialize the pool. |
void |
release(java.lang.Object instance)
Release an object and pools it if the pool is not full, otherwise discard it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractPool()
Method Detail |
---|
public java.lang.Object acquire()
public void release(java.lang.Object instance)
instance
- the released instance.protected void initialize(int maxSize, int initialSize)
maxSize
- the max size of object in the poolinitialSize
- the initial size. A negative value is
considered as zero, a value greater than maxSize is
considered as maxSize.protected void _destroy(java.lang.Object instance)
protected void _acquire(java.lang.Object instance)
protected void _release(java.lang.Object instance)
protected abstract java.lang.Object _create()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |