Class SimpleCacheKeyResolver
java.lang.Object
org.broadleafcommerce.presentation.cache.service.SimpleCacheKeyResolver
- All Implemented Interfaces:
TemplateCacheKeyResolverService
Default implementation of
TemplateCacheKeyResolverService that returns a concatenation of a
templateName and cacheKey. If the cacheKey is set to none, null is returned resulting in no cache.- Author:
- Brian Polster (bpolster)
-
Field Summary
Fields inherited from interface org.broadleafcommerce.presentation.cache.service.TemplateCacheKeyResolverService
CACHE_KEY_ATTRIBUTE, NONE_CACHE_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetStringValue(String attrName, Map<String, String> tagAttributes, boolean removeAttribute, BroadleafTemplateContext context) resolveCacheKey(String tagName, Map<String, String> tagAttributes, String documentName, Integer lineNumber, BroadleafTemplateContext context) Returns a concatenation of the templateName and cacheKey separated by an "_".
-
Constructor Details
-
SimpleCacheKeyResolver
public SimpleCacheKeyResolver()
-
-
Method Details
-
resolveCacheKey
public String resolveCacheKey(String tagName, Map<String, String> tagAttributes, String documentName, Integer lineNumber, BroadleafTemplateContext context) Returns a concatenation of the templateName and cacheKey separated by an "_". If cacheKey is null, only the templateName is returned.If cacheKey is "none" then null will be returned causing the template not to be cached.
- Specified by:
resolveCacheKeyin interfaceTemplateCacheKeyResolverService- Parameters:
tagName- the tag name that the cache processor is running intagAttributes- the attributes used in the tag or ones added by the cache processordocumentName- the name of the templatelineNumber- the line that the cache processor is oncontext- the context that the processor is executing in- Returns:
- See Also:
-
getStringValue
-