站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 Cache API Documentation 英文版文档

LRUAlgorithm (JBossCache API) - JBoss 4.0.1 sp1 Cache API Documentation 英文版文档


org.jboss.cache.eviction
Class LRUAlgorithm

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

public class LRUAlgorithm
extends Object
implements EvictionAlgorithm

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

Author:
Ben Wang 02-2004

Field Summary
protected  NodeEntry head_
           
protected  org.jboss.logging.Logger log_
           
protected  Map nodeMap_
           
protected  Region region_
           
protected  NodeEntry tail_
           
 
Constructor Summary
LRUAlgorithm()
           
 
Method Summary
protected  void demote(Fqn fqn)
           
protected  void evict(Fqn fqn)
           
 int evictionQueueSize()
           
 void process(Region region)
          No lock is used here since we assume it is single-threaded access by the timer only.
 void resetEvictionQueue(Region 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 org.jboss.logging.Logger log_

nodeMap_

protected Map nodeMap_

head_

protected NodeEntry head_

tail_

protected NodeEntry tail_

region_

protected Region region_
Constructor Detail

LRUAlgorithm

public LRUAlgorithm()
Method Detail

process

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

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

resetEvictionQueue

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

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

demote

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

evict

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

evictionQueueSize

public int evictionQueueSize()


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.