Package com.illumon.util.pool
Class ThreadSafeFixedSizePool<T>
java.lang.Object
com.illumon.util.pool.ThreadSafeFixedSizePool<T>
- All Implemented Interfaces:
com.fishlib.base.pool.Pool<T>
,PoolEx<T>
public class ThreadSafeFixedSizePool<T> extends Object implements PoolEx<T>
A pool that
- holds at least
size
items, - creates
size
items in the pool immediately, - blocks (busily) whenever the pool overflows or underflows,
- optionally clears the items given to it, and
- IS thread-safe
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.fishlib.base.pool.Pool
com.fishlib.base.pool.Pool.Factory, com.fishlib.base.pool.Pool.MultiGiver<T extends Object>, com.fishlib.base.pool.Pool.MultiPool<T extends Object>, com.fishlib.base.pool.Pool.MultiTaker<T extends Object>, com.fishlib.base.pool.Pool.SinglePool<T extends Object>
-
Field Summary
Fields Modifier and Type Field Description static int
MIN_SIZE
protected LockFreeArrayQueue<T>
pool
-
Constructor Summary
Constructors Constructor Description ThreadSafeFixedSizePool(int size, com.fishlib.base.Function.Nullary<T> factory, com.fishlib.base.Procedure.Unary<T> clearingProcedure)
-
Method Summary
-
Field Details
-
MIN_SIZE
public static final int MIN_SIZE- See Also:
- Constant Field Values
-
pool
-
-
Constructor Details
-
Method Details