org.codehaus.wadi.core.eviction
Class AbstractBestEffortEvicter

java.lang.Object
  extended by org.codehaus.wadi.core.eviction.AbstractEvicter
      extended by org.codehaus.wadi.core.eviction.AbstractBestEffortEvicter
All Implemented Interfaces:
Evicter
Direct Known Subclasses:
AbsoluteEvicter, AlwaysEvicter, TimeToLiveEvicter

public abstract class AbstractBestEffortEvicter
extends AbstractEvicter

Version:
$Revision: 2375 $
Author:
Jules Gosnell

Field Summary
protected  org.apache.commons.logging.Log log
           
protected  boolean strictOrdering
           
 
Constructor Summary
AbstractBestEffortEvicter(int sweepInterval, boolean strictOrdering)
           
 
Method Summary
protected  void demote(Motable[] toDemote, EvictionStrategy evictionStrategy)
           
 void evict(ConcurrentMotableMap idToEvictable, EvictionStrategy evictionStrategy)
           
protected  void expire(Motable[] toExpire, EvictionStrategy evictionStrategy)
           
protected  java.util.Comparator getComparator(long time)
           
protected  void identifyDemotionsAndExpirations(ConcurrentMotableMap idToEvictable, java.util.List toExpire, java.util.List toDemote)
           
protected  boolean isReadyToDemote(Motable motable, long time)
           
protected  boolean isReadyToExpire(Motable motable, long time)
           
protected  void sortCandidates(Motable[] toExpire, Motable[] toDemote)
           
 
Methods inherited from class org.codehaus.wadi.core.eviction.AbstractEvicter
cancel, schedule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.codehaus.wadi.core.eviction.Evicter
testForDemotion
 

Field Detail

log

protected final org.apache.commons.logging.Log log

strictOrdering

protected final boolean strictOrdering
Constructor Detail

AbstractBestEffortEvicter

public AbstractBestEffortEvicter(int sweepInterval,
                                 boolean strictOrdering)
Method Detail

evict

public void evict(ConcurrentMotableMap idToEvictable,
                  EvictionStrategy evictionStrategy)

identifyDemotionsAndExpirations

protected void identifyDemotionsAndExpirations(ConcurrentMotableMap idToEvictable,
                                               java.util.List toExpire,
                                               java.util.List toDemote)

isReadyToExpire

protected boolean isReadyToExpire(Motable motable,
                                  long time)

isReadyToDemote

protected boolean isReadyToDemote(Motable motable,
                                  long time)

sortCandidates

protected void sortCandidates(Motable[] toExpire,
                              Motable[] toDemote)

demote

protected void demote(Motable[] toDemote,
                      EvictionStrategy evictionStrategy)

expire

protected void expire(Motable[] toExpire,
                      EvictionStrategy evictionStrategy)

getComparator

protected java.util.Comparator getComparator(long time)


Copyright © 2011. All Rights Reserved.