Interface Pool<T>

  • Type Parameters:
    T - the pooled type
    All Known Implementing Classes:
    BasicPool, SynchronizedPool

    public interface Pool<T>
    Pool provides an interface for managing a pool of object instances.
    • Method Detail

      • acquire

        T acquire()
        Acquires an instance from the pool. This returns null if the pool is empty.
        Returns:
        an instance from the pool, or null if the pool is empty
      • release

        void release​(T instance)
        Releases an instance to the pool. This has no effect if the instance is null.
        Parameters:
        instance - the instance to release