Class DefaultRenderingCacheService<T extends java.io.Serializable>

    • Field Detail

      • CMS_RENDERING_CACHE_ENABLED_KEY

        public static final java.lang.String CMS_RENDERING_CACHE_ENABLED_KEY
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultRenderingCacheService

        public DefaultRenderingCacheService()
    • Method Detail

      • cacheEnabled

        public boolean cacheEnabled()
        Description copied from interface: RenderingCacheService
        Verifies whether the cache is enabled or not.
        Specified by:
        cacheEnabled in interface RenderingCacheService<T extends java.io.Serializable>
        Returns:
        true if cache is enabled, false otherwise
      • put

        public void put​(CacheKey key,
                        java.io.Serializable item)
        Description copied from interface: RenderingCacheService
        Puts the Serializable into the cache using provided key.
        Specified by:
        put in interface RenderingCacheService<T extends java.io.Serializable>
        Parameters:
        key - the key used to save Serializable
        item - the Serializable that must be cached.
      • get

        public java.util.Optional<T> get​(CacheKey key)
        Description copied from interface: RenderingCacheService
        Returns cached Serializable.
        Specified by:
        get in interface RenderingCacheService<T extends java.io.Serializable>
        Parameters:
        key - the key used to retrieve cached Serializable
        Returns:
        optional cached Serializable.
      • cacheOrElse

        public T cacheOrElse​(ItemModel item,
                             java.util.function.Supplier<T> converter)
        Description copied from interface: RenderingCacheService
        Methods takes the ItemModel, verifies that the Serializable representation is cached and returns it. If the item is not in the cache the converter is called and Serializable representation is saved into the cache.
        Specified by:
        cacheOrElse in interface RenderingCacheService<T extends java.io.Serializable>
        Parameters:
        item - the ItemModel to cache.
        converter - the converter to use if the ItemModel is not in the cache.
        Returns:
        the Serializable representation for rendering.
      • setCacheController

        public void setCacheController​(CacheController cacheController)
      • setConfigurationService

        public void setConfigurationService​(ConfigurationService configurationService)
      • setSessionService

        public void setSessionService​(SessionService sessionService)