org.jboss.cache.eviction
Class LRUAlgorithm

java.lang.Object
  extended byorg.jboss.cache.eviction.LRUAlgorithm
All Implemented Interfaces:
EvictionAlgorithm (src)
Direct Known Subclasses:
AopLRUAlgorithm (src) , FIFOAlgorithm (src)

public class LRUAlgorithm
extends java.lang.Object
implements EvictionAlgorithm (src)

Least recently Used algorithm to purge old data. Note that this algorithm is not thread-safe.


Field Summary
protected  NodeEntry (src) head_
           
protected  Logger (src) log_
           
protected  java.util.Map nodeMap_
           
protected  BoundedBuffer recycleQueue_
           
protected  Region (src) region_
           
protected  NodeEntry (src) tail_
           
 
Constructor Summary
LRUAlgorithm()
           
 
Method Summary
protected  void demote(Fqn (src)  fqn)
           
protected  void evict(Fqn (src)  fqn)
           
 int evictionQueueSize()
           
 void process(Region (src)  region)
          No lock is used here since we assume it is single-threaded access by the timer only.
protected  void prune()
           
 void resetEvictionQueue(Region (src)  region)
          Reset the whole eviction queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log_

protected Logger (src)  log_

nodeMap_

protected java.util.Map nodeMap_

head_

protected NodeEntry (src)  head_

tail_

protected NodeEntry (src)  tail_

region_

protected Region (src)  region_

recycleQueue_

protected BoundedBuffer recycleQueue_
Constructor Detail

LRUAlgorithm

public LRUAlgorithm()
Method Detail

process

public void process(Region (src)  region)
             throws EvictionException (src) 
No lock is used here since we assume it is single-threaded access by the timer only.

Specified by:
process in interface EvictionAlgorithm (src)
Parameters:
region -
Throws:
EvictionException (src)

resetEvictionQueue

public void resetEvictionQueue(Region (src)  region)
Description copied from interface: EvictionAlgorithm (src)
Reset the whole eviction queue. Queue may needs to be reset due to corrupted state, for example.

Specified by:
resetEvictionQueue in interface EvictionAlgorithm (src)
Parameters:
region - Region that this algorithm will operate on.

demote

protected void demote(Fqn (src)  fqn)
               throws EvictionException (src) 
Throws:
EvictionException (src)

prune

protected void prune()
              throws EvictionException (src) 
Throws:
EvictionException (src)

evict

protected void evict(Fqn (src)  fqn)
              throws EvictionException (src) 
Throws:
EvictionException (src)

evictionQueueSize

public int evictionQueueSize()