|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.util.SoftCache
A cache that stores items using normal Java references while the item is active (i.e. it is being retrieved frequently). When the item has not been retrieved for the specified interval, the hard reference is cleared, but a SoftReference is retained. If the object is retrieved while it's in the soft cache, then it's moved back to the hard cache. This cache is intended for large items that are expensive to recompute.
Field Summary | |
java.util.Map |
_evictionDates
Holds Dates when items in _hardCache should be moved to _softCache |
java.util.Map |
_hardCache
Hard references to items that have been retrieved recently. |
long |
_msBeforeEviction
Milliseconds of idleness before moving an item from _hardCache to _softCache. |
java.util.Map |
_softCache
SoftReferences to items that haven't been referenced in at least _msBeforeEviction milliseconds. |
static java.lang.String |
code_id
|
Constructor Summary | |
SoftCache(long msBeforeEviction)
|
Method Summary | |
java.lang.Object |
get(java.lang.Object key)
|
void |
put(java.lang.Object key,
java.lang.Object value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
public final java.util.Map _hardCache
public final java.util.Map _softCache
public final java.util.Map _evictionDates
public long _msBeforeEviction
Constructor Detail |
public SoftCache(long msBeforeEviction)
Method Detail |
public java.lang.Object get(java.lang.Object key)
public void put(java.lang.Object key, java.lang.Object value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |