public class CacheFilter extends AbstractFilter
AbstractFilter.AjaxRequestCondition, AbstractFilter.AnyOfCondition, AbstractFilter.ConfigurationCondition, AbstractFilter.EditModeCondition, AbstractFilter.ExecutionCondition, AbstractFilter.MainResourceCondition, AbstractFilter.ModeCondition, AbstractFilter.ModuleCondition, AbstractFilter.NodeTypeCondition, AbstractFilter.NotCondition, AbstractFilter.PatternCondition, AbstractFilter.RequestAttributeCondition, AbstractFilter.RequestCondition, AbstractFilter.RequestHeaderCondition, AbstractFilter.RequestParameterCondition, AbstractFilter.SiteTemplateSetCondition, AbstractFilter.TemplateCondition, AbstractFilter.TemplateTypeCondition, AbstractFilter.WebflowRequestCondition| Modifier and Type | Field and Description |
|---|---|
protected ModuleCacheProvider |
cacheProvider |
protected boolean |
cascadeFragmentErrors |
protected int |
dependenciesLimit |
protected int |
errorCacheExpiration |
service| Constructor and Description |
|---|
CacheFilter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addDependencies(RenderContext renderContext,
String finalKey,
net.sf.ehcache.Cache cache,
String value,
Set<String> newDependencies)
Add key to the list of dependencies
|
protected String |
appendDebugInformation(Map<String,Object> moduleMap,
String renderContent) |
protected void |
doCache(String previousOut,
RenderContext renderContext,
Resource resource,
Long expiration,
net.sf.ehcache.Cache cache,
String finalKey,
boolean bypassDependencies) |
String |
execute(String previousOut,
RenderContext renderContext,
Resource resource,
RenderChain chain) |
void |
finalize(RenderContext renderContext,
Resource resource,
RenderChain chain) |
String |
getContentForError(RenderContext renderContext,
Resource resource,
RenderChain chain,
Exception e) |
protected boolean |
isCacheable(RenderContext renderContext,
String key,
Resource resource,
Properties fragmentProperties)
Is the current fragment cacheable or not.
|
String |
prepare(RenderContext renderContext,
Resource resource,
RenderChain chain) |
protected String |
returnFromCache(RenderContext renderContext,
String key,
String finalKey,
net.sf.ehcache.Element element,
Map<String,Object> moduleMap)
This method is called if the entry is found in the cache.
|
void |
setCacheProvider(ModuleCacheProvider cacheProvider) |
void |
setCascadeFragmentErrors(boolean cascadeFragmentErrors) |
void |
setDependenciesLimit(int dependenciesLimit) |
void |
setErrorCacheExpiration(int errorCacheExpiration) |
void |
setGeneratorQueue(ModuleGeneratorQueue generatorQueue) |
protected boolean |
useDependencies()
Sets whether dependencies should be stored per cache object for this filter, which is useful for dependent
flushes.
|
areConditionsMatched, compareTo, equals, getDescription, getPriority, hashCode, isDisabled, setDescription, setDisabled, setPriority, setRenderService, toStringaddCondition, addCondition, getConditionsSummary, setApplyOnConfigurations, setApplyOnEditMode, setApplyOnMainResource, setApplyOnModes, setApplyOnModules, setApplyOnNodeTypes, setApplyOnSiteTemplateSets, setApplyOnTemplates, setApplyOnTemplateTypes, setConditions, setSkipOnAjaxRequest, setSkipOnConfiguration, setSkipOnConfigurations, setSkipOnEditMode, setSkipOnMainResource, setSkipOnModes, setSkipOnModules, setSkipOnNodeTypes, setSkipOnTemplates, setSkipOnTemplateTypes, setSkipOnWebflowRequestprotected ModuleCacheProvider cacheProvider
protected boolean cascadeFragmentErrors
protected int errorCacheExpiration
protected int dependenciesLimit
public String prepare(RenderContext renderContext, Resource resource, RenderChain chain) throws Exception
prepare in interface RenderFilterprepare in class AbstractFilterrenderContext - The render contextresource - The resource to renderchain - The render chainExceptionpublic String execute(String previousOut, RenderContext renderContext, Resource resource, RenderChain chain) throws Exception
execute in interface RenderFilterexecute in class AbstractFilterpreviousOut - Result from the previous filterrenderContext - The render contextresource - The resource to renderchain - The render chainExceptionpublic void finalize(RenderContext renderContext, Resource resource, RenderChain chain)
finalize in interface RenderFilterfinalize in class AbstractFilterpublic String getContentForError(RenderContext renderContext, Resource resource, RenderChain chain, Exception e)
getContentForError in interface RenderFiltergetContentForError in class AbstractFilterprotected void doCache(String previousOut, RenderContext renderContext, Resource resource, Long expiration, net.sf.ehcache.Cache cache, String finalKey, boolean bypassDependencies)
protected boolean useDependencies()
protected void addDependencies(RenderContext renderContext, String finalKey, net.sf.ehcache.Cache cache, String value, Set<String> newDependencies)
protected boolean isCacheable(RenderContext renderContext, String key, Resource resource, Properties fragmentProperties) throws javax.jcr.RepositoryException
renderContext - render contextresource - current resourcekey - calculated cache keyjavax.jcr.RepositoryExceptionprotected String returnFromCache(RenderContext renderContext, String key, String finalKey, net.sf.ehcache.Element element, Map<String,Object> moduleMap)
renderContext - The render contextkey - The key with placeholdersfinalKey - The final key with placeholders replacedelement - The cached elementmoduleMap - The current module mapprotected String appendDebugInformation(Map<String,Object> moduleMap, String renderContent)
public void setCacheProvider(ModuleCacheProvider cacheProvider)
public void setCascadeFragmentErrors(boolean cascadeFragmentErrors)
public void setErrorCacheExpiration(int errorCacheExpiration)
public void setDependenciesLimit(int dependenciesLimit)
public void setGeneratorQueue(ModuleGeneratorQueue generatorQueue)
Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.