public synchronized void addEventListener(EventListener listener, int eventTypes, String absPath,
boolean isDeep, String[] uuid, String[] nodeTypeName, boolean noLocal) throws RepositoryException {
boolean includeExternal = !(listener instanceof ExcludeExternal);
FilterProvider filterProvider = new FilterProvider(ntMgr, eventTypes, oakPath(absPath), isDeep,
uuid, validateNodeTypeNames(nodeTypeName), !noLocal, includeExternal);
ChangeProcessor processor = processors.get(listener);
if (processor == null) {
log.info(OBSERVATION, "Registering event listener {} with filter {}", listener, filterProvider);
ListenerTracker tracker = new ListenerTracker(
listener, eventTypes, absPath, isDeep,
uuid, nodeTypeName, noLocal) {
@Override
protected void warn(String message) {
log.warn(DEPRECATED, message, initStackTrace);
}
@Override
protected void beforeEventDelivery() {
sessionDelegate.refreshAtNextAccess();
}
};
processor = new ChangeProcessor(
sessionDelegate.getContentSession(), permissionProvider, namePathMapper, tracker, filterProvider);
processors.put(listener, processor);
processor.start(whiteboard);
} else {
log.debug(OBSERVATION, "Changing event listener {} to filter {}", listener, filterProvider);
processor.setFilterProvider(filterProvider);
}
}