public class DefaultCacheController extends java.lang.Object implements CacheController
| Constructor and Description |
|---|
DefaultCacheController(CacheConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
void |
addLifecycleCallback(CacheLifecycleCallback callback)
registers a lifecycle callback.
|
void |
clearCache(CacheRegion region)
Clears cache
|
protected void |
executeOnAfterAddCallbacks(CacheKey key,
java.lang.Object value,
CacheRegion region) |
protected void |
executeOnAfterRemoveCallbacks(CacheKey key,
java.lang.Object value,
CacheRegion region) |
protected void |
executeOnEvictionCallbacks(CacheKey key,
java.lang.Object value,
CacheRegion region) |
protected void |
executeOnMissLoadCallbacks(CacheKey key,
java.lang.Object value,
CacheRegion region) |
<T> T |
get(CacheKey key)
Gets value stored in the cache.
|
java.util.List<InvalidationFilter> |
getFilters() |
int |
getLifecycleCallbackCnt()
For testing only
|
java.util.List<CacheRegion> |
getRegions()
Returns all regions used in this controller.
|
CacheRegionResolver[] |
getResolvers() |
<T> T |
getWithLoader(CacheKey key,
CacheValueLoader<T> loader)
Gets stored value from cache.
|
void |
init()
Reads configuration and creates registry for cache regions required
|
void |
invalidate(CacheKey key)
Performs key invalidation from cache.
|
void |
registerTenant(java.lang.String tenantId)
Deprecated.
since 5.0
|
void |
remove(CacheKey key)
Legacy method implemented just to implement lazy computing in AbstractCacheUnit
|
void |
removeLifecycleCallback(CacheLifecycleCallback callback)
Removes a registered lifecycle callback.
|
CacheRegion |
resolveCacheRegionForAdd(CacheKey key)
Method used to resolve cache region.
|
java.util.Collection<CacheRegion> |
resolveQueryRegionsForInvalidation(CacheKey key)
returns all regions handling queries.
|
java.util.List<CacheRegion> |
resolveRegionsForInvalidation(CacheKey key)
Returns cache regions for invalidation.
|
void |
setCacheRegionProvider(CacheRegionProvider cacheRegionProvider)
Spring initialization
|
void |
setGenerationalCacheDelegate(GenerationalCacheDelegate generationalCacheDelegate) |
void |
setRegionRegistryAllocationStrategy(RegionRegistryAllocationStrategy regionRegistryAllocationStrategy)
Deprecated.
since 5.0
|
void |
setStatsEnabled(boolean enabled)
Allows to enable or disable collecting of statistics for all regions in one step.
|
CacheController |
unwrap()
Deprecated.
since 5.0
|
public DefaultCacheController(CacheConfiguration configuration)
@PostConstruct public void init()
public void invalidate(CacheKey key)
invalidate in interface CacheControllerpublic void remove(CacheKey key)
remove in interface CacheControllerpublic <T> T getWithLoader(CacheKey key, CacheValueLoader<T> loader) throws CacheValueLoadException
getWithLoader in interface CacheControllerCacheRegionNotSpecifiedExceptionCacheValueLoadExceptionpublic <T> T get(CacheKey key)
CacheControllerget in interface CacheControllerpublic java.util.Collection<CacheRegion> resolveQueryRegionsForInvalidation(CacheKey key)
public java.util.List<CacheRegion> resolveRegionsForInvalidation(CacheKey key)
public CacheRegion resolveCacheRegionForAdd(CacheKey key) throws CacheRegionNotSpecifiedException
CacheRegionNotSpecifiedExceptionpublic CacheRegionResolver[] getResolvers()
public java.util.List<InvalidationFilter> getFilters()
public java.util.List<CacheRegion> getRegions()
CacheControllergetRegions in interface CacheControllerpublic void clearCache(CacheRegion region)
clearCache in interface CacheControllerpublic void addLifecycleCallback(CacheLifecycleCallback callback)
CacheControlleraddLifecycleCallback in interface CacheControllerpublic void removeLifecycleCallback(CacheLifecycleCallback callback)
CacheControllerremoveLifecycleCallback in interface CacheControllerpublic int getLifecycleCallbackCnt()
protected void executeOnAfterAddCallbacks(CacheKey key, java.lang.Object value, CacheRegion region)
protected void executeOnAfterRemoveCallbacks(CacheKey key, java.lang.Object value, CacheRegion region)
protected void executeOnEvictionCallbacks(CacheKey key, java.lang.Object value, CacheRegion region)
protected void executeOnMissLoadCallbacks(CacheKey key, java.lang.Object value, CacheRegion region)
public void setStatsEnabled(boolean enabled)
CacheControllersetStatsEnabled in interface CacheController@Deprecated public void registerTenant(java.lang.String tenantId)
CacheControllerregisterTenant in interface CacheControllerpublic void setCacheRegionProvider(CacheRegionProvider cacheRegionProvider)
@Deprecated public void setRegionRegistryAllocationStrategy(RegionRegistryAllocationStrategy regionRegistryAllocationStrategy)
public void setGenerationalCacheDelegate(GenerationalCacheDelegate generationalCacheDelegate)
@Deprecated public CacheController unwrap()
Copyright © 2018 SAP SE. All Rights Reserved.