Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.cache.eviction
Class LRUAlgorithm

    java.lang.Object
      org.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()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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