incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1346020 - in /sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper: ResourceIterator.java ResourceProviderFactoryHandler.java SortedProviderList.java
Date Mon, 04 Jun 2012 15:49:39 GMT
Author: cziegeler
Date: Mon Jun  4 15:49:39 2012
New Revision: 1346020

URL: http://svn.apache.org/viewvc?rev=1346020&view=rev
Log:
SLING-2396 : Add new resource provider interfaces (WiP)

Modified:
    sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceIterator.java
    sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceProviderFactoryHandler.java
    sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/SortedProviderList.java

Modified: sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceIterator.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceIterator.java?rev=1346020&r1=1346019&r2=1346020&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceIterator.java
(original)
+++ sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceIterator.java
Mon Jun  4 15:49:39 2012
@@ -138,7 +138,7 @@ public class ResourceIterator implements
 
         if (log.isDebugEnabled()) {
             log.debug(" Provider Set for path {} {} ", path, Arrays
-                            .toString(providersSet.toArray(new ResourceProvider[0])));
+                            .toString(providersSet.toArray(new ProviderHandler[providersSet.size()])));
         }
         this.iteratorPath = path;
         providers = providersSet.iterator();
@@ -260,7 +260,7 @@ public class ResourceIterator implements
     /**
      * Returns all resource providers which provider resources whose prefix is
      * the given path.
-     * 
+     *
      * @param path
      *            The prefix path to match the resource provider roots against
      * @param providers

Modified: sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceProviderFactoryHandler.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceProviderFactoryHandler.java?rev=1346020&r1=1346019&r2=1346020&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceProviderFactoryHandler.java
(original)
+++ sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceProviderFactoryHandler.java
Mon Jun  4 15:49:39 2012
@@ -77,7 +77,7 @@ public class ResourceProviderFactoryHand
      * @param ctx The user context.
      * @return A resource provider or <code>null</code>
      */
-    private ResourceProvider getResourceProvider(final ResourceResolverContext ctx) {
+    public ResourceProvider getResourceProvider(final ResourceResolverContext ctx) {
         ResourceProvider rp = ctx.getFactoryResourceProvider(this.getServiceId());
         if ( rp == null ) {
             try {

Modified: sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/SortedProviderList.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/SortedProviderList.java?rev=1346020&r1=1346019&r2=1346020&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/SortedProviderList.java
(original)
+++ sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/SortedProviderList.java
Mon Jun  4 15:49:39 2012
@@ -24,8 +24,6 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.NoSuchElementException;
 
-import org.apache.sling.api.resource.LoginException;
-
 // TODO - Implement sorting
 public class SortedProviderList<T> {
 
@@ -56,13 +54,9 @@ public class SortedProviderList<T> {
                     result = list[this.index];
                     this.index++;
                     if ( result instanceof ResourceProviderFactoryHandler ) {
-                        try {
-                            result = ((ResourceProviderFactoryHandler)result).login(ctx);
-                            if ( !genericClass.isAssignableFrom(result.getClass())) {
-                                result = null;
-                            }
-                        } catch (final LoginException e) {
-                            // TODO Should we log?
+                        result = ((ResourceProviderFactoryHandler)result).getResourceProvider(ctx);
+                        if ( !genericClass.isAssignableFrom(result.getClass())) {
+                            result = null;
                         }
                         if ( result == null ) {
                             result = seek();



Mime
View raw message