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