public class DefaultAsCacheStrategy extends java.lang.Object implements AsCacheStrategy
AsCacheStrategy that uses the region cache from the platform.| Modifier and Type | Class and Description |
|---|---|
protected static class |
DefaultAsCacheStrategy.HybrisAsCacheKey |
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
AS_CACHE_ENABLED_KEY |
protected static java.lang.String |
AS_CALCULATION_CACHE_ENABLED_KEY |
protected static java.lang.String |
AS_LOAD_CACHE_ENABLED_KEY |
protected static java.lang.String |
AS_MERGE_CACHE_ENABLED_KEY |
| Constructor and Description |
|---|
DefaultAsCacheStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
clear()
Clears the cache by removing all cached entries.
|
CacheRegion |
getCacheRegion() |
ConfigurationService |
getConfigurationService() |
long |
getHits()
Returns the hit count.
|
long |
getMisses()
Returns the miss count.
|
long |
getSize()
Returns number of elements currently in the cache.
|
protected java.lang.String |
getTenantId() |
TenantService |
getTenantService() |
<V> V |
getWithLoader(AsCacheKey cacheKey,
java.util.function.Function<AsCacheKey,V> valueLoader)
Returns the value in the cache for the given key.
|
boolean |
isEnabled(AsCacheScope cacheScope)
Checks if the cache is enabled for the given
AsCacheScope. |
protected void |
loadCacheSettings() |
void |
setCacheRegion(CacheRegion cacheRegion) |
void |
setConfigurationService(ConfigurationService configurationService) |
void |
setTenantService(TenantService tenantService) |
protected static final java.lang.String AS_CACHE_ENABLED_KEY
protected static final java.lang.String AS_LOAD_CACHE_ENABLED_KEY
protected static final java.lang.String AS_CALCULATION_CACHE_ENABLED_KEY
protected static final java.lang.String AS_MERGE_CACHE_ENABLED_KEY
public void afterPropertiesSet()
protected void loadCacheSettings()
public boolean isEnabled(AsCacheScope cacheScope)
AsCacheStrategyAsCacheScope.isEnabled in interface AsCacheStrategytrue if the cache is enabled, false otherwisepublic <V> V getWithLoader(AsCacheKey cacheKey, java.util.function.Function<AsCacheKey,V> valueLoader)
AsCacheStrategygetWithLoader in interface AsCacheStrategycacheKey - - the cache keyvalueLoader - - function to load valuespublic void clear()
AsCacheStrategyclear in interface AsCacheStrategypublic long getSize()
AsCacheStrategygetSize in interface AsCacheStrategypublic long getHits()
AsCacheStrategygetHits in interface AsCacheStrategypublic long getMisses()
AsCacheStrategygetMisses in interface AsCacheStrategyprotected java.lang.String getTenantId()
public TenantService getTenantService()
public void setTenantService(TenantService tenantService)
public ConfigurationService getConfigurationService()
public void setConfigurationService(ConfigurationService configurationService)
public CacheRegion getCacheRegion()
public void setCacheRegion(CacheRegion cacheRegion)
Copyright © 2018 SAP SE. All Rights Reserved.