Package com.helger.commons.pool
Interface IMutableObjectPool<DATATYPE>
-
- Type Parameters:
DATATYPE- The type of object to be pooled.
- All Known Implementing Classes:
ObjectPool
public interface IMutableObjectPool<DATATYPE>Simple pool interface.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DATATYPEborrowObject()Borrow an object from the pool.ESuccessreturnObject(DATATYPE aItem)Return a previously borrowed object back to the pool.
-
-
-
Method Detail
-
borrowObject
@Nullable DATATYPE borrowObject()
Borrow an object from the pool. This method blocks until an object is available.- Returns:
- The borrowed object. May be
nulldepending on the factory, and the locking used.
-
returnObject
@Nonnull ESuccess returnObject(@Nonnull DATATYPE aItem)
Return a previously borrowed object back to the pool.- Parameters:
aItem- The previously borrowed object to be returned. Nevernull.- Returns:
ESuccess.SUCCESSupon success
-
-