Package org.eclipse.jetty.util
Interface Pool.Entry<E>
- Type Parameters:
E
- the type of the pooled objects
- All Known Implementing Classes:
ConcurrentPool.ConcurrentEntry
,Pool.Entry.Wrapper
public static interface Pool.Entry<E>
A Pool
entry that holds metadata and a pooled object.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
A wrapper forEntry
instances. -
Method Summary
-
Method Details
-
enable
Enables this, previously
reserved
,Entry
.An entry returned from the
Pool.reserve()
method must be enabled with this method, once and only once, before it is usable by the pool.The entry may be enabled and not acquired, in which case it is immediately available to be acquired, potentially by another thread; or it can be enabled and acquired atomically so that no other thread can acquire it, although the acquire may still fail if the pool has been terminated.
- Parameters:
pooled
- the pooled object for thisEntry
acquire
- whether thisEntry
should be atomically enabled and acquired- Returns:
- whether this
Entry
was enabled - Throws:
IllegalStateException
- if thisEntry
was already enabled
-
getPooled
E getPooled()- Returns:
- the pooled object
-
release
boolean release()Releases this
Entry
to thePool
.- Returns:
- whether this
Entry
was released
-
remove
boolean remove()Removes this
Entry
from thePool
.- Returns:
- whether this
Entry
was removed
-
isReserved
boolean isReserved()- Returns:
- whether this
Entry
is reserved - See Also:
-
isIdle
boolean isIdle()- Returns:
- whether this
Entry
is idle in thePool
-
isInUse
boolean isInUse()- Returns:
- whether this
Entry
is in use
-
isTerminated
boolean isTerminated()- Returns:
- whether this
Entry
is terminated
-