Package io.undertow.util
Class SimpleObjectPool<T>
- java.lang.Object
-
- io.undertow.util.SimpleObjectPool<T>
-
- All Implemented Interfaces:
ObjectPool
public class SimpleObjectPool<T> extends java.lang.Object implements ObjectPool
Simple pool that attempts to maintain a specified number of objects in the pool. If more objects are created new ones are created on the fly, and then destroyed once the pool is full.- Author:
- ckozak, Stuart Douglas
-
-
Constructor Summary
Constructors Constructor Description SimpleObjectPool(int poolSize, java.util.function.Supplier<T> supplier, java.util.function.Consumer<T> consumer)
SimpleObjectPool(int poolSize, java.util.function.Supplier<T> supplier, java.util.function.Consumer<T> recycler, java.util.function.Consumer<T> consumer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PooledObject<T>
allocate()
-
-
-
Method Detail
-
allocate
public PooledObject<T> allocate()
- Specified by:
allocate
in interfaceObjectPool<T>
-
-