use of org.apache.sling.jcr.resource.internal.JcrListenerBaseConfig in project sling by apache.
the class JcrResourceProvider method registerListeners.
/**
* Register all observation listeners.
*/
private void registerListeners() {
if (this.repository != null) {
logger.debug("Registering resource listeners...");
try {
this.listenerConfig = new JcrListenerBaseConfig(this.getProviderContext().getObservationReporter(), this.repository);
for (final ObserverConfiguration config : this.getProviderContext().getObservationReporter().getObserverConfigurations()) {
logger.debug("Registering listener for {}", config.getPaths());
final Closeable listener = new JcrResourceListener(this.listenerConfig, config);
this.listeners.put(config, listener);
}
} catch (final RepositoryException e) {
throw new SlingException("Can't create the JCR event listener.", e);
}
logger.debug("Registered resource listeners");
}
}
Aggregations