ObjectPool


ObjectPool defines a simple pooling interface.

  • GenericObjectPool : ObjectPool implementation with configurable LIFO/FIFO behavior. The default behavior is for the pool to act as a LIFO queue. What this means is that when there are idle objects available in the pool, borrowObject returns the most recently returned ("last in") instance. If the lifo the property of the pool false, instances are returned in the oppposite order - first-in, first-out.
  • 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.

KeyedObjectPool


A KeyedObjectPool pools instances of multiple types. Each type may be accessed using an arbitrary key.