public class DefaultMountContentPool extends RecyclePool implements MountContentPool
MountContentPool
used for mount content unless your MountSpec
implements @OnCreateMountContentPool.Constructor and Description |
---|
DefaultMountContentPool(String name,
int maxSize,
boolean sync) |
Modifier and Type | Method and Description |
---|---|
Object |
acquire() |
Object |
acquire(Context c,
ComponentLifecycle lifecycle)
Return a recycled mount content, or a newly acquired mount content if there isn't one to
recycle.
|
void |
maybePreallocateContent(Context c,
ComponentLifecycle lifecycle)
Pre-allocates one item for the given ComponentLifecycle if the preallocation count is less than
the pool size, otherwise does nothing.
|
clear, getCurrentSize, getMaxSize, getName, isFull, release
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
release
getCurrentSize, getMaxSize, getName
public DefaultMountContentPool(String name, int maxSize, boolean sync)
public Object acquire(Context c, ComponentLifecycle lifecycle)
MountContentPool
NB: This can be called from multiple threads, possibly at the same time!
acquire
in interface MountContentPool
public final Object acquire()
acquire
in class RecyclePool
public void maybePreallocateContent(Context c, ComponentLifecycle lifecycle)
maybePreallocateContent
in interface MountContentPool