|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.farrago.util.FarragoLruVictimPolicy
public class FarragoLruVictimPolicy
FarragoLruVictimPolicy implements an LRU caching policy for the FarragoObjectCache.
This class assumes that synchronization is handled by its caller.
Field Summary | |
---|---|
private LinkedHashSet<FarragoCacheEntry> |
lruCacheOrder
LRU ordering of objects in the cache. |
Constructor Summary | |
---|---|
FarragoLruVictimPolicy()
|
Method Summary | |
---|---|
void |
accessEntry(FarragoCacheEntry entry)
Receives notification that an existing entry in the cache is being accessed. |
void |
clearCache()
Receives notification that all entries are being removed from the cache |
Iterator<FarragoCacheEntry> |
getVictimIterator()
Returns an iterator corresponding to a list of potential entries for removal from the cache, in the order of precedence. |
FarragoCacheEntry |
newEntry(FarragoObjectCache parentCache)
Creates a new cache entry |
void |
registerEntry(FarragoCacheEntry entry)
Receives notification that a new entry is being added to the cache. |
void |
unregisterEntry(FarragoCacheEntry entry)
Receives notification that an entry is being removed from the cache. |
void |
unregisterEntry(Iterator victimRange)
Unregisters the current entry being accessed from the victim range |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final LinkedHashSet<FarragoCacheEntry> lruCacheOrder
Constructor Detail |
---|
public FarragoLruVictimPolicy()
Method Detail |
---|
public FarragoCacheEntry newEntry(FarragoObjectCache parentCache)
FarragoCacheVictimPolicy
newEntry
in interface FarragoCacheVictimPolicy
parentCache
- the cache this entry is associated withpublic void registerEntry(FarragoCacheEntry entry)
FarragoCacheVictimPolicy
registerEntry
in interface FarragoCacheVictimPolicy
entry
- new entry being added to the cachepublic void unregisterEntry(Iterator victimRange)
FarragoCacheVictimPolicy
unregisterEntry
in interface FarragoCacheVictimPolicy
victimRange
- iterator corresponding to the victim rangepublic void unregisterEntry(FarragoCacheEntry entry)
FarragoCacheVictimPolicy
unregisterEntry
in interface FarragoCacheVictimPolicy
entry
- entry to be removedpublic void accessEntry(FarragoCacheEntry entry)
FarragoCacheVictimPolicy
accessEntry
in interface FarragoCacheVictimPolicy
entry
- entry being accessedpublic Iterator<FarragoCacheEntry> getVictimIterator()
FarragoCacheVictimPolicy
getVictimIterator
in interface FarragoCacheVictimPolicy
public void clearCache()
FarragoCacheVictimPolicy
clearCache
in interface FarragoCacheVictimPolicy
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |