Class ConcurrentPool<T>

java.lang.Object
com.mongodb.internal.connection.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.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    Deprecated.
    Usage of this API is not supported in AEM as a Cloud Service.
    static enum 
    Deprecated.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConcurrentPool(int maxSize, ConcurrentPool.ItemFactory<T> itemFactory)
    Deprecated.
    Initializes a new pool of objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated.
    Clears the pool of all objects.
    void
    ensureMinSize(int minSize, boolean initialize)
    Deprecated.
     
    get()
    Deprecated.
    Gets an object from the pool.
    get(long timeout, TimeUnit timeUnit)
    Deprecated.
    Gets an object from the pool - will block if none are available
    int
    Deprecated.
     
    int
    Deprecated.
     
    int
    Deprecated.
     
    int
    Deprecated.
     
    void
    Deprecated.
     
    void
    Deprecated.
    Return an instance of T to the pool.
    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
    Deprecated.
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • 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 invalid input: '<' 0 then no limit
      itemFactory - factory used to create and close items in the pool
  • Method Details

    • 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.
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object