org.objectweb.perseus.cache.replacement.api
Interface ReplacementManager
- UnbindManager
- AbstractReplacementManager, FIFOReplacementManager, LRUReplacementManager, MRUReplacementManager
public interface ReplacementManager
It defines the commun methods associated to ReplacementManager
implementations. Every Cache must have a ReplacementManager.
The role of a ReplacementManager is to chose a set of objects to be
evicted from the cache, whenever cache space is needed (e.g. to
store a recently arrived object). Typical implementations for
ReplacementManagers include LRU, MRU, FIFO based.
- Luciano Garcia-Banuelos (Luciano.Garcia@imag.fr)
adjustForReplacement
public void adjustForReplacement(FixableCacheEntry entry)
throws CacheException
Called whenever an object has been accessed. Thus, this method,
gives hints about recency/frequency of use. This hints are used
within the replacement algorithm.
entry
- The cache entry that has been accessed.
CacheException
- Whenever an internal error occurs.
forceFree
public int forceFree(int capacity)
throws CacheException
It forces the replacement manager to free CacheEntry instances from the
cahce.
capacity
- is the quantity of space required by the cache.
removeForReplacement
public void removeForReplacement(Object oid)
This method is called by the CacheManager in order to signal that an
entry has been really evicted. In fact the eviction has been previously
requested by the ReplacementManager, and now the GC garbaged an entry.
oid
- is the evicted cache entry
Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.