public class InvalidatePageElementCacheObserver extends AbstractLogEnabled implements Observer, Serviceable, Configurable
PageElementCache
based on the various PageElementCachePolicy
.Modifier and Type | Field and Description |
---|---|
private ServiceManager |
_manager |
private PageElementCache |
_pageElementCache |
private PageElementCachePolicyExtensionPoint |
_pageElementCachePolicyExtensionPoint |
private SiteManager |
_siteManager |
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description |
---|
InvalidatePageElementCacheObserver() |
Modifier and Type | Method and Description |
---|---|
private void |
_doObserve(String workspace,
Site site,
Event event) |
private Set<PageElementCachePolicy> |
_firstPass(Set<PageElementCachePolicy> policies,
String workspace,
Site site,
String pageElementType,
Event event) |
private Site |
_getSite(Event event) |
private void |
_removeItemIfNecessary(String workspace,
String pageElementType,
String elementId,
String siteName,
boolean hasAtLeastOneRemove,
boolean hasAtLeastOneKeep,
boolean hasAtLeastOneNeedInfo) |
private void |
_secondPass(Set<PageElementCachePolicy> policies,
String workspace,
Site site,
String pageElementType,
String elementId,
Event event) |
void |
configure(Configuration configuration) |
int |
getPriority(Event event)
Retrieves the priority to observe this event.
This can be used to process a supported event before others observers. |
void |
observe(Event event,
Map<String,Object> transientVars)
Observes an event.
|
void |
service(ServiceManager manager) |
boolean |
supports(Event event)
Checks if the event is supported.
|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
private ServiceManager _manager
private PageElementCache _pageElementCache
private PageElementCachePolicyExtensionPoint _pageElementCachePolicyExtensionPoint
private SiteManager _siteManager
public InvalidatePageElementCacheObserver()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
public int getPriority(Event event)
Observer
getPriority
in interface Observer
event
- the event.public boolean supports(Event event)
Observer
public void observe(Event event, Map<String,Object> transientVars) throws Exception
Observer
observe
in interface Observer
event
- the event.transientVars
- transientVars passed from one Observer to another when processing a single Event.
This may allow optimizations between observers.Exception
- if an error occurs.
All exceptions will be logged but not propagated, as the observation mechanism should never fail.private void _doObserve(String workspace, Site site, Event event)
private Set<PageElementCachePolicy> _firstPass(Set<PageElementCachePolicy> policies, String workspace, Site site, String pageElementType, Event event)
private void _secondPass(Set<PageElementCachePolicy> policies, String workspace, Site site, String pageElementType, String elementId, Event event)
private void _removeItemIfNecessary(String workspace, String pageElementType, String elementId, String siteName, boolean hasAtLeastOneRemove, boolean hasAtLeastOneKeep, boolean hasAtLeastOneNeedInfo)