Class DefaultAsCacheStrategy

  • All Implemented Interfaces:
    AsCacheStrategy, org.springframework.beans.factory.InitializingBean

    public class DefaultAsCacheStrategy
    extends java.lang.Object
    implements AsCacheStrategy, org.springframework.beans.factory.InitializingBean
    Default implementation of AsCacheStrategy that uses the region cache from the platform.
    • Field Detail

      • AS_CACHE_ENABLED_KEY

        protected static final java.lang.String AS_CACHE_ENABLED_KEY
        See Also:
        Constant Field Values
      • AS_LOAD_CACHE_ENABLED_KEY

        protected static final java.lang.String AS_LOAD_CACHE_ENABLED_KEY
        See Also:
        Constant Field Values
      • AS_CALCULATION_CACHE_ENABLED_KEY

        protected static final java.lang.String AS_CALCULATION_CACHE_ENABLED_KEY
        See Also:
        Constant Field Values
      • AS_MERGE_CACHE_ENABLED_KEY

        protected static final java.lang.String AS_MERGE_CACHE_ENABLED_KEY
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultAsCacheStrategy

        public DefaultAsCacheStrategy()
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      • loadCacheSettings

        protected void loadCacheSettings()
      • getWithLoader

        public <V> V getWithLoader​(AsCacheKey cacheKey,
                                   java.util.function.Function<AsCacheKey,​V> valueLoader)
        Description copied from interface: AsCacheStrategy
        Returns 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:
        getWithLoader in interface AsCacheStrategy
        Parameters:
        cacheKey - - the cache key
        valueLoader - - function to load values
        Returns:
        the cached value
      • clear

        public void clear()
        Description copied from interface: AsCacheStrategy
        Clears the cache by removing all cached entries.
        Specified by:
        clear in interface AsCacheStrategy
      • getSize

        public long getSize()
        Description copied from interface: AsCacheStrategy
        Returns number of elements currently in the cache.
        Specified by:
        getSize in interface AsCacheStrategy
      • getTenantId

        protected java.lang.String getTenantId()
      • setTenantService

        public void setTenantService​(TenantService tenantService)
      • setConfigurationService

        public void setConfigurationService​(ConfigurationService configurationService)
      • setCacheRegion

        public void setCacheRegion​(CacheRegion cacheRegion)