Class DefaultAsCacheStrategy
java.lang.Object
de.hybris.platform.adaptivesearch.strategies.impl.DefaultAsCacheStrategy
- All Implemented Interfaces:
AsCacheStrategy,org.springframework.beans.factory.InitializingBean
public class DefaultAsCacheStrategy
extends Object
implements AsCacheStrategy, org.springframework.beans.factory.InitializingBean
Default implementation of
AsCacheStrategy that uses the region cache from the platform.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclear()Clears the cache by removing all cached entries.longgetHits()Returns the hit count.longReturns the miss count.longgetSize()Returns number of elements currently in the cache.protected String<V> VgetWithLoader(AsCacheKey cacheKey, Function<AsCacheKey, V> valueLoader) Returns the value in the cache for the given key.booleanisEnabled(AsCacheScope cacheScope) Checks if the cache is enabled for the givenAsCacheScope.protected voidvoidsetCacheRegion(CacheRegion cacheRegion) voidsetConfigurationService(ConfigurationService configurationService) voidsetTenantService(TenantService tenantService)
-
Field Details
-
AS_CACHE_ENABLED_KEY
- See Also:
-
AS_LOAD_CACHE_ENABLED_KEY
- See Also:
-
AS_CALCULATION_CACHE_ENABLED_KEY
- See Also:
-
AS_MERGE_CACHE_ENABLED_KEY
- See Also:
-
-
Constructor Details
-
DefaultAsCacheStrategy
public DefaultAsCacheStrategy()
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
loadCacheSettings
protected void loadCacheSettings() -
isEnabled
Description copied from interface:AsCacheStrategyChecks if the cache is enabled for the givenAsCacheScope.- Specified by:
isEnabledin interfaceAsCacheStrategy- Returns:
trueif the cache is enabled,falseotherwise
-
getWithLoader
Description copied from interface:AsCacheStrategyReturns the value in the cache for the given key. If the key is null or the value is not yet in the cache, valueLoader will be used to load the missing value.- Specified by:
getWithLoaderin interfaceAsCacheStrategy- Parameters:
cacheKey- - the cache keyvalueLoader- - function to load values- Returns:
- the cached value
-
clear
public void clear()Description copied from interface:AsCacheStrategyClears the cache by removing all cached entries.- Specified by:
clearin interfaceAsCacheStrategy
-
getSize
public long getSize()Description copied from interface:AsCacheStrategyReturns number of elements currently in the cache.- Specified by:
getSizein interfaceAsCacheStrategy
-
getHits
public long getHits()Description copied from interface:AsCacheStrategyReturns the hit count.- Specified by:
getHitsin interfaceAsCacheStrategy
-
getMisses
public long getMisses()Description copied from interface:AsCacheStrategyReturns the miss count.- Specified by:
getMissesin interfaceAsCacheStrategy
-
getTenantId
-
getTenantService
-
setTenantService
-
getConfigurationService
-
setConfigurationService
-
getCacheRegion
-
setCacheRegion
-