|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.xml.security.utils.WeakObjectPool<T,E>
public abstract class WeakObjectPool<T,E extends Throwable>
Abstract base class for pooling objects. The two public methods are
getObject() and (#repool(). Objects are held through
weak references so even objects that are not repooled are subject to garbage collection.
Subclasses must implement the abstract createObject().
Internally, the pool is stored in a java.util.concurrent.LinkedBlockingDeque instance.
| Constructor Summary | |
|---|---|
protected |
WeakObjectPool()
The lone constructor. |
| Method Summary | |
|---|---|
protected abstract T |
createObject()
Called whenever a new pool object is desired; subclasses must implement. |
T |
getObject()
Subclasses can subclass to return a more specific type. |
boolean |
repool(T obj)
Adds the given object to the pool, provided that the object was created by this pool. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected WeakObjectPool()
| Method Detail |
|---|
protected abstract T createObject()
throws E extends Throwable
parameterizable - Throwable's subclass
E extends Throwable
public T getObject()
throws E extends Throwable
E
E extends Throwablepublic boolean repool(T obj)
obj - the object to return to the pool
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||