Class ConcurrentPool<T>


  • @Deprecated(since="2021-05-27")
    public class ConcurrentPool<T>
    extends Object
    Deprecated.
    Usage of this API is not supported in AEM as a Cloud Service.
    A concurrent pool implementation.

    This class should not be considered a part of the public API.

    • Constructor Detail

      • ConcurrentPool

        public ConcurrentPool​(int maxSize,
                              ConcurrentPool.ItemFactory<T> itemFactory)
        Deprecated.
        Initializes a new pool of objects.
        Parameters:
        maxSize - max to hold to at any given time. if < 0 then no limit
        itemFactory - factory used to create and close items in the pool
    • Method Detail

      • release

        public void release​(T t)
        Deprecated.
        Return an instance of T to the pool. This method simply calls release(t, false)
        Parameters:
        t - item to return to the pool
      • release

        public void release​(T t,
                            boolean prune)
        Deprecated.
        call done when you are done with an object from the pool if there is room and the object is ok will get added
        Parameters:
        t - item to return to the pool
        prune - true if the item should be closed, false if it should be put back in the pool
      • get

        public T get()
        Deprecated.
        Gets an object from the pool. This method will block until a permit is available.
        Returns:
        An object from the pool.
      • get

        public T get​(long timeout,
                     TimeUnit timeUnit)
        Deprecated.
        Gets an object from the pool - will block if none are available
        Parameters:
        timeout - negative - forever 0 - return immediately no matter what positive ms to wait
        timeUnit - the time unit of the timeout
        Returns:
        An object from the pool, or null if can't get one in the given waitTime
        Throws:
        MongoTimeoutException - if the timeout has been exceeded
      • prune

        public void prune()
        Deprecated.
      • ensureMinSize

        public void ensureMinSize​(int minSize,
                                  boolean initialize)
        Deprecated.
      • close

        public void close()
        Deprecated.
        Clears the pool of all objects.
      • getMaxSize

        public int getMaxSize()
        Deprecated.
      • getInUseCount

        public int getInUseCount()
        Deprecated.
      • getAvailableCount

        public int getAvailableCount()
        Deprecated.
      • getCount

        public int getCount()
        Deprecated.