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.AtomicInteger
state
-
Constructor Summary
Constructors Modifier Constructor Description private
MonoEntry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isClosed()
boolean
isIdle()
boolean
isInUse()
boolean
isReserved()
java.lang.String
toString()
(package private) boolean
tryAcquire()
Tries to acquire this Entry.protected boolean
tryEnable(boolean acquire)
Tries to enable, and possible also acquire, this Entry.(package private) boolean
tryRelease()
Tries to release this Entry.(package private) boolean
tryRemove()
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.Entry
Tries to enable, and possible also acquire, this Entry.
- Specified by:
tryEnable
in classPool.Entry
- Parameters:
acquire
- whether to also acquire this Entry- Returns:
- whether this Entry was enabled
-
tryAcquire
boolean tryAcquire()
Description copied from class:Pool.Entry
Tries to acquire this Entry.
- Specified by:
tryAcquire
in classPool.Entry
- Returns:
- whether this Entry was acquired
-
tryRelease
boolean tryRelease()
Description copied from class:Pool.Entry
Tries to release this Entry.
- Specified by:
tryRelease
in 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.Entry
Tries to remove the entry by marking it as closed.
- Specified by:
tryRemove
in classPool.Entry
- Returns:
- whether the entry can be removed from the containing pool
-
isClosed
public boolean isClosed()
- Specified by:
isClosed
in classPool.Entry
- Returns:
- whether this Entry is closed
-
isReserved
public boolean isReserved()
- Specified by:
isReserved
in classPool.Entry
- Returns:
- whether this Entry is reserved
-
isIdle
public boolean isIdle()
- Specified by:
isIdle
in classPool.Entry
- Returns:
- whether this Entry is idle
-
isInUse
public boolean isInUse()
- Specified by:
isInUse
in classPool.Entry
- Returns:
- whether this entry is in use.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-