public abstract class AbstractPool extends Object implements Pool
This contains all the logic of a pool except for the actual creation of accessor instances.
| Constructor and Description |
|---|
AbstractPool(long maximumPoolSize,
PoolEvictor evictor,
SizeOfEngine defaultSizeOfEngine)
Create an AbstractPool instance
|
| Modifier and Type | Method and Description |
|---|---|
PoolAccessor |
createPoolAccessor(PoolParticipant participant,
int maxDepth,
boolean abortWhenMaxDepthExceeded)
Return a PoolAccessor whose consumption is tracked by this pool, using a default SizeOf engine.
|
PoolEvictor |
getEvictor()
Return the pool evictor used by this pool.
|
long |
getMaxSize()
Return the maximum size of the pool.
|
Collection<PoolAccessor> |
getPoolAccessors()
Return the participants accessing this pool.
|
long |
getSize()
Return the used size of the pool.
|
void |
registerPoolAccessor(PoolAccessor accessor)
Register an accessor implementation with this pool.
|
void |
removePoolAccessor(PoolAccessor accessor)
Remove the supplied accessor from this pool.
|
void |
setMaxSize(long newSize)
Change the maximum size of the pool.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreatePoolAccessorpublic AbstractPool(long maximumPoolSize,
PoolEvictor evictor,
SizeOfEngine defaultSizeOfEngine)
maximumPoolSize - the maximum size of the pool, in bytes.evictor - the pool evictor, for cross-store eviction.defaultSizeOfEngine - the default SizeOf engine used by the accessors.public long getSize()
public long getMaxSize()
getMaxSize in interface Poolpublic void setMaxSize(long newSize)
setMaxSize in interface PoolnewSize - the new pool size.public PoolAccessor createPoolAccessor(PoolParticipant participant, int maxDepth, boolean abortWhenMaxDepthExceeded)
createPoolAccessor in interface Poolparticipant - the participant which will use the created accessor.maxDepth - maximum depth of the object graph to traverseabortWhenMaxDepthExceeded - true if the object traversal should be aborted when the max depth is exceededpublic void registerPoolAccessor(PoolAccessor accessor)
registerPoolAccessor in interface Poolaccessor - accessor to be registeredpublic void removePoolAccessor(PoolAccessor accessor)
removePoolAccessor in interface Poolaccessor - accessor to be removedpublic Collection<PoolAccessor> getPoolAccessors()
getPoolAccessors in interface Poolpublic PoolEvictor getEvictor()
getEvictor in interface PoolCopyright 2001-2021, Terracotta, Inc.