Package de.hybris.platform.regioncache
Interface CacheController
-
- All Known Implementing Classes:
DefaultCacheController
public interface CacheControllerMain point connecting platform with cache.
Implementing class is responsible for:
- Processes adding from cache.
- Processes invalidating cache units.
- Clearing cache units.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddLifecycleCallback(CacheLifecycleCallback callback)registers a lifecycle callback.voidclearCache(CacheRegion region)Clears cache<T> Tget(CacheKey key)Gets value stored in the cache.java.util.Collection<CacheRegion>getRegions()Returns all regions used in this controller.<T> TgetWithLoader(CacheKey key, CacheValueLoader<T> loader)Gets stored value from cache.voidinvalidate(CacheKey key)Performs key invalidation from cache.voidregisterTenant(java.lang.String tenantId)Setups registry for tenantvoidremove(CacheKey key)Removes keyvoidremoveLifecycleCallback(CacheLifecycleCallback callback)Removes a registered lifecycle callback.voidsetStatsEnabled(boolean enabled)Allows to enable or disable collecting of statistics for all regions in one step.
-
-
-
Method Detail
-
getWithLoader
<T> T getWithLoader(CacheKey key, CacheValueLoader<T> loader) throws CacheValueLoadException
Gets stored value from cache. If value is not available loader is invoked.- Throws:
CacheValueLoadException
-
get
<T> T get(CacheKey key)
Gets value stored in the cache. If value is not already loaded returns NULL.
-
invalidate
void invalidate(CacheKey key)
Performs key invalidation from cache.
Method checks invalidation filters and cache registry.
-
getRegions
java.util.Collection<CacheRegion> getRegions()
Returns all regions used in this controller.
-
remove
void remove(CacheKey key)
Removes key
-
clearCache
void clearCache(CacheRegion region)
Clears cache
-
addLifecycleCallback
void addLifecycleCallback(CacheLifecycleCallback callback)
registers a lifecycle callback. Callbacks are executed in order of registration.
-
removeLifecycleCallback
void removeLifecycleCallback(CacheLifecycleCallback callback)
Removes a registered lifecycle callback.
-
setStatsEnabled
void setStatsEnabled(boolean enabled)
Allows to enable or disable collecting of statistics for all regions in one step. Collection of cache statistics has negative impact on cache performance.
-
registerTenant
void registerTenant(java.lang.String tenantId)
Setups registry for tenant
-
-