ehcache

net.sf.ehcache.store
Class LruMemoryStore

java.lang.Object
  extended by net.sf.ehcache.store.MemoryStore
      extended by net.sf.ehcache.store.LruMemoryStore
All Implemented Interfaces:
Store

public class LruMemoryStore
extends MemoryStore

An implementation of a LruMemoryStore.

This uses LinkedHashMap as its backing map. It uses the LinkedHashMap LRU feature. LRU for this implementation means least recently accessed.

Version:
$Id: LruMemoryStore.java 519 2007-07-27 07:11:45Z gregluck $
Author:
Greg Luck

Nested Class Summary
 class LruMemoryStore.SpoolingLinkedHashMap
          An extension of LinkedHashMap which overrides LruMemoryStore.SpoolingLinkedHashMap.removeEldestEntry(java.util.Map.Entry) to persist cache entries to the auxiliary cache before they are removed.
 class LruMemoryStore.SpoolingLRUMap
          An LRU Map implementation based on Apache Commons LRUMap.
 
Field Summary
 
Fields inherited from class net.sf.ehcache.store.MemoryStore
cache, diskStore, map, status
 
Constructor Summary
LruMemoryStore(Ehcache cache, Store diskStore)
          Constructor for the LruMemoryStore object The backing LinkedHashMap is created with LRU by access order.
 
Method Summary
 
Methods inherited from class net.sf.ehcache.store.MemoryStore
backedUp, clear, containsKey, create, dispose, doPut, evict, expireElements, flush, get, getBackingMap, getKeyArray, getQuiet, getSize, getSizeInBytes, getStatus, isFull, notifyExpiry, put, remove, removeAll, spoolAllToDisk, spoolToDisk
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LruMemoryStore

public LruMemoryStore(Ehcache cache,
                      Store diskStore)
Constructor for the LruMemoryStore object The backing LinkedHashMap is created with LRU by access order.


ehcache