public abstract class AbstractSynchronizeObserver extends AbstractLogEnabled implements Observer, Serviceable
Observer
for synchronizing the workspace live.A lock is used for write access to the live session in order to prevent errors from a parallel full synchronization or observer.
Modifier and Type | Field and Description |
---|---|
protected LiveAccessManager |
_liveAccessManager
Preview access manager.
|
protected Repository |
_repository
JCR repository.
|
protected SynchronizeComponent |
_synchronizeComponent
|
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description |
---|
AbstractSynchronizeObserver() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
_internalObserve(Event event,
Session liveSession)
Observes the event with access to the live workspace.
|
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) |
getLogger, setLogger
protected Repository _repository
protected LiveAccessManager _liveAccessManager
protected SynchronizeComponent _synchronizeComponent
public AbstractSynchronizeObserver()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public int getPriority(Event event)
Observer
getPriority
in interface Observer
event
- the event.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.protected abstract void _internalObserve(Event event, Session liveSession) throws RepositoryException
event
- the event.liveSession
- the session to the live workspace.RepositoryException
- if an error occurs.