E - pooled objects typepublic final class ThreadLocalObjectPool<E extends AutoCloseable> extends Object
ThreadLocal.
If object is borrowed on one thread and recycled on different then it will be returned to recycling thread bag. For thread-safe use either pooled objects should be thread-safe or happens-before should be established between borrowing object and subsequent recycling.
| Modifier and Type | Class and Description |
|---|---|
static class |
ThreadLocalObjectPool.Reusable<T extends AutoCloseable>
Wrapper for a pooled object with capability to return the object to a pool.
|
| Constructor and Description |
|---|
ThreadLocalObjectPool(Supplier<E> objectFactory,
int poolSize) |
| Modifier and Type | Method and Description |
|---|---|
ThreadLocalObjectPool.Reusable<E> |
borrow()
Picks an object from the pool if one is present or creates new one otherwise.
|
public ThreadLocalObjectPool.Reusable<E> borrow()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2-p3 Release Date : April 25 2019