Package org.apache.jackrabbit.oak.plugins.observation

Examples of org.apache.jackrabbit.oak.plugins.observation.ChangeProcessor$EventGeneratingNodeStateDiff


    @Override
    public synchronized void addEventListener(EventListener listener, int eventTypes, String absPath,
            boolean isDeep, String[] uuid, String[] nodeTypeName, boolean noLocal) throws RepositoryException {
        EventFilter filter = new EventFilter(ntMgr, eventTypes, oakPath(absPath), isDeep,
                uuid, validateNodeTypeNames(nodeTypeName), noLocal);
        ChangeProcessor processor = processors.get(listener);
        if (processor == null) {
            log.info(OBSERVATION, "Registering event listener {} with filter {}", listener, filter);
            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(), namePathMapper, tracker, filter);
            processors.put(listener, processor);
            processor.start(whiteboard);
        } else {
            log.debug(OBSERVATION, "Changing event listener {} to filter {}", listener, filter);
            processor.setFilter(filter);
        }
    }
View Full Code Here


        }
    }

    @Override
    public void removeEventListener(EventListener listener) {
        ChangeProcessor processor;
        synchronized (this) {
            processor = processors.remove(listener);
        }
        if (processor != null) {
            processor.stop(); // needs to happen outside synchronization
        }
    }
View Full Code Here

        }
    }

    private synchronized void addEventListener(
            EventListener listener, ListenerTracker tracker, FilterProvider filterProvider) {
        ChangeProcessor processor = processors.get(listener);
        if (processor == null) {
            LOG.info(OBSERVATION,
                    "Registering event listener {} with filter {}", listener, filterProvider);
            processor = new ChangeProcessor(sessionDelegate.getContentSession(), namePathMapper,
                    permissionProvider, tracker, filterProvider);
            processors.put(listener, processor);
            processor.start(whiteboard);
        } else {
            LOG.debug(OBSERVATION,
                    "Changing event listener {} to filter {}", listener, filterProvider);
            processor.setFilterProvider(filterProvider);
        }
    }
View Full Code Here

        addEventListener(listener, tracker, filterBuilder.build());
    }

    @Override
    public void removeEventListener(EventListener listener) {
        ChangeProcessor processor;
        synchronized (this) {
            processor = processors.remove(listener);
        }
        if (processor != null) {
            stop(processor); // needs to happen outside synchronization
View Full Code Here

            boolean isDeep, String[] uuid, String[] nodeTypeName, boolean noLocal) throws RepositoryException {
        boolean includeExternal = !(listener instanceof ExcludeExternal);
        String oakPath = namePathMapper.getOakPath(absPath);
        FilterProvider filterProvider = new JcrFilterProvider(ntMgr, eventTypes, oakPath, isDeep,
                uuid, validateNodeTypeNames(nodeTypeName), !noLocal, includeExternal, permissionProvider);
        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(), namePathMapper, tracker, filterProvider);
            processors.put(listener, processor);
            processor.start(whiteboard);
        } else {
            log.debug(OBSERVATION, "Changing event listener {} to filter {}", listener, filterProvider);
            processor.setFilterProvider(filterProvider);
        }
    }
View Full Code Here

        }
    }

    @Override
    public void removeEventListener(EventListener listener) {
        ChangeProcessor processor;
        synchronized (this) {
            processor = processors.remove(listener);
        }
        if (processor != null) {
            processor.stop(); // needs to happen outside synchronization
        }
    }
View Full Code Here

    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);
        EventFilter filter = new EventFilter(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, filter);
            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(), namePathMapper, tracker, filter);
            processors.put(listener, processor);
            processor.start(whiteboard);
        } else {
            log.debug(OBSERVATION, "Changing event listener {} to filter {}", listener, filter);
            processor.setFilter(filter);
        }
    }
View Full Code Here

        }
    }

    @Override
    public void removeEventListener(EventListener listener) {
        ChangeProcessor processor;
        synchronized (this) {
            processor = processors.remove(listener);
        }
        if (processor != null) {
            processor.stop(); // needs to happen outside synchronization
        }
    }
View Full Code Here

    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);
        }
    }
View Full Code Here

        }
    }

    @Override
    public void removeEventListener(EventListener listener) {
        ChangeProcessor processor;
        synchronized (this) {
            processor = processors.remove(listener);
        }
        if (processor != null) {
            processor.stop(); // needs to happen outside synchronization
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.plugins.observation.ChangeProcessor$EventGeneratingNodeStateDiff

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.