sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1765444 - in /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal: JcrResourceListener.java helper/jcr/JcrResourceProvider.java
Date Tue, 18 Oct 2016 14:21:11 GMT
Author: cziegeler
Date: Tue Oct 18 14:21:10 2016
New Revision: 1765444

URL: http://svn.apache.org/viewvc?rev=1765444&view=rev
Log:
SLING-6056 : achieve 1:1 mapping between observation and resource change listener

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java?rev=1765444&r1=1765443&r2=1765444&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java
Tue Oct 18 14:21:10 2016
@@ -52,7 +52,7 @@ import org.apache.sling.spi.resource.pro
  */
 public class JcrResourceListener implements EventListener, Closeable {
 
-    private final ObserverConfiguration config;
+    private volatile ObserverConfiguration config;
 
     private final JcrListenerBaseConfig baseConfig;
 
@@ -64,6 +64,10 @@ public class JcrResourceListener impleme
         this.baseConfig.register(this, config);
     }
 
+    public void update(final ObserverConfiguration cfg) {
+        this.config = cfg;
+    }
+
     /**
      * Dispose this listener.
      */
@@ -174,4 +178,5 @@ public class JcrResourceListener impleme
     public String toString() {
         return "JcrResourceListener [" + config + "]";
     }
+
 }

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java?rev=1765444&r1=1765443&r2=1765444&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
Tue Oct 18 14:21:10 2016
@@ -249,6 +249,8 @@ public class JcrResourceProvider extends
                     Closeable listener = oldMap.remove(config);
                     if ( listener == null ) {
                         listener = new JcrResourceListener(this.listenerConfig, config);
+                    } else {
+                        ((JcrResourceListener)listener).update(config);
                     }
                     this.listeners.put(config, listener);
                 }



Mime
View raw message