Package org.ametys.web.cache
Class AbstractSiteCacheObserver
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.cache.AbstractCacheObserver
org.ametys.web.cache.AbstractSiteCacheObserver
- All Implemented Interfaces:
Observer
,LogEnabled
,Serviceable
- Direct Known Subclasses:
AbstractSurveyCacheObserver
,InvalidateCacheOnContentCommentedObserver
,InvalidateCacheOnContentDeletionObserver
,InvalidateCacheOnContentPageModificationObserver
,InvalidateCacheOnContentPageModificationObserver
,InvalidateCacheOnContentReactionObserver
,InvalidateCacheOnContentUnpublishObserver
,InvalidateCacheOnContentValidationOrTaggingObserver
,InvalidateCacheOnFormModifiedObserver
,InvalidateCacheOnPageDeletionObserver
,InvalidateCacheOnPageMinorChangeObserver
,InvalidateCacheOnPageModificationObserver
,InvalidateCacheOnPageMoveObserver
,InvalidateCacheOnRobotsChangeObserver
,InvalidateCacheOnZoneItemAdditionObserver
,InvalidateCacheOnZoneItemDeletionObserver
public abstract class AbstractSiteCacheObserver
extends AbstractCacheObserver
implements Serviceable
Abstract
Observer
for invalidate site data.-
Field Summary
Modifier and TypeFieldDescriptionprotected CacheInvalidationPolicy
Cache invalidation policyprotected javax.jcr.Repository
JCR repository.Fields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Site
Retrieves the site needed for accessing the front-office.protected abstract void
_internalObserve
(Event event, Site site, javax.jcr.Session liveSession) Observes the event with access to the target site and live workspace.void
Observes an event.void
service
(ServiceManager manager) Methods inherited from class org.ametys.web.cache.AbstractCacheObserver
getPriority
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_repository
JCR repository. -
_cachePolicy
Cache invalidation policy
-
-
Constructor Details
-
AbstractSiteCacheObserver
public AbstractSiteCacheObserver()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
observe
Description copied from interface:Observer
Observes an event.- Specified by:
observe
in interfaceObserver
- Parameters:
event
- the event.transientVars
- transientVars passed from one Observer to another when processing a single Event. This may allow optimizations between observers.- Throws:
Exception
- if an error occurs. All exceptions will be logged but not propagated, as the observation mechanism should never fail.
-
_getSite
Retrieves the site needed for accessing the front-office.- Parameters:
event
- the event.- Returns:
- the site or
null
if not found.
-
_internalObserve
protected abstract void _internalObserve(Event event, Site site, javax.jcr.Session liveSession) throws Exception Observes the event with access to the target site and live workspace.- Parameters:
event
- the event.site
- the site.liveSession
- the session to the workspace live.- Throws:
Exception
- if an error occurs.
-