public abstract static class RecyclerPool.BoundedPoolBase<P extends RecyclerPool.WithPool<P>> extends RecyclerPool.StatefulImplBase<P>
RecyclerPool
implementation that uses
a bounded queue (ArrayBlockingQueue
for recycling instances.
This is "bounded" pool since it will never hold on to more
pooled instances than its size configuration:
the default size is DEFAULT_CAPACITY
.RecyclerPool.BoundedPoolBase<P extends RecyclerPool.WithPool<P>>, RecyclerPool.ConcurrentDequePoolBase<P extends RecyclerPool.WithPool<P>>, RecyclerPool.LockFreePoolBase<P extends RecyclerPool.WithPool<P>>, RecyclerPool.NonRecyclingPoolBase<P extends RecyclerPool.WithPool<P>>, RecyclerPool.StatefulImplBase<P extends RecyclerPool.WithPool<P>>, RecyclerPool.ThreadLocalPoolBase<P extends RecyclerPool.WithPool<P>>, RecyclerPool.WithPool<P extends RecyclerPool.WithPool<P>>
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CAPACITY
Default capacity which limits number of items that are ever
retained for reuse.
|
_serialization, SERIALIZATION_NON_SHARED, SERIALIZATION_SHARED
Modifier | Constructor and Description |
---|---|
protected |
BoundedPoolBase(int capacityAsId) |
Modifier and Type | Method and Description |
---|---|
P |
acquirePooled()
Method for sub-classes to implement for actual acquire logic; called
by
RecyclerPool.acquireAndLinkPooled() . |
int |
capacity() |
void |
releasePooled(P pooled)
Method that should be called when previously acquired (see
RecyclerPool.acquireAndLinkPooled() )
pooled value that is no longer needed; this lets pool to take ownership
for possible reuse. |
_resolveToShared, createPooled
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
acquireAndLinkPooled
public static final int DEFAULT_CAPACITY
public P acquirePooled()
RecyclerPool
RecyclerPool.acquireAndLinkPooled()
.public void releasePooled(P pooled)
RecyclerPool
RecyclerPool.acquireAndLinkPooled()
)
pooled value that is no longer needed; this lets pool to take ownership
for possible reuse.pooled
- Pooled instance to release back to poolpublic int capacity()
Copyright © 2008–2023 FasterXML. All rights reserved.