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.

  • Class
    Description
    Allocator<T extends Poolable>
    An Allocator is responsible for the creation and destruction of Poolable objects.
    A basic implementation of the Poolable interface, 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.
    Pool<T extends Poolable>
    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 a Pool must implement the Poolable interface and adhere to its contract.
    The PoolBuilder collects 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 the PoolBuilder.build() method.
    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 to allocate a new object, but the allocation fails by returning null or throwing an exception. Likewise if the Reallocator.reallocate(Slot, Poolable) method return null or throw an exception. If the Slot.release(Poolable) method is misused, and the pool is able to detect this. If the expiration check throws an exception.
    PoolTap<T extends Poolable>
    A PoolTap provides the API for accessing objects in a Pool.
    Reallocators are a special kind of Allocator that can reallocate Poolables that have expired.
    A Slot represents a location in a Pool where objects can be allocated into, so that they can be claimed and released.
    SlotInfo<T extends Poolable>
    An informative interface, used by Expiration instances 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.