public class InvalidateCacheOnResourceUpdateObserver extends AbstractLogEnabled implements Observer
Observer
for listening resource changes in order to invalidate cache on front-office.Modifier and Type | Field and Description |
---|---|
private static Pattern |
__RESOURCE_PATTERN |
private static Pattern |
__ROOT_SITE_RESOURCE_PATTERN |
private static Pattern |
__SHARED_RESOURCE_PATTERN |
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description |
---|
InvalidateCacheOnResourceUpdateObserver() |
Modifier and Type | Method and Description |
---|---|
private void |
_invalidate(String path) |
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.
|
boolean |
supports(Event event)
Checks if the event is supported.
|
getLogger, setLogger
private static final Pattern __RESOURCE_PATTERN
private static final Pattern __ROOT_SITE_RESOURCE_PATTERN
private static final Pattern __SHARED_RESOURCE_PATTERN
public InvalidateCacheOnResourceUpdateObserver()
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 _invalidate(String path) throws Exception
Exception