|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.engine.util.Pool<T>
T
- public abstract class Pool<T>
Generic object pool.
Constructor Summary | |
---|---|
Pool()
Default constructor. |
|
Pool(int initialSize)
Constructor. |
Method Summary | |
---|---|
void |
checkin(T object)
Checks in an object into the pool. |
T |
checkout()
Checks out an object from the pool. |
void |
clear()
Clears the store of reusable objects. |
protected void |
clear(T object)
Clears the given object when it is checked in the pool. |
protected abstract T |
createObject()
Creates a new reusable object. |
protected Queue<T> |
createStore()
Creates the store of reusable objects. |
protected Queue<T> |
getStore()
Returns the store containing the reusable objects. |
void |
preCreate(int initialSize)
Pre-creates the initial objects using the createObject() method
and check them in the pool using the checkin(Object) method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Pool()
public Pool(int initialSize)
preCreate(int)
method.
initialSize
- The initial number of objects in the pool.Method Detail |
---|
public void checkin(T object)
object
- The object to check in.public T checkout()
public void clear()
protected void clear(T object)
object
- The object to clear.protected abstract T createObject()
protected Queue<T> createStore()
protected Queue<T> getStore()
public void preCreate(int initialSize)
createObject()
method
and check them in the pool using the checkin(Object)
method.
initialSize
- The initial number of objects.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |