Class DefaultRenderingCacheService<T extends Serializable>
java.lang.Object
de.hybris.platform.cmsfacades.rendering.cache.impl.DefaultRenderingCacheService<T>
- Type Parameters:
T- type parameter
- All Implemented Interfaces:
RenderingCacheService<T>
public class DefaultRenderingCacheService<T extends Serializable>
extends Object
implements RenderingCacheService<T>
Default implementation of
RenderingCacheService-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanVerifies whether the cache is enabled or not.cacheOrElse(ItemModel item, Supplier<T> converter) Methods takes theItemModel, verifies that theSerializablerepresentation is cached and returns it.Returns cachedSerializable.Retrieves the key that must be used to cacheSerializable.voidput(CacheKey key, Serializable item) Puts theSerializableinto the cache using provided key.voidsetCacheController(CacheController cacheController) voidsetCacheKeyProvider(RenderingCacheKeyProvider<ItemModel> cacheKeyProvider) voidsetConfigurationService(ConfigurationService configurationService) voidsetSessionService(SessionService sessionService)
-
Field Details
-
CMS_RENDERING_CACHE_ENABLED_KEY
- See Also:
-
-
Constructor Details
-
DefaultRenderingCacheService
public DefaultRenderingCacheService()
-
-
Method Details
-
cacheEnabled
public boolean cacheEnabled()Description copied from interface:RenderingCacheServiceVerifies whether the cache is enabled or not.- Specified by:
cacheEnabledin interfaceRenderingCacheService<T extends Serializable>- Returns:
- true if cache is enabled, false otherwise
-
put
Description copied from interface:RenderingCacheServicePuts theSerializableinto the cache using provided key.- Specified by:
putin interfaceRenderingCacheService<T extends Serializable>- Parameters:
key- the key used to saveSerializableitem- theSerializablethat must be cached.
-
get
Description copied from interface:RenderingCacheServiceReturns cachedSerializable.- Specified by:
getin interfaceRenderingCacheService<T extends Serializable>- Parameters:
key- the key used to retrieve cachedSerializable- Returns:
- optional cached
Serializable.
-
getKey
Description copied from interface:RenderingCacheServiceRetrieves the key that must be used to cacheSerializable. The key is retrieved byItemModel.- Specified by:
getKeyin interfaceRenderingCacheService<T extends Serializable>- Parameters:
item- theItemModelfor which to retrieve the key.- Returns:
- the key
-
cacheOrElse
Description copied from interface:RenderingCacheServiceMethods takes theItemModel, verifies that theSerializablerepresentation is cached and returns it. If the item is not in the cache the converter is called andSerializablerepresentation is saved into the cache.- Specified by:
cacheOrElsein interfaceRenderingCacheService<T extends Serializable>- Parameters:
item- theItemModelto cache.converter- the converter to use if theItemModelis not in the cache.- Returns:
- the
Serializablerepresentation for rendering.
-
getCacheKeyProvider
-
setCacheKeyProvider
-
getCacheController
-
setCacheController
-
getConfigurationService
-
setConfigurationService
-
getSessionService
-
setSessionService
-