Package com.helger.base.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
Modifier and TypeMethodDescription@Nullable DATATYPEBorrow an object from the pool.@NonNull ESuccessreturnObject(@NonNull DATATYPE aItem) Return a previously borrowed object back to the pool.
-
Method Details
-
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
Return a previously borrowed object back to the pool.- Parameters:
aItem- The previously borrowed object to be returned. Nevernull.- Returns:
ESuccess.SUCCESSupon success
-