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 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 null depending 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. Never null.
        Returns:
        ESuccess.SUCCESS upon success