jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1499384 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java
Date Wed, 03 Jul 2013 13:12:00 GMT
Author: mduerig
Date: Wed Jul  3 13:12:00 2013
New Revision: 1499384

URL: http://svn.apache.org/r1499384
Log:
OAK-144 Implement Observation
Better logging: distinguish between client errors and internal errors when dispatching observation
events

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java?rev=1499384&r1=1499383&r2=1499384&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java
Wed Jul  3 13:12:00 2013
@@ -196,7 +196,7 @@ class ChangeProcessor implements Runnabl
                 changes = changeListener.getChanges();
             }
         } catch (Exception e) {
-            log.error("Unable to generate or send events", e);
+            log.debug("Error while dispatching observation events", e);
         } finally {
             running = null;
             synchronized (this) { notifyAll(); }
@@ -242,12 +242,17 @@ class ChangeProcessor implements Runnabl
         public void sendEvents() {
             Iterator<Event> eventIt = Iterators.concat(events.iterator());
             if (eventIt.hasNext()) {
-                listener.onEvent(new EventIteratorAdapter(eventIt) {
-                    @Override
-                    public boolean hasNext() {
-                        return !stopping && super.hasNext();
-                    }
-                });
+                try {
+                    listener.onEvent(new EventIteratorAdapter(eventIt) {
+                        @Override
+                        public boolean hasNext() {
+                            return !stopping && super.hasNext();
+                        }
+                    });
+                }
+                catch (Exception e) {
+                    log.warn("Unhandled exception in observation listener: " + listener,
e);
+                }
                 events = new ArrayList<Iterator<Event>>(PURGE_LIMIT);
             }
         }



Mime
View raw message