|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- The type of Poolable
contained in this pool.public interface LifecycledPool<T extends Poolable>
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.
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 |
---|
Completion shutdown()
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.
Completion
instance that represents the shut down
process.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |