incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1345675 - in /sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal: ./ helper/jcr/
Date Sun, 03 Jun 2012 14:17:14 GMT
Author: cziegeler
Date: Sun Jun  3 14:17:14 2012
New Revision: 1345675

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

Added:
    sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/LegacyJcrResourceResolverFactoryImpl.java
  (contents, props changed)
      - copied, changed from r1345530, sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
Removed:
    sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
Modified:
    sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrItemAdapterFactory.java
    sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java

Modified: sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrItemAdapterFactory.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrItemAdapterFactory.java?rev=1345675&r1=1345674&r2=1345675&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrItemAdapterFactory.java
(original)
+++ sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrItemAdapterFactory.java
Sun Jun  3 14:17:14 2012
@@ -43,11 +43,11 @@ class JcrItemAdapterFactory implements A
 
     private final Logger logger = LoggerFactory.getLogger(JcrItemAdapterFactory.class);
 
-    private final JcrResourceResolverFactoryImpl resourceResolverFactory;
+    private final LegacyJcrResourceResolverFactoryImpl resourceResolverFactory;
 
     private ServiceRegistration serviceRegsitration;
 
-    public JcrItemAdapterFactory(BundleContext ctx, JcrResourceResolverFactoryImpl resourceResolverFactory)
{
+    public JcrItemAdapterFactory(BundleContext ctx, LegacyJcrResourceResolverFactoryImpl
resourceResolverFactory) {
         this.resourceResolverFactory = resourceResolverFactory;
         Dictionary<Object, Object> properties = new Hashtable<Object, Object>();
         properties.put(ADAPTABLE_CLASSES, new String[] { Node.class.getName(), Property.class.getName()
});

Copied: sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/LegacyJcrResourceResolverFactoryImpl.java
(from r1345530, sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java)
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/LegacyJcrResourceResolverFactoryImpl.java?p2=sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/LegacyJcrResourceResolverFactoryImpl.java&p1=sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java&r1=1345530&r2=1345675&rev=1345675&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
(original)
+++ sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/LegacyJcrResourceResolverFactoryImpl.java
Sun Jun  3 14:17:14 2012
@@ -56,7 +56,7 @@ import org.osgi.service.component.Compon
         @Property(name = Constants.SERVICE_VENDOR, value = "The Apache Software Foundation")
 
 })
-public class JcrResourceResolverFactoryImpl implements
+public class LegacyJcrResourceResolverFactoryImpl implements
         JcrResourceResolverFactory {
 
     @Reference

Propchange: sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/LegacyJcrResourceResolverFactoryImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java?rev=1345675&r1=1345674&r2=1345675&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
(original)
+++ sling/whiteboard/SLING-2396/jcr.resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
Sun Jun  3 14:17:14 2012
@@ -38,6 +38,7 @@ import javax.jcr.query.RowIterator;
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.sling.api.SlingException;
+import org.apache.sling.api.adapter.SlingAdaptable;
 import org.apache.sling.api.resource.AttributableResourceProvider;
 import org.apache.sling.api.resource.DynamicResourceProvider;
 import org.apache.sling.api.resource.QueriableResourceProvider;
@@ -57,6 +58,7 @@ import org.slf4j.LoggerFactory;
  * session for a single request.
  */
 public class JcrResourceProvider
+    extends SlingAdaptable
     implements ResourceProvider,
                DynamicResourceProvider,
                AttributableResourceProvider,
@@ -359,4 +361,16 @@ public class JcrResourceProvider
         }
         return null;
     }
+
+    /**
+     * @see org.apache.sling.api.adapter.SlingAdaptable#adaptTo(java.lang.Class)
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public <AdapterType> AdapterType adaptTo(Class<AdapterType> type) {
+        if (type == Session.class) {
+            return (AdapterType) session;
+        }
+        return super.adaptTo(type);
+    }
 }



Mime
View raw message