jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r679750 - in /jackrabbit/trunk: jackrabbit-api/src/main/java/org/apache/jackrabbit/api/observation/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/ jackrabbit-core/src/main/resources-filtered/org/apache/jackrabbit/core/
Date Fri, 25 Jul 2008 10:30:41 GMT
Author: jukka
Date: Fri Jul 25 03:30:40 2008
New Revision: 679750

URL: http://svn.apache.org/viewvc?rev=679750&view=rev
Log:
JCR-1672: Adding Event interface and isLocal()

Reverted revision 677261 that introduced the LocalEventListener interface.

We can reintroduce the interface once we can leverage the extra information it gives to the
observation manager, but until that it's better to avoid having two different mechanisms for
the same functionality.

Removed:
    jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/observation/LocalEventListener.java
Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/FilteredEventIterator.java
    jackrabbit/trunk/jackrabbit-core/src/main/resources-filtered/org/apache/jackrabbit/core/repository.properties

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java?rev=679750&r1=679749&r2=679750&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java
Fri Jul 25 03:30:40 2008
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core.observation;
 
-import org.apache.jackrabbit.api.observation.LocalEventListener;
 import org.apache.jackrabbit.core.ItemId;
 import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.core.state.ItemState;
@@ -239,7 +238,7 @@
             return;
         }
         // check if filtered iterator has at least one event
-        EventIterator it = new FilteredEventIterator(events, filter, denied, listener instanceof
LocalEventListener);
+        EventIterator it = new FilteredEventIterator(events, filter, denied);
         if (it.hasNext()) {
             listener.onEvent(it);
         } else {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/FilteredEventIterator.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/FilteredEventIterator.java?rev=679750&r1=679749&r2=679750&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/FilteredEventIterator.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/FilteredEventIterator.java
Fri Jul 25 03:30:40 2008
@@ -63,10 +63,6 @@
     private long pos = 0;
 
     /**
-     * Is this a local event listener
-     */
-    private final boolean isLocalEventListener;
-    /**
      * Creates a new <code>FilteredEventIterator</code>.
      *
      * @param c      an unmodifiable Collection of {@link javax.jcr.observation.Event}s.
@@ -78,12 +74,10 @@
      */
     public FilteredEventIterator(EventStateCollection c,
                                  EventFilter filter,
-                                 Set denied,
-                                 boolean isLocalEventListener) {
+                                 Set denied) {
         actualEvents = c.iterator();
         this.filter = filter;
         this.denied = denied;
-        this.isLocalEventListener = isLocalEventListener;
         fetchNext();
     }
 
@@ -161,14 +155,12 @@
         next = null;
         while (next == null && actualEvents.hasNext()) {
             state = (EventState) actualEvents.next();
-            if ( !state.isExternal() || !isLocalEventListener ) {
-                // check denied set
-                if (denied == null || !denied.contains(state.getTargetId())) {
-                    try {
-                        next = filter.blocks(state) ? null : new EventImpl(filter.getSession(),
state);
-                    } catch (RepositoryException e) {
-                        log.error("Exception while applying filter.", e);
-                    }
+            // check denied set
+            if (denied == null || !denied.contains(state.getTargetId())) {
+                try {
+                    next = filter.blocks(state) ? null : new EventImpl(filter.getSession(),
state);
+                } catch (RepositoryException e) {
+                    log.error("Exception while applying filter.", e);
                 }
             }
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/resources-filtered/org/apache/jackrabbit/core/repository.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/resources-filtered/org/apache/jackrabbit/core/repository.properties?rev=679750&r1=679749&r2=679750&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/resources-filtered/org/apache/jackrabbit/core/repository.properties
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/resources-filtered/org/apache/jackrabbit/core/repository.properties
Fri Jul 25 03:30:40 2008
@@ -69,6 +69,3 @@
 query.xpath.doc.order = false
 # Disabled since in default configuration document order is not supported.
 # See https://issues.apache.org/jira/browse/JCR-1237 for details
-
-# The presence of this key indicates that this implementation supports local event listeners.
-option.observation.localeventlistener = true



Mime
View raw message