Class Pool.MultiEntry
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) intbooleanisClosed()booleanisIdle()(package private) booleanbooleanisInUse()booleanboolean(package private) voidsetUsageCount(int usageCount) toString()(package private) booleanTries to acquire the entry if possible by incrementing both the usage count and the multiplex count.protected booleantryEnable(boolean acquire) Tries to enable, and possible also acquire, this Entry.(package private) booleanTries to release the entry if possible by decrementing the multiplex count unless the entity is closed.(package private) booleanTries to remove the entry by marking it as closed and decrementing the multiplex counter.Methods inherited from class Pool.Entry
enable, getPooled, release, remove
-
Field Details
-
state
-
-
Constructor Details
-
MultiEntry
MultiEntry()
-
-
Method Details
-
setUsageCount
void setUsageCount(int usageCount) - Overrides:
setUsageCountin classPool<T>.Entry
-
tryEnable
protected boolean tryEnable(boolean acquire) Description copied from class:Pool.EntryTries to enable, and possible also acquire, this Entry.
-
tryAcquire
boolean tryAcquire()Tries to acquire the entry if possible by incrementing both the usage count and the multiplex count.
- Specified by:
tryAcquirein classPool<T>.Entry- Returns:
- true if the usage count is less than
Pool.getMaxUsageCount()and the multiplex count is less thanPool.getMaxMultiplex(Object)and the entry is not closed, false otherwise.
-
tryRelease
boolean tryRelease()Tries to release the entry if possible by decrementing the multiplex count unless the entity is closed.
- Specified by:
tryReleasein classPool<T>.Entry- Returns:
- true if the entry was released,
false if
tryRemove()should be called.
-
tryRemove
boolean tryRemove()Tries to remove the entry by marking it as closed and decrementing the multiplex counter.
The multiplex counter will never go below zero and if it reaches zero, the entry is considered removed.
-
isClosed
-
isReserved
public boolean isReserved()- Specified by:
isReservedin classPool<T>.Entry- Returns:
- whether this Entry is reserved
-
isIdle
-
isInUse
-
isOverUsed
public boolean isOverUsed()- Overrides:
isOverUsedin classPool<T>.Entry- Returns:
- whether this entry has been used beyond
Pool.getMaxUsageCount()
-
isIdleAndOverUsed
boolean isIdleAndOverUsed()- Overrides:
isIdleAndOverUsedin classPool<T>.Entry
-
getUsageCount
int getUsageCount()- Overrides:
getUsageCountin classPool<T>.Entry
-
toString
-