|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.xdms.utils.ObjectPool
public class ObjectPool
A general purpose object pool.
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT
|
protected java.lang.Object |
lock
An object used for synchronization * |
protected int |
maxSize
Maximum size of the pool * |
protected int |
minSize
Minimum size of the pool * |
protected ObjectFactory |
objectFactory
The ObjectFactory used to create and destroy objects * |
protected java.util.Stack<java.lang.Object> |
pool
A stack for pooling the objects * |
Constructor Summary | |
---|---|
protected |
ObjectPool()
Empty constructor used for subclassing. |
|
ObjectPool(ObjectFactory objectFactory)
Constructs a default ObjectPool. |
|
ObjectPool(ObjectFactory objectFactory,
int minSize,
int maxSize)
Constructs an ObjectPool with the specified number of minimum and maximum objects. |
Method Summary | |
---|---|
void |
checkin(java.lang.Object o)
Checkin an object back into the pool. |
java.lang.Object |
checkout()
Checkout an object from the pool. |
protected void |
init(ObjectFactory objectFactory,
int minSize,
int maxSize)
Initializes an ObjectPool with the specified number of minimum and maximum objects. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
protected java.lang.Object lock
protected int minSize
protected int maxSize
protected java.util.Stack<java.lang.Object> pool
protected ObjectFactory objectFactory
Constructor Detail |
---|
protected ObjectPool()
public ObjectPool(ObjectFactory objectFactory)
objectFactory
- The ObjectFactory used to create or destroy objects.public ObjectPool(ObjectFactory objectFactory, int minSize, int maxSize)
objectFactory
- The ObjectFactory used to create or destroy objects.minSize
- The minimum number of objects that are kept in the pool.maxSize
- The maximum number of objects that are kept in the pool.Method Detail |
---|
protected void init(ObjectFactory objectFactory, int minSize, int maxSize)
objectFactory
- The ObjectFactory used to create or destroy objects.minSize
- The minimum number of objects that are kept in the pool.maxSize
- The maximum number of objects that are kept in the pool.public java.lang.Object checkout()
public void checkin(java.lang.Object o)
o
- An object to check back into the pool.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |