You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2015/04/07 09:08:12 UTC
[jira] [Updated] (SLING-4564) Use a single listener registered for
multiple path in JCR installer
[ https://issues.apache.org/jira/browse/SLING-4564?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler updated SLING-4564:
------------------------------------
Fix Version/s: JCR Installer 3.1.16
> Use a single listener registered for multiple path in JCR installer
> -------------------------------------------------------------------
>
> Key: SLING-4564
> URL: https://issues.apache.org/jira/browse/SLING-4564
> Project: Sling
> Issue Type: Improvement
> Components: Installer
> Affects Versions: JCR Installer 3.1.8
> Reporter: Chetan Mehrotra
> Assignee: Carsten Ziegeler
> Fix For: JCR Installer 3.1.16
>
>
> Sling Jcr installer currently registers one listener per watched folder. On an application like AEM this results in ~150 listeners out of total 210 to belong to Jcr installer.
> Recently Jackrabbit introduced support for adding [additional path|https://github.com/apache/jackrabbit/blob/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/observation/JackrabbitEventFilter.java#L232] to listen to as part of JCR-3745. This can be leveraged by the Jcr installer to avoid registering multiple listeners and instead use one listener.
> The above feature can be used in following form
> {code}
> String[] paths = searchPaths.toArray(new String[]{});
> JackrabbitEventFilter eventFilter = new JackrabbitEventFilter()
> .setAbsPath(paths[0])
> .setEventTypes(Event.NODE_ADDED |
> Event.NODE_REMOVED |
> Event.NODE_MOVED |
> Event.PROPERTY_ADDED |
> Event.PROPERTY_CHANGED |
> Event.PROPERTY_REMOVED )
> .setIsDeep(true)
> .setNoLocal(false)
> .setNoExternal(true);
> if (paths.length > 1) {
> eventFilter.setAdditionalPaths(paths);
> }
> JackrabbitObservationManager observationManager = (JackrabbitObservationManager) adminSession.getWorkspace().getObservationManager();
> observationManager.addEventListener(this, eventFilter);
> {code}
> This would allow more efficient observation processing and avoid putting load on system as Oak currently maintains one queue per listener.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)