Package org.eclipse.jetty.util
Class Pool.MonoEntry
- java.lang.Object
-
- org.eclipse.jetty.util.Pool.Entry
-
- org.eclipse.jetty.util.Pool.MonoEntry
-
private class Pool.MonoEntry extends Pool.Entry
A Pool entry that holds metadata and a pooled object, that can only be acquired concurrently at most once, and can be acquired/released multiple times.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicIntegerstate
-
Constructor Summary
Constructors Modifier Constructor Description privateMonoEntry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisClosed()booleanisIdle()booleanisInUse()booleanisReserved()java.lang.StringtoString()(package private) booleantryAcquire()Tries to acquire this Entry.protected booleantryEnable(boolean acquire)Tries to enable, and possible also acquire, this Entry.(package private) booleantryRelease()Tries to release this Entry.(package private) booleantryRemove()Tries to remove the entry by marking it as closed.-
Methods inherited from class org.eclipse.jetty.util.Pool.Entry
enable, getPooled, getUsageCount, isIdleAndOverUsed, isOverUsed, release, remove, setUsageCount
-
-
-
-
Method Detail
-
tryEnable
protected boolean tryEnable(boolean acquire)
Description copied from class:Pool.EntryTries to enable, and possible also acquire, this Entry.
- Specified by:
tryEnablein classPool.Entry- Parameters:
acquire- whether to also acquire this Entry- Returns:
- whether this Entry was enabled
-
tryAcquire
boolean tryAcquire()
Description copied from class:Pool.EntryTries to acquire this Entry.
- Specified by:
tryAcquirein classPool.Entry- Returns:
- whether this Entry was acquired
-
tryRelease
boolean tryRelease()
Description copied from class:Pool.EntryTries to release this Entry.
- Specified by:
tryReleasein classPool.Entry- Returns:
- true if this Entry was released,
false if
Pool.Entry.tryRemove()should be called.
-
tryRemove
boolean tryRemove()
Description copied from class:Pool.EntryTries to remove the entry by marking it as closed.
- Specified by:
tryRemovein classPool.Entry- Returns:
- whether the entry can be removed from the containing pool
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin classPool.Entry- Returns:
- whether this Entry is closed
-
isReserved
public boolean isReserved()
- Specified by:
isReservedin classPool.Entry- Returns:
- whether this Entry is reserved
-
isIdle
public boolean isIdle()
- Specified by:
isIdlein classPool.Entry- Returns:
- whether this Entry is idle
-
isInUse
public boolean isInUse()
- Specified by:
isInUsein classPool.Entry- Returns:
- whether this entry is in use.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-