KEYTYPE - Cache key typeVALUETYPE - Cache value type@ThreadSafe public abstract class AbstractNotifyingCache<KEYTYPE,VALUETYPE> extends AbstractCache<KEYTYPE,VALUETYPE>
m_aCacheAccessStats, m_aRWLock, STATISTICS_PREFIX| Constructor and Description |
|---|
AbstractNotifyingCache(int nMaxSize,
String sCacheName) |
AbstractNotifyingCache(String sCacheName) |
| Modifier and Type | Method and Description |
|---|---|
VALUETYPE |
getFromCache(KEYTYPE aKey)
Get the cached value associated with the passed key.
|
protected abstract VALUETYPE |
getValueToCache(KEYTYPE aKey)
This abstract method is invoked, once a new value needs to be put into the
cache.
|
clearCache, createCache, getFromCacheNoStats, getFromCacheNoStatsNotLocked, getFromCacheNotLocked, getMaxSize, getName, getSize, hasMaxSize, isEmpty, isNotEmpty, putInCache, putInCacheNotLocked, removeFromCache, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComparatorCollating, getComparatorNamepublic AbstractNotifyingCache(@CheckForSigned int nMaxSize, @Nonnull String sCacheName)
@Nonnull @IsLocked(value=WRITE) protected abstract VALUETYPE getValueToCache(KEYTYPE aKey)
aKey - The key for which the value to cache is required. May be
nullable or not - depends upon the implementation.null.public final VALUETYPE getFromCache(KEYTYPE aKey)
ICachegetFromCache in interface ICache<KEYTYPE,VALUETYPE>getFromCache in class AbstractCache<KEYTYPE,VALUETYPE>aKey - The key to be looked up. May be nullable or not -
depends upon the implementation.null if no such value is in the cache.Copyright © 2014–2016 Philip Helger. All rights reserved.