Package com.mongodb.internal.connection
Class ConcurrentPool<T>
java.lang.Object
com.mongodb.internal.connection.ConcurrentPool<T>
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 ClassesModifier and TypeClassDescriptionstatic interface
Deprecated.Usage of this API is not supported in AEM as a Cloud Service.static enum
Deprecated. -
Constructor Summary
ConstructorsConstructorDescriptionConcurrentPool
(int maxSize, ConcurrentPool.ItemFactory<T> itemFactory) Deprecated.Initializes a new pool of objects. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Deprecated.Clears the pool of all objects.void
ensureMinSize
(int minSize, boolean initialize) Deprecated.get()
Deprecated.Gets an object from the pool.Deprecated.Gets an object from the pool - will block if none are availableint
Deprecated.int
getCount()
Deprecated.int
Deprecated.int
Deprecated.void
prune()
Deprecated.void
Deprecated.Return an instance of T to the pool.void
Deprecated.call done when you are done with an object from the pool if there is room and the object is ok will get addedtoString()
Deprecated.
-
Constructor Details
-
ConcurrentPool
Deprecated.Initializes a new pool of objects.- Parameters:
maxSize
- max to hold to at any given time. if invalid input: '<' 0 then no limititemFactory
- factory used to create and close items in the pool
-
-
Method Details
-
release
Deprecated.Return an instance of T to the pool. This method simply callsrelease(t, false)
- Parameters:
t
- item to return to the pool
-
release
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 poolprune
- true if the item should be closed, false if it should be put back in the pool
-
get
Deprecated.Gets an object from the pool. This method will block until a permit is available.- Returns:
- An object from the pool.
-
get
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 waittimeUnit
- 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
Deprecated.
-