Package net.sf.ehcache.pool.impl
Class UnboundedPool
- java.lang.Object
-
- net.sf.ehcache.pool.impl.UnboundedPool
-
-
Field Summary
Fields Modifier and Type Field Description static PoolAccessor<PoolParticipant>UNBOUNDED_ACCESSORAn accessor that just is unbounded
-
Constructor Summary
Constructors Constructor Description UnboundedPool()Create an UnboundedPool instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PoolAccessorcreatePoolAccessor(PoolParticipant participant, int maxDepth, boolean abortWhenMaxDepthExceeded)Return a PoolAccessor whose consumption is tracked by this pool, using a default SizeOf engine.PoolAccessorcreatePoolAccessor(PoolParticipant participant, SizeOfEngine sizeOfEngine)Return a PoolAccessor whose consumption is tracked by this pool, using a specific SizeOf engine.PoolEvictorgetEvictor()Return the pool evictor used by this pool.longgetMaxSize()Return the maximum size of the pool.java.util.Collection<PoolAccessor>getPoolAccessors()Return the participants accessing this pool.longgetSize()Return the used size of the pool.voidregisterPoolAccessor(PoolAccessor accessor)Register an accessor implementation with this pool.voidremovePoolAccessor(PoolAccessor accessor)Remove the supplied accessor from this pool.voidsetMaxSize(long newSize)Change the maximum size of the pool.
-
-
-
Field Detail
-
UNBOUNDED_ACCESSOR
public static final PoolAccessor<PoolParticipant> UNBOUNDED_ACCESSOR
An accessor that just is unbounded
-
-
Method Detail
-
getSize
public long getSize()
Return the used size of the pool.
-
getMaxSize
public long getMaxSize()
Return the maximum size of the pool.- Specified by:
getMaxSizein interfacePool- Returns:
- the maximum size of the pool.
-
setMaxSize
public void setMaxSize(long newSize)
Change the maximum size of the pool.- Specified by:
setMaxSizein interfacePool- Parameters:
newSize- the new pool size.
-
createPoolAccessor
public PoolAccessor createPoolAccessor(PoolParticipant participant, int maxDepth, boolean abortWhenMaxDepthExceeded)
Return a PoolAccessor whose consumption is tracked by this pool, using a default SizeOf engine.- Specified by:
createPoolAccessorin interfacePool- Parameters:
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 exceeded- Returns:
- a PoolAccessor whose consumption is tracked by this pool.
-
createPoolAccessor
public PoolAccessor createPoolAccessor(PoolParticipant participant, SizeOfEngine sizeOfEngine)
Return a PoolAccessor whose consumption is tracked by this pool, using a specific SizeOf engine.- Specified by:
createPoolAccessorin interfacePool- Parameters:
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.- Returns:
- a PoolAccessor whose consumption is tracked by this pool.
-
registerPoolAccessor
public void registerPoolAccessor(PoolAccessor accessor)
Register an accessor implementation with this pool.- Specified by:
registerPoolAccessorin interfacePool- Parameters:
accessor- accessor to be registered
-
removePoolAccessor
public void removePoolAccessor(PoolAccessor accessor)
Remove the supplied accessor from this pool.- Specified by:
removePoolAccessorin interfacePool- Parameters:
accessor- accessor to be removed
-
getPoolAccessors
public java.util.Collection<PoolAccessor> getPoolAccessors()
Return the participants accessing this pool.- Specified by:
getPoolAccessorsin interfacePool- Returns:
- participants using this pool
-
getEvictor
public PoolEvictor getEvictor()
Return the pool evictor used by this pool.- Specified by:
getEvictorin interfacePool- Returns:
- the pool evictor
-
-