java.lang.Object
org.sejda.commons.Pool<T>
A simple object pool implementation. It requires a
Supplier used to create instances to pool and when an object is requested but the pool is exhausted.- Author:
- Andrea Vacondio
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Pool
-
-
Method Details
-
borrow
- Returns:
- the instance borrowed from the pool
-
give
Returns the object to the pool- Parameters:
object-
-
onGive
Configure the pool to apply the given consumer to returned objects. This might be useful to restore initial status on returned objects.- Parameters:
applyOnGive-- Returns:
- the pool
-