Modifier and Type | Field and Description |
---|---|
static PoolAccessor<PoolParticipant> |
UNBOUNDED_ACCESSOR
An accessor that just is unbounded
|
Constructor and Description |
---|
UnboundedPool()
Create an UnboundedPool 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.
|
PoolAccessor |
createPoolAccessor(PoolParticipant participant,
SizeOfEngine sizeOfEngine)
Return a PoolAccessor whose consumption is tracked by this pool, using a specific 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.
|
public static final PoolAccessor<PoolParticipant> UNBOUNDED_ACCESSOR
public long getSize()
public long getMaxSize()
getMaxSize
in interface Pool
public void setMaxSize(long newSize)
setMaxSize
in interface Pool
newSize
- the new pool size.public PoolAccessor createPoolAccessor(PoolParticipant participant, int maxDepth, boolean abortWhenMaxDepthExceeded)
createPoolAccessor
in interface Pool
participant
- 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 PoolAccessor createPoolAccessor(PoolParticipant participant, SizeOfEngine sizeOfEngine)
createPoolAccessor
in interface Pool
participant
- the participant which will use the created accessor.sizeOfEngine
- the SizeOf engine used to measure the size of objects added through the created accessor.public void registerPoolAccessor(PoolAccessor accessor)
registerPoolAccessor
in interface Pool
accessor
- accessor to be registeredpublic void removePoolAccessor(PoolAccessor accessor)
removePoolAccessor
in interface Pool
accessor
- accessor to be removedpublic Collection<PoolAccessor> getPoolAccessors()
getPoolAccessors
in interface Pool
public PoolEvictor getEvictor()
getEvictor
in interface Pool
Copyright © 2003–2016 Terracotta, Inc.. All rights reserved.