ehcache

net.sf.ehcache.pool.impl
Class FromLargestCacheOnDiskPoolEvictor

java.lang.Object
  extended by net.sf.ehcache.pool.impl.AbstractFromLargestCachePoolEvictor
      extended by net.sf.ehcache.pool.impl.FromLargestCacheOnDiskPoolEvictor
All Implemented Interfaces:
PoolEvictor<PoolableStore>

public class FromLargestCacheOnDiskPoolEvictor
extends AbstractFromLargestCachePoolEvictor

Pool evictor which always evicts from the store consuming the most disk resources.

Author:
Ludovic Orban

Constructor Summary
FromLargestCacheOnDiskPoolEvictor()
           
 
Method Summary
protected  boolean evict(int count, long bytes, PoolableStore largestPoolableStore)
          Evict from a store for a chosen resource
protected  long getSizeInBytes(PoolableStore largestPoolableStore)
          Get a store size in bytes for a chosen resource
 
Methods inherited from class net.sf.ehcache.pool.impl.AbstractFromLargestCachePoolEvictor
freeSpace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FromLargestCacheOnDiskPoolEvictor

public FromLargestCacheOnDiskPoolEvictor()
Method Detail

evict

protected boolean evict(int count,
                        long bytes,
                        PoolableStore largestPoolableStore)
Evict from a store for a chosen resource

Specified by:
evict in class AbstractFromLargestCachePoolEvictor
Parameters:
count - the element count
bytes - the bytes count
largestPoolableStore - the store
Returns:
true if eviction succeeded, ie: if there was enough evictable resource held by the store

getSizeInBytes

protected long getSizeInBytes(PoolableStore largestPoolableStore)
Get a store size in bytes for a chosen resource

Specified by:
getSizeInBytes in class AbstractFromLargestCachePoolEvictor
Parameters:
largestPoolableStore - the store
Returns:
the size in bytes

ehcache

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