Package org.ametys.web.cache.service
Class IsolatedServiceCachePolicy
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.web.cache.service.IsolatedServiceCachePolicy
-
- All Implemented Interfaces:
PageElementCachePolicy,Configurable,LogEnabled
public class IsolatedServiceCachePolicy extends AbstractLogEnabled implements PageElementCachePolicy, Configurable
PageElementCachePolicyfor isolated services (services which don't display modifiable data from other objects, such as Iframe service).
The shouldClearCache method always return PolicyResult.KEEP.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.web.cache.pageelement.PageElementCachePolicy
PageElementCachePolicy.PolicyResult
-
-
Constructor Summary
Constructors Constructor Description IsolatedServiceCachePolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(Configuration configuration)Set<String>getPageElementTypes()Returns the types of the associated page elements.PageElementCachePolicy.PolicyResultshouldClearCache(String workspace, Site site, String pageElementType, String elementId, Event event)Second pass of event processing, at the Page level.
This method is only called if the first pass resulted with NEED_MORE_INFORMATION.PageElementCachePolicy.PolicyResultshouldClearCache(String workspace, Site site, String pageElementType, Event event)First pass of event processing, at the type level.
Returning NEED_MORE_INFORMATION eventually leads to the second pass, which is more precise, and also depends on a particular element, but is more costly to compute.
Returning null means that this policy declares itself as not concerned by the current event.-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Constructor Detail
-
IsolatedServiceCachePolicy
public IsolatedServiceCachePolicy()
-
-
Method Detail
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
getPageElementTypes
public Set<String> getPageElementTypes()
Description copied from interface:PageElementCachePolicyReturns the types of the associated page elements.- Specified by:
getPageElementTypesin interfacePageElementCachePolicy- Returns:
- the types of the associated page elements.
-
shouldClearCache
public final PageElementCachePolicy.PolicyResult shouldClearCache(String workspace, Site site, String pageElementType, Event event)
Description copied from interface:PageElementCachePolicyFirst pass of event processing, at the type level.
Returning NEED_MORE_INFORMATION eventually leads to the second pass, which is more precise, and also depends on a particular element, but is more costly to compute.
Returning null means that this policy declares itself as not concerned by the current event.- Specified by:
shouldClearCachein interfacePageElementCachePolicy- Parameters:
workspace- the current JCR workspace.site- the current site.pageElementType- the page element type.event- the current event.- Returns:
- the policy result or null if this policy declares itself as not concerned.
-
shouldClearCache
public final PageElementCachePolicy.PolicyResult shouldClearCache(String workspace, Site site, String pageElementType, String elementId, Event event)
Description copied from interface:PageElementCachePolicySecond pass of event processing, at the Page level.
This method is only called if the first pass resulted with NEED_MORE_INFORMATION. If this method also returns NEED_MORE_INFORMATION, it will be interpreted as REMOVE.- Specified by:
shouldClearCachein interfacePageElementCachePolicy- Parameters:
workspace- the current JCR workspace.site- the current site.pageElementType- the page element type.elementId- the current element id.event- the current event.- Returns:
- the policy result.
-
-