public static class CachingBOLoaderLRUStrategy.ClassLimitedLRUContainer extends java.lang.Object implements java.util.Iterator, CachingBOLoaderGCStrategyI
| Modifier and Type | Field and Description |
|---|---|
java.util.concurrent.atomic.AtomicInteger |
cacheHit |
java.util.concurrent.atomic.AtomicInteger |
cacheMiss |
| Constructor and Description |
|---|
ClassLimitedLRUContainer(CachingBOLoader _boLoader,
java.lang.Class[] limitToClasses,
int[] _maxKeeps) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Resets the caching strategy, e.g. because all cached objects have been dropped
|
CachingBOLoaderGCStrategyI |
getStrategyFor(CachingBOLoader _boLoader,
java.lang.Class[] limitToClasses,
int[] maxKeepsPerClass) |
boolean |
hasNext() |
boolean |
isRelevant(BO bo) |
java.util.Iterator |
iterator()
Resets the current iterator and returs this.
|
BO |
next() |
void |
put(java.lang.Long k,
BO v) |
void |
putAll(java.util.Map<java.lang.Long,BO> m)
Called by the CachingBOLoader after new BOs have been inserted into the Cache,
to allow the Strategy to add relevant root BOs to its internal structure.
|
void |
remove() |
void |
rescheduleGC(int interval)
Starts or stops a daemon, that clears the cache every interval seconds, but keeps a maximum number
of instances of objects of types keepClasses specified in maxKeeps.
|
void |
resetIterator() |
void |
setGCInterval(int interval) |
void |
stopAutoGC()
Stops the daemon thread that automatically runs, if any.
|
void |
updateLRU(java.lang.Object k) |
void |
updateOnCacheHit(BO bo)
Called after a get or frap got a cache hit and did not need to put a new BO inside the cache.
|
void |
updateWriteAccess(BO bo)
Updates the caching strategy with a new 'written'/'added'/'coerced' time after a possibly existing BO
would've been put into the cache again if it weren't already there yet.
|
public java.util.concurrent.atomic.AtomicInteger cacheHit
public java.util.concurrent.atomic.AtomicInteger cacheMiss
public ClassLimitedLRUContainer(CachingBOLoader _boLoader, java.lang.Class[] limitToClasses, int[] _maxKeeps)
public CachingBOLoaderGCStrategyI getStrategyFor(CachingBOLoader _boLoader, java.lang.Class[] limitToClasses, int[] maxKeepsPerClass)
public void clear()
CachingBOLoaderGCStrategyIclear in interface CachingBOLoaderGCStrategyIpublic boolean isRelevant(BO bo)
public void putAll(java.util.Map<java.lang.Long,BO> m)
CachingBOLoaderGCStrategyIputAll in interface CachingBOLoaderGCStrategyIm - the map of BOs that were just now added into the local cache, nonnull.public void updateWriteAccess(BO bo)
CachingBOLoaderGCStrategyIupdateWriteAccess in interface CachingBOLoaderGCStrategyIpublic void updateLRU(java.lang.Object k)
public void put(java.lang.Long k,
BO v)
put in interface CachingBOLoaderGCStrategyIpublic void updateOnCacheHit(BO bo)
CachingBOLoaderGCStrategyIupdateOnCacheHit in interface CachingBOLoaderGCStrategyIpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterable<BO>public void resetIterator()
public void rescheduleGC(int interval)
rescheduleGC in interface CachingBOLoaderGCStrategyIpublic void setGCInterval(int interval)
public void stopAutoGC()
stopAutoGC in interface CachingBOLoaderGCStrategyIpublic boolean hasNext()
hasNext in interface java.util.Iteratorpublic BO next()
next in interface java.util.Iteratorpublic void remove()
remove in interface java.util.IteratorCopyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.