public class UnboundedPool extends Object implements Pool<PoolableStore>
Constructor and Description |
---|
UnboundedPool()
Create an UnboundedPool instance
|
Modifier and Type | Method and Description |
---|---|
PoolAccessor<PoolableStore> |
createPoolAccessor(PoolableStore store,
int maxDepth,
boolean abortWhenMaxDepthExceeded)
Return a PoolAccessor whose consumption is tracked by this pool, using a default SizeOf engine.
|
PoolAccessor |
createPoolAccessor(PoolableStore store,
SizeOfEngine sizeOfEngine)
Return a PoolAccessor whose consumption is tracked by this pool, using a specific SizeOf engine.
|
PoolEvictor<PoolableStore> |
getEvictor()
Return the pool evictor used by this pool.
|
long |
getMaxSize()
Return the maximum size of the pool.
|
Collection<PoolableStore> |
getPoolableStores()
Return the stores accessing this pool.
|
long |
getSize()
Return the used size of the pool.
|
void |
registerPoolAccessor(PoolAccessor<? extends PoolableStore> 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 long getSize()
getSize
in interface Pool<PoolableStore>
public long getMaxSize()
getMaxSize
in interface Pool<PoolableStore>
public void setMaxSize(long newSize)
setMaxSize
in interface Pool<PoolableStore>
newSize
- the new pool size.public PoolAccessor<PoolableStore> createPoolAccessor(PoolableStore store, int maxDepth, boolean abortWhenMaxDepthExceeded)
createPoolAccessor
in interface Pool<PoolableStore>
store
- the store 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(PoolableStore store, SizeOfEngine sizeOfEngine)
createPoolAccessor
in interface Pool<PoolableStore>
store
- the store 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<? extends PoolableStore> accessor)
registerPoolAccessor
in interface Pool<PoolableStore>
accessor
- accessor to be registeredpublic void removePoolAccessor(PoolAccessor<?> accessor)
removePoolAccessor
in interface Pool<PoolableStore>
accessor
- accessor to be removedpublic Collection<PoolableStore> getPoolableStores()
getPoolableStores
in interface Pool<PoolableStore>
public PoolEvictor<PoolableStore> getEvictor()
getEvictor
in interface Pool<PoolableStore>
Copyright © 2003-2013 Terracotta, Inc.. All Rights Reserved.