incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r696942 - in /incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal: JcrResourceResolverFactoryImpl.java helper/ResourceProviderEntry.java helper/jcr/JcrResourceProviderEntry.java
Date Fri, 19 Sep 2008 06:46:05 GMT
Author: fmeschbe
Date: Thu Sep 18 23:46:04 2008
New Revision: 696942

URL: http://svn.apache.org/viewvc?rev=696942&view=rev
Log:
SLING-666 Make JcrResourceProviderEntry delegate to root resource
provider entry for child entries to always use the correct list

Modified:
    incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
    incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry.java
    incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderEntry.java

Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java?rev=696942&r1=696941&r2=696942&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
(original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
Thu Sep 18 23:46:04 2008
@@ -187,7 +187,7 @@
      */
     public ResourceResolver getResourceResolver(Session session) {
         JcrResourceProviderEntry sessionRoot = new JcrResourceProviderEntry(
-            session, rootProviderEntry.getEntries(), getJcrResourceTypeProvider());
+            session, rootProviderEntry, getJcrResourceTypeProvider());
         return new JcrResourceResolver(sessionRoot, this);
     }
 

Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry.java?rev=696942&r1=696941&r2=696942&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry.java
(original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry.java
Thu Sep 18 23:46:04 2008
@@ -321,6 +321,7 @@
         if (path.equals(this.path)) {
             return getResourceProvider().getResource(resourceResolver, fullPath);
         } else if (path.startsWith(this.prefix)) {
+            ResourceProviderEntry[] entries = getEntries();
             if (entries != null) {
 
                 // consider relative path for further checks
@@ -355,6 +356,7 @@
             Set<ResourceProvider> providers) {
         if (path.startsWith(this.prefix)) {
 
+            ResourceProviderEntry[] entries = getEntries();
             if (entries != null) {
 
                 // consider relative path for further checks

Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderEntry.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderEntry.java?rev=696942&r1=696941&r2=696942&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderEntry.java
(original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderEntry.java
Thu Sep 18 23:46:04 2008
@@ -20,20 +20,24 @@
 
 import javax.jcr.Session;
 
+import org.apache.sling.api.resource.ResourceProvider;
 import org.apache.sling.jcr.resource.JcrResourceTypeProvider;
 import org.apache.sling.jcr.resource.internal.helper.ResourceProviderEntry;
 
 public class JcrResourceProviderEntry extends ResourceProviderEntry {
 
+    private final ResourceProviderEntry delegatee;
+
     private final Session session;
 
     private final JcrResourceTypeProvider[] resourceTypeProviders;
-
+    
     public JcrResourceProviderEntry(Session session,
-                                    ResourceProviderEntry[] entries,
+                                    ResourceProviderEntry delegatee,
                                     JcrResourceTypeProvider[] resourceTypeProviders) {
-        super("/", new JcrResourceProvider(session, resourceTypeProviders), entries);
+        super("/", new JcrResourceProvider(session, resourceTypeProviders), null);
 
+        this.delegatee = delegatee;
         this.session = session;
         this.resourceTypeProviders = resourceTypeProviders;
     }
@@ -45,4 +49,19 @@
     public JcrResourceTypeProvider[] getResourceTypeProviders() {
         return resourceTypeProviders;
     }
+    
+    @Override
+    public ResourceProviderEntry[] getEntries() {
+        return delegatee.getEntries();
+    }
+
+    @Override
+    public boolean addResourceProvider(String prefix, ResourceProvider provider) {
+        return delegatee.addResourceProvider(prefix, provider);
+    }
+    
+    @Override
+    public boolean removeResourceProvider(String prefix) {
+        return delegatee.removeResourceProvider(prefix);
+    }
 }



Mime
View raw message