stormpot
Interface LifecycledPool<T extends Poolable>

Type Parameters:
T - The type of Poolable contained in this pool.
All Superinterfaces:
Pool<T>
All Known Subinterfaces:
LifecycledResizablePool<T>
All Known Implementing Classes:
BlazePool, QueuePool

public interface LifecycledPool<T extends Poolable>
extends Pool<T>

A LifecycledPool is a Pool that can be shut down to release any internal resources it might be holding on to.

Note that LifecycledPools are not guaranteed to have overwritten the Object.finalize() method. LifecycledPools are expected to rely on explicit clean-up for releasing their resources.

Author:
Chris Vest <[email protected]>
See Also:
Pool

Method Summary
 Completion shutdown()
          Initiate the shut down process on this pool, and return a Completion instance representing the shut down procedure.
 
Methods inherited from interface stormpot.Pool
claim
 

Method Detail

shutdown

Completion shutdown()
Initiate the shut down process on this pool, and return a Completion instance representing the shut down procedure.

The shut down process is asynchronous, and the shutdown method is guaranteed to not wait for any claimed Poolables to be released.

The shut down process cannot complete before all Poolables are released back into the pool and deallocated, and all internal resources (such as threads, for instance) have been released as well. Only when all of these things have been taken care of, does the await methods of the Completion return.

Once the shut down process has been initiated, that is, as soon as this method is called, the pool can no longer be used and all calls to Pool.claim(Timeout) will throw an IllegalStateException. Threads that are already waiting for objects in the claim method, will also wake up and receive an IllegalStateException.

All objects that are already claimed when this method is called, will continue to function until they are released.

The shut down process is guaranteed to never deallocate objects that are currently claimed. Their deallocation will wait until they are released.

Returns:
A Completion instance that represents the shut down process.


Copyright © 2013. All Rights Reserved.