public abstract class AbstractMapBasedCacheRegion extends Object implements CacheRegion
| Modifier and Type | Field and Description |
|---|---|
protected Map<CacheKey,Object> |
cacheMap |
protected String[] |
handledTypes |
protected CacheLifecycleCallback |
lifecycleCallback |
protected String |
name |
protected CacheStatistics |
stats |
protected boolean |
statsEnabled |
| Constructor and Description |
|---|
AbstractMapBasedCacheRegion(String name,
boolean statsEnabled) |
AbstractMapBasedCacheRegion(String name,
CacheStatistics stats,
boolean statsEnabled) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearCache()
Removes all elements from cache.
|
boolean |
containsKey(CacheKey key)
Checks if key is in the cache map.
|
boolean |
equals(Object obj) |
Object |
get(CacheKey key)
Gets value from the cache.
|
Collection<CacheKey> |
getAllKeys()
Returns all keys currently stored in this region.
|
CacheStatistics |
getCacheRegionStatistics()
Gets statistics for current region.
|
String[] |
getHandledTypes()
Gets types which can be stored in the region.
|
long |
getMaxReachedSize()
Returns number of elements currently in the cache
|
String |
getName()
Gets region name.
|
Object |
getWithLoader(CacheKey key,
CacheValueLoader loader)
Gets value from cache.
|
int |
hashCode() |
Object |
invalidate(CacheKey key,
boolean fireEventsEvenIfNotRemoved)
Invalidates (removes) value from cache map.
|
boolean |
isStatsEnabled() |
protected abstract Object |
putIfAbsent(CacheKey key,
Object value) |
void |
registerLifecycleCallback(CacheLifecycleCallback callback)
This callback shall be called when eviction occurs.
|
Object |
remove(CacheKey key,
boolean fireEvents)
Removes value stored on the key specified.
|
void |
setHandledTypes(String[] handledTypes) |
void |
setStatsEnabled(boolean enabled) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetCacheMaxEntriesprotected String[] handledTypes
protected CacheLifecycleCallback lifecycleCallback
protected final String name
protected final CacheStatistics stats
protected volatile boolean statsEnabled
public AbstractMapBasedCacheRegion(String name, boolean statsEnabled)
public AbstractMapBasedCacheRegion(String name, CacheStatistics stats, boolean statsEnabled)
public void setHandledTypes(String[] handledTypes)
public Object getWithLoader(CacheKey key, CacheValueLoader loader) throws CacheValueLoadException
CacheRegiongetWithLoader in interface CacheRegionCacheValueLoadExceptionpublic Object get(CacheKey key)
CacheRegionget in interface CacheRegionpublic Object invalidate(CacheKey key, boolean fireEventsEvenIfNotRemoved)
CacheRegioninvalidate in interface CacheRegionpublic String getName()
CacheRegiongetName in interface CacheRegionpublic String[] getHandledTypes()
CacheRegionRegionType.getHandledTypes in interface CacheRegionpublic CacheStatistics getCacheRegionStatistics()
CacheRegiongetCacheRegionStatistics in interface CacheRegionpublic void clearCache()
CacheRegionclearCache in interface CacheRegionpublic void registerLifecycleCallback(CacheLifecycleCallback callback)
CacheRegionregisterLifecycleCallback in interface CacheRegionpublic long getMaxReachedSize()
CacheRegiongetMaxReachedSize in interface CacheRegionpublic Collection<CacheKey> getAllKeys()
CacheRegiongetAllKeys in interface CacheRegionpublic Object remove(CacheKey key, boolean fireEvents)
CacheRegionremove in interface CacheRegionpublic boolean containsKey(CacheKey key)
CacheRegioncontainsKey in interface CacheRegionpublic void setStatsEnabled(boolean enabled)
setStatsEnabled in interface CacheRegionpublic boolean isStatsEnabled()
isStatsEnabled in interface CacheRegionCopyright © 2017 SAP SE. All Rights Reserved.