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
FieldsModifier and TypeFieldDescriptionprotected CacheInvalidationPolicyCache invalidation policyprotected javax.jcr.RepositoryJCR repository.Fields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract SiteRetrieves 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.voidObserves an event.voidservice(ServiceManager manager) Methods inherited from class org.ametys.web.cache.AbstractCacheObserver
getPriorityMethods 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:
servicein interfaceServiceable- Throws:
ServiceException
-
observe
Description copied from interface:ObserverObserves an event.- Specified by:
observein 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
nullif 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.
-