public class ConcurrentPool<E> extends Object
| Constructor and Description |
|---|
ConcurrentPool(int maxPoolSize)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
E |
borrow()
Retrieves element from pool, or returns
null if the pool is empty. |
void |
clear()
Removes all the elements from the pool on stop.
|
void |
forEach(Consumer<? super E> action)
Performs the given action for each element of the pool until all elements have been processed or the action
throws an exception.
|
boolean |
recycle(E e)
Pushes an element onto the pool.
|
Stream<E> |
stream()
Returns a sequential
Stream of the pool. |
public ConcurrentPool(int maxPoolSize)
maxPoolSize - Max pool size.public boolean recycle(E e)
e - the element to pushtrue if the element is returned to the pool, false if the is no space at the pool.NullPointerException - if the specified element is null and this deque does not permit null elementspublic E borrow()
null if the pool is empty.null if the pool is empty.public void forEach(Consumer<? super E> action)
action - The action to be performed for each elementNullPointerException - if the specified action is nullpublic Stream<E> stream()
Stream of the pool.Stream over the elements iof the pool.public void clear()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 8.9.30 Release Date : February 17 2026