public class DefaultCacheRegion extends java.lang.Object implements CacheRegion
| Modifier and Type | Field and Description |
|---|---|
protected CacheMap |
cacheMap |
protected boolean |
exclusiveComputation |
protected java.lang.String[] |
handledTypes |
protected CacheLifecycleCallback |
lifecycleCallback |
protected java.lang.String |
name |
protected java.util.concurrent.locks.ReentrantReadWriteLock |
sharedLock |
protected CacheStatistics |
stats |
protected boolean |
statsEnabled |
| Constructor and Description |
|---|
DefaultCacheRegion(java.lang.String name) |
DefaultCacheRegion(java.lang.String name,
boolean exclusiveComputation,
boolean statsEnabled) |
DefaultCacheRegion(java.lang.String name,
CacheMap cacheMap,
CacheStatistics stats,
java.lang.String[] handledTypes) |
DefaultCacheRegion(java.lang.String name,
CacheMap cacheMap,
CacheStatistics stats,
java.lang.String[] handledTypes,
boolean exclusiveComputation,
boolean statsEnabled) |
DefaultCacheRegion(java.lang.String name,
CacheMap cacheMap,
java.lang.String[] handledTypes) |
DefaultCacheRegion(java.lang.String name,
int maxEntries) |
DefaultCacheRegion(java.lang.String name,
int maxEntries,
boolean exclusiveComputation,
boolean statsEnabled) |
DefaultCacheRegion(java.lang.String name,
int maxEntries,
boolean exclusiveComputation,
java.lang.String evictionPolicy,
boolean statsEnabled)
Deprecated.
since 1811
|
| 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.
|
CacheMap |
getCacheMap() |
long |
getCacheMaxEntries()
Gets number of cache entries above which invalidation occurs.
|
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() |
void |
init() |
java.lang.Object |
invalidate(CacheKey key,
boolean fireEventsEvenIfNotRemoved)
Invalidates (removes) value from cache map.
|
boolean |
isStatsEnabled() |
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 |
setCacheMap(CacheMap cacheMap) |
void |
setHandledTypes(java.lang.String[] handledTypes) |
void |
setStatsEnabled(boolean enabled) |
java.lang.String |
toString() |
protected CacheMap cacheMap
protected java.lang.String[] handledTypes
protected CacheLifecycleCallback lifecycleCallback
protected final java.lang.String name
protected final CacheStatistics stats
protected final java.util.concurrent.locks.ReentrantReadWriteLock sharedLock
protected volatile boolean statsEnabled
protected final boolean exclusiveComputation
public DefaultCacheRegion(java.lang.String name)
public DefaultCacheRegion(java.lang.String name,
CacheMap cacheMap,
java.lang.String[] handledTypes)
public DefaultCacheRegion(java.lang.String name,
boolean exclusiveComputation,
boolean statsEnabled)
public DefaultCacheRegion(java.lang.String name,
CacheMap cacheMap,
CacheStatistics stats,
java.lang.String[] handledTypes)
public DefaultCacheRegion(java.lang.String name,
CacheMap cacheMap,
CacheStatistics stats,
java.lang.String[] handledTypes,
boolean exclusiveComputation,
boolean statsEnabled)
public DefaultCacheRegion(java.lang.String name,
int maxEntries,
boolean exclusiveComputation,
boolean statsEnabled)
@Deprecated
public DefaultCacheRegion(java.lang.String name,
int maxEntries,
boolean exclusiveComputation,
java.lang.String evictionPolicy,
boolean statsEnabled)
evictionPolicy - public DefaultCacheRegion(java.lang.String name,
int maxEntries)
@PostConstruct public void init()
public java.lang.Object get(CacheKey key)
CacheRegionget in interface CacheRegionpublic long getMaxReachedSize()
CacheRegiongetMaxReachedSize in interface CacheRegionpublic java.lang.Object getWithLoader(CacheKey key, CacheValueLoader loader) throws CacheValueLoadException
CacheRegiongetWithLoader in interface CacheRegionCacheValueLoadExceptionpublic 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 void setHandledTypes(java.lang.String[] handledTypes)
public CacheMap getCacheMap()
public void setCacheMap(CacheMap cacheMap)
cacheMap - the cacheMap to setpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic CacheStatistics getCacheRegionStatistics()
CacheRegiongetCacheRegionStatistics in interface CacheRegionpublic long getCacheMaxEntries()
CacheRegiongetCacheMaxEntries in interface CacheRegionpublic void clearCache()
CacheRegionclearCache in interface CacheRegionpublic void registerLifecycleCallback(CacheLifecycleCallback callback)
CacheRegionregisterLifecycleCallback in interface CacheRegionpublic java.lang.String toString()
toString in class java.lang.Objectpublic 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 CacheRegionCopyright © 2018 SAP SE. All Rights Reserved.