java.lang.Object | |
↳ | com.mongodb.util.SimplePool<T> |
Known Direct Subclasses |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
_availSafe | |||||||||||
_debug | |||||||||||
_maxToKeep | |||||||||||
_maxTotal | |||||||||||
_mbeanInfo | |||||||||||
_name | |||||||||||
_trackLeaks |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
See full constructor docs
| |||||||||||
Initializes a new pool of objects.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
override this if you need to do any cleanup
| |||||||||||
call done when you are done with an object form the pool
if there is room and the object is ok will get added
| |||||||||||
Gets an object from the pool - will block if none are available
| |||||||||||
Gets an object from the pool - will block if none are available
| |||||||||||
callback to determine if an object is ok to be added back to the pool or used
will be called when something is put back into the queue and when it comes out
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Clears the pool of all objects.
| |||||||||||
Creates a new object of this pool's type.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
javax.management.DynamicMBean
|
Initializes a new pool of objects.
name | name for the pool |
---|---|
maxToKeep | max to hold to at any given time. if < 0 then no limit |
maxTotal | max to have allocated at any point. if there are no more, get() will block |
trackLeaks | if leaks should be tracked |
override this if you need to do any cleanup
call done when you are done with an object form the pool if there is room and the object is ok will get added
t | Object to add |
---|
Gets an object from the pool - will block if none are available
waitTime | negative - forever 0 - return immediately no matter what positive ms to wait |
---|
Gets an object from the pool - will block if none are available
callback to determine if an object is ok to be added back to the pool or used will be called when something is put back into the queue and when it comes out
Clears the pool of all objects.
Creates a new object of this pool's type.