ehcache

net.sf.ehcache.pool.impl
Class UnboundedPool

java.lang.Object
  extended by net.sf.ehcache.pool.impl.UnboundedPool
All Implemented Interfaces:
Pool<PoolableStore>

public class UnboundedPool
extends Object
implements Pool<PoolableStore>

A no-op pool which does not enforce any resource consumption limit.

Author:
Ludovic Orban

Constructor Summary
UnboundedPool()
          Create an UnboundedPool instance
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnboundedPool

public UnboundedPool()
Create an UnboundedPool instance

Method Detail

getSize

public long getSize()
Return the used size of the pool.

Specified by:
getSize in interface Pool<PoolableStore>
Returns:
used size of the pool.

getMaxSize

public long getMaxSize()
Return the maximum size of the pool.

Specified by:
getMaxSize in interface Pool<PoolableStore>
Returns:
the maximum size of the pool.

setMaxSize

public void setMaxSize(long newSize)
Change the maximum size of the pool.

Specified by:
setMaxSize in interface Pool<PoolableStore>
Parameters:
newSize - the new pool size.

createPoolAccessor

public PoolAccessor<PoolableStore> createPoolAccessor(PoolableStore store,
                                                      int maxDepth,
                                                      boolean abortWhenMaxDepthExceeded)
Return a PoolAccessor whose consumption is tracked by this pool, using a default SizeOf engine.

Specified by:
createPoolAccessor in interface Pool<PoolableStore>
Parameters:
store - the store which will use the created accessor.
maxDepth - maximum depth of the object graph to traverse
abortWhenMaxDepthExceeded - 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(PoolableStore store,
                                       SizeOfEngine sizeOfEngine)
Return a PoolAccessor whose consumption is tracked by this pool, using a specific SizeOf engine.

Specified by:
createPoolAccessor in interface Pool<PoolableStore>
Parameters:
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.
Returns:
a PoolAccessor whose consumption is tracked by this pool.

registerPoolAccessor

public void registerPoolAccessor(PoolAccessor<? extends PoolableStore> accessor)
Register an accessor implementation with this pool.

Specified by:
registerPoolAccessor in interface Pool<PoolableStore>
Parameters:
accessor - accessor to be registered

removePoolAccessor

public void removePoolAccessor(PoolAccessor<?> accessor)
Remove the supplied accessor from this pool.

Specified by:
removePoolAccessor in interface Pool<PoolableStore>
Parameters:
accessor - accessor to be removed

getPoolableStores

public Collection<PoolableStore> getPoolableStores()
Return the stores accessing this pool.

Specified by:
getPoolableStores in interface Pool<PoolableStore>
Returns:
stores using this pool

getEvictor

public PoolEvictor<PoolableStore> getEvictor()
Return the pool evictor used by this pool.

Specified by:
getEvictor in interface Pool<PoolableStore>
Returns:
the pool evictor

ehcache

Copyright © 2003-2014 Terracotta, Inc.. All Rights Reserved.