There are 3 implementations of ObjectPools and 2 of KeyedObjectPools.
http://jakarta.apache.org/commons/pool/guide/index.html

- GenericObjectPool: ObjectPool implementation with a FIFO (First In First Out) behavior. This queue like behavior makes sure each object is regularly used. (helps preventing time-outs)
- StackObjectPool: ObjectPool implementation with a LIFO (Last In First Out) behavior.
- SoftReferenceObjectPool: ObjectPool implementation with a LIFO (Last In First Out) behavior. Additionally this pool wraps each object in a SoftReference allowing the garbage collector to remove them in response to memory demand.


A keyed pool pools instances of multiple types. Each type may be accessed using an arbitrary key.
- GenericKeyedObjectPool: ObjectPool implementation with a FIFO (First In First Out) behavior.
- StackKeyedObjectPool: ObjectPool implementation with a LIFO (Last In First Out) behavior.


The generic pools are used in the DBCP component and therefor more tested/optimized but all implementations have a different behaviour so there are no other real benefits.

Best wishes,
Dirk


Harshad Oak wrote:


Hello,

The Commons Pool component provides a number of pool implementations. I was wondering what benefits each implementation offers. Would be great if anyone can shed some light on the pros and cons of using StackObjectPool , SoftReferenceObjectPool, StackKeyedObjectPool and GenericObjectPool.

Hope everyone on the list has a wonderful new year 2004.

thanks,
harshad




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to