Module stormpot
Package stormpot
package stormpot
Stormpot
Stormpot is a generic, thread-safe and fast object pooling library.
The object pools themselves implement the Pool interface.
The things you actually want to pool must all implement the
Poolable interface, and you must also provide an
implementation of the Allocator interface as a factory to
create your pooled objects.
See the online Usage Guide for a tutorial.
-
ClassDescriptionAn Allocator is responsible for the creation and destruction of
Poolableobjects.A basic implementation of thePoolableinterface, which can be extended directly.A Completion represents some task that is going to be completed at some point in the future, or maybe already has completed.Expiration<T extends Poolable>The expiration is used to determine if a given slot has expired, or otherwise become invalid.This is the JMX management interface for Stormpot object pools.A MetricsRecorder implementation supplies the pool with the ability to record and report operational metrics.A Pool is a self-renewable set of objects from which one can claim exclusive access to elements, until they are released back into the pool.Objects contained in aPoolmust implement the Poolable interface and adhere to its contract.PoolBuilder<T extends Poolable>ThePoolBuildercollects information about how big a pool should be, and how it should allocate objects, and so on, and finally acts as the factory for building the pool instances themselves, with thePoolBuilder.build()method.Pooled<T>A reference to a pooled object.The PoolException may be thrown by a pool implementation in a number of circumstances: If claim is called and the pool needs toallocatea new object, but the allocation fails by returningnullor throwing an exception. Likewise if theReallocator.reallocate(Slot, Poolable)method returnnullor throw an exception. If theSlot.release(Poolable)method is misused, and the pool is able to detect this. If theexpiration checkthrows an exception.A PoolTap provides the API for accessing objects in aPool.Reallocator<T extends Poolable>A Slot represents a location in a Pool where objects can be allocated into, so that they can be claimed and released.An informative interface, used byExpirationinstances to determine if a slot has expired or is still invalid for claiming.A Timeout represents the maximum amount of time a caller is willing to wait for a blocking operation to complete.