public interface BasePool extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
void |
close()
A synonym for
terminate(). |
int |
createdTotal()
Returns the total number of created objects which currently exist for this object pool.
|
int |
drainCreated()
Tries to remove (and destroy) as many created objects from this object pool as possible.
|
int |
initialSize()
Returns the
initialSize of this object pool at construction time. |
boolean |
isTerminated()
Returns the current terminated state of this object pool.
|
int |
maxSize()
Returns the
maxSize of this object pool. |
int |
reduceCreatedBy(int reduceBy,
boolean ignoreInitialSize)
Tries to remove (and destroy) up to
reduceBy objects from the object pool. |
int |
reduceCreatedTo(int reduceTo,
boolean ignoreInitialSize)
Tries to remove (and destroy) such number of objects from the object pool that the number of
createdTotal() objects in the pool to become equal of reduceTo. |
int |
remainingCapacity()
Returns the remaining capacity of this object pool, i.e.
|
int |
remainingCreated()
Returns the number of remaining created objects which are currently available in this object pool.
|
int |
taken()
Returns the number of objects taken from this object pool.
|
void |
terminate()
Terminates this object pool.
|
int taken()
createdTotal().
Typically used for testing and debugging purposes.int remainingCreated()
remainingCapacity().
Typically used for testing and debugging purposes.int createdTotal()
taken() + remainingCreated().
Typically used for testing and debugging purposes.int remainingCapacity()
remainingCreated().
Typically used for testing and debugging purposes.int initialSize()
initialSize of this object pool at construction time.
This parameter never changes.initialSizeint maxSize()
maxSize of this object pool. This parameter never changes.maxSizeint reduceCreatedBy(int reduceBy,
boolean ignoreInitialSize)
reduceBy objects from the object pool. This method may
bring the object pool createdTotal() to a number less then its initialSize().reduceBy - the desired amount of objects to be removedignoreInitialSize - specifies whether the createdTotal() may be
reduced to less than initialSize()int reduceCreatedTo(int reduceTo,
boolean ignoreInitialSize)
createdTotal() objects in the pool to become equal of reduceTo. This method may bring
the object pool createdTotal() to a number smaller than its initialSize().reduceTo - the desired amount of created objects to remain in the poolignoreInitialSize - specifies whether the createdTotal() may be
reduced to less than initialSize()int drainCreated()
createdTotal() to a number less then its initialSize().void terminate()
boolean isTerminated()
true if the object pool is terminated; false otherwisevoid close()
terminate(). Overrides the AutoCloseable's method in order to overrule
the throwing of a checked Exception.close in interface AutoCloseableCopyright © 2013-2019 vibur.org. All Rights Reserved.