Interface Pool<T>

  • Type Parameters:
    T - type
    All Known Implementing Classes:
    Pool.Impl

    public interface Pool<T>
    Pool of reusable objects that are indistinguishable from each other, such as JAXB marshallers.
    Author:
    Kohsuke Kawaguchi
    • Method Detail

      • take

        @NotNull
        T take()
        Gets a new object from the pool.

        If no object is available in the pool, this method creates a new one.

        Returns:
        an object from the pool
      • recycle

        void recycle​(@NotNull
                     T t)
        Returns an object back to the pool.
        Parameters:
        t - object to put back to pool