org.objectweb.perseus.cache.replacement.lib
Class AbstractReplacementManager
java.lang.Object
org.objectweb.perseus.cache.replacement.lib.AbstractReplacementManager
- BindingController, CacheCapacityEventListener, ReplacementManager, UnbindManager
public abstract class AbstractReplacementManager
extends java.lang.Object
This class is a common implementation of a ReplacementManager.
- E.Bruneton
LRUReplacementManager, MRUReplacementManager
UNBIND_MANAGER_BINDING
public static final String UNBIND_MANAGER_BINDING
entries
protected SortedSet entries
Sorted list of WeakReplaceableCacheEntry entries. Each entry must have a
unique age, so that this sorted set behaves as a sorted list.
logger
protected Logger logger
oid2wentry
protected HashMap oid2wentry
queue
protected ReferenceQueue queue
Queue used to register the weak references stored in the entries list.
AbstractReplacementManager
public AbstractReplacementManager()
bindFc
public void bindFc(String s,
Object o)
forceFree
public int forceFree(int capacity)
throws CacheException
It forces the replacement manager to free CacheEntry instances from the
cahce.
- forceFree in interface ReplacementManager
capacity
- is the quantity of space required by the cache.
listFc
public String[] listFc()
lookupFc
public Object lookupFc(String s)
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.
- removeForReplacement in interface ReplacementManager
oid
- is the evicted cache entry
unbind
public boolean unbind(Object oid,
boolean force)
throws CacheException
It forces the replacement manager to unbind a CacheEntry instance from
the cache.
- unbind in interface UnbindManager
unbindAll
public Collection unbindAll(Collection _oids,
boolean force)
throws CacheException
Evicts instances from the cache.
- unbindAll in interface UnbindManager
force
- is a boolean value indicating if the cache must remove the
entries or let the GC does its job.
- the oid of the really evicted entries
CacheException
- is raised when entries are already unbound from
the cache.
unbindFc
public void unbindFc(String s)
unbindUnfixed
public Collection unbindUnfixed(boolean force)
throws CacheException
Try to evict unfixed instances.
- unbindUnfixed in interface UnbindManager
force
- is a boolean value indicating if the cache must remove the
entries or let the GC does its job.
- the number of entry really evicted
CacheException
-
Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.