All Packages Class Hierarchy This Package Previous Next Index
Class key.LatentCache
java.lang.Object
|
+----key.Atom
|
+----key.AnimatedAtom
|
+----key.Daemon
|
+----key.LatentCache
- public final class LatentCache
- extends Daemon
The LatentCache is the final memory cache that is outside the
CachedAtom mechanism of locks. It is used to 'transparently'
cache things that can be easily rebuilt from the available
information on demand.
This class is used, for instance, by a ShortcutCollection. As a
ShortcutCollection stores redundant information - all those Trie's
and Hashtables are irrelevant and often unrequired, when it creates
the Trie and Hashtable, it also add's itself to this latentcache.
Every 5 minutes the latent cache checks back with the linkedtrie to
see if the trie or hashtable has been used within those five minutes.
If it has not been used at any time within those 5 minutes, the
LatentlyCached atom is called to deallocate itself as it sees fit.
This class provides an efficient mechanism for this behaviour
-
LatentCache()
-
-
addToCache(LatentlyCached)
-
-
loadFrom(DataInput)
-
-
removeFromCache(LatentlyCached)
-
-
run()
-
-
stop()
-
-
writeTo(DataOutput)
-
LatentCache
public LatentCache()
removeFromCache
public synchronized void removeFromCache(LatentlyCached lc)
addToCache
public synchronized void addToCache(LatentlyCached lc)
stop
public synchronized void stop()
- Overrides:
- stop in class AnimatedAtom
run
public void run()
- Overrides:
- run in class AnimatedAtom
loadFrom
public synchronized void loadFrom(DataInput from) throws IOException
- Overrides:
- loadFrom in class Atom
writeTo
public synchronized void writeTo(DataOutput to) throws IOException
- Overrides:
- writeTo in class Atom
All Packages Class Hierarchy This Package Previous Next Index