Class BroadleafThymeleaf3CacheProcessor
java.lang.Object
org.thymeleaf.processor.AbstractProcessor
org.thymeleaf.processor.element.AbstractElementModelProcessor
org.thymeleaf.processor.element.AbstractAttributeModelProcessor
org.broadleafcommerce.presentation.thymeleaf3.processor.BroadleafThymeleaf3CacheProcessor
- All Implemented Interfaces:
org.thymeleaf.processor.element.IElementModelProcessor,org.thymeleaf.processor.element.IElementProcessor,org.thymeleaf.processor.IProcessor
public class BroadleafThymeleaf3CacheProcessor
extends org.thymeleaf.processor.element.AbstractAttributeModelProcessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected javax.cache.Cacheprotected org.broadleafcommerce.presentation.cache.service.TemplateCacheKeyResolverServiceprotected org.broadleafcommerce.common.extensibility.cache.JCacheUtilprotected org.broadleafcommerce.common.config.service.SystemPropertiesService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddToCache(String cacheKey, org.thymeleaf.model.IModel model, org.thymeleaf.context.ITemplateContext context, Map<String, String> tagAttributes) protected ObjectcheckCacheForElement(Map<String, String> tagAttributes, String cacheKey) If this template was found in cache, adds the response to the element and returns true.protected voiddoProcess(org.thymeleaf.context.ITemplateContext iContext, org.thymeleaf.model.IModel model, org.thymeleaf.engine.AttributeName attributeName, String attributeValue, org.thymeleaf.processor.element.IElementModelStructureHandler structureHandler) javax.cache.CachegetCache()booleanprotected voidreplaceTagWithCache(String cachedObject, org.thymeleaf.model.IModel model, org.thymeleaf.context.ITemplateContext context) voidsetCache(javax.cache.Cache cache) protected booleanshouldCache(String attributeValue, org.broadleafcommerce.presentation.model.BroadleafTemplateContext context) Methods inherited from class org.thymeleaf.processor.element.AbstractAttributeModelProcessor
doProcessMethods inherited from class org.thymeleaf.processor.element.AbstractElementModelProcessor
getDialectPrefix, getMatchingAttributeName, getMatchingElementName, processMethods inherited from class org.thymeleaf.processor.AbstractProcessor
getPrecedence, getTemplateModeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.thymeleaf.processor.IProcessor
getPrecedence, getTemplateMode
-
Field Details
-
ATTR_NAME
- See Also:
-
cache
protected javax.cache.Cache cache -
systemPropertiesService
protected org.broadleafcommerce.common.config.service.SystemPropertiesService systemPropertiesService -
cacheKeyResolver
protected org.broadleafcommerce.presentation.cache.service.TemplateCacheKeyResolverService cacheKeyResolver -
jcacheUtil
protected org.broadleafcommerce.common.extensibility.cache.JCacheUtil jcacheUtil
-
-
Constructor Details
-
BroadleafThymeleaf3CacheProcessor
public BroadleafThymeleaf3CacheProcessor()
-
-
Method Details
-
doProcess
protected void doProcess(org.thymeleaf.context.ITemplateContext iContext, org.thymeleaf.model.IModel model, org.thymeleaf.engine.AttributeName attributeName, String attributeValue, org.thymeleaf.processor.element.IElementModelStructureHandler structureHandler) - Specified by:
doProcessin classorg.thymeleaf.processor.element.AbstractAttributeModelProcessor
-
shouldCache
protected boolean shouldCache(String attributeValue, org.broadleafcommerce.presentation.model.BroadleafTemplateContext context) -
checkCacheForElement
If this template was found in cache, adds the response to the element and returns true.If not found in cache, adds the cacheKey to the element so that the Writer can cache after the first process.
- Parameters:
tagAttributes-cacheKey-- Returns:
-
replaceTagWithCache
protected void replaceTagWithCache(String cachedObject, org.thymeleaf.model.IModel model, org.thymeleaf.context.ITemplateContext context) -
addToCache
-
getCache
public javax.cache.Cache getCache() -
setCache
public void setCache(javax.cache.Cache cache) -
isCachingEnabled
public boolean isCachingEnabled()
-