Interface IObjectPoolFactory<DATATYPE>

  • Type Parameters:
    DATATYPE - the type of results supplied by this factory

    public interface IObjectPoolFactory<DATATYPE>
    An extended factory for objects in the ObjectPool.
    Since:
    11.1.0
    Author:
    Philip Helger
    • Method Detail

      • create

        @Nonnull
        DATATYPE create()
        Create a new object for usage in the pool. This method is called if no object is in the pool, or if activation of a pooled object failed.
        Returns:
        A new object of data type. Never null.
      • passivate

        void passivate​(@Nonnull
                       DATATYPE aItem)
        Called when an object is returned to the pool. This method has no return value - only activate(Object) can change the path.
        Parameters:
        aItem - The item to be returned. Never null.