incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1499259 - in /sling/whiteboard/fmeschbe/deprecate_login_administrative/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal: JcrResourceResolverFactoryImpl.java helper/jcr/JcrResourceProviderFactory.java
Date Wed, 03 Jul 2013 08:39:46 GMT
Author: fmeschbe
Date: Wed Jul  3 08:39:46 2013
New Revision: 1499259

URL: http://svn.apache.org/r1499259
Log:
Implement support for service based ResourceResolver and Session access

- Adapt to new property service.info location
- Adapt to slight change in ResourceResolverFactory API

Modified:
    sling/whiteboard/fmeschbe/deprecate_login_administrative/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
    sling/whiteboard/fmeschbe/deprecate_login_administrative/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderFactory.java

Modified: sling/whiteboard/fmeschbe/deprecate_login_administrative/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/deprecate_login_administrative/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java?rev=1499259&r1=1499258&r2=1499259&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/deprecate_login_administrative/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
(original)
+++ sling/whiteboard/fmeschbe/deprecate_login_administrative/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
Wed Jul  3 08:39:46 2013
@@ -106,18 +106,18 @@ public class JcrResourceResolverFactoryI
     }
 
     /**
-     * @see org.apache.sling.api.resource.ResourceResolverFactory#getServiceResourceResolver(String)
+     * @see org.apache.sling.api.resource.ResourceResolverFactory#getServiceResourceResolver(Map)
      */
-    public ResourceResolver getServiceResourceResolver(String serviceInfo) throws LoginException
{
-        return delegatee.getServiceResourceResolver(serviceInfo);
+    public ResourceResolver getServiceResourceResolver(Map<String, Object> authenticationInfo)
throws LoginException {
+        return delegatee.getServiceResourceResolver(authenticationInfo);
     }
 
     /**
      * @see org.apache.sling.api.resource.ResourceResolverFactory#getAdministrativeResourceResolver(java.util.Map)
      */
     public ResourceResolver getAdministrativeResourceResolver(
-            final Map<String, Object> arg0) throws LoginException {
-        return delegatee.getAdministrativeResourceResolver(arg0);
+            final Map<String, Object> authenticationInfo) throws LoginException {
+        return delegatee.getAdministrativeResourceResolver(authenticationInfo);
     }
 
     /**

Modified: sling/whiteboard/fmeschbe/deprecate_login_administrative/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderFactory.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/deprecate_login_administrative/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderFactory.java?rev=1499259&r1=1499258&r2=1499259&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/deprecate_login_administrative/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderFactory.java
(original)
+++ sling/whiteboard/fmeschbe/deprecate_login_administrative/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderFactory.java
Wed Jul  3 08:39:46 2013
@@ -73,7 +73,7 @@ public class JcrResourceProviderFactory 
     /** default log */
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    private static final String REPOSITORY_REFERNENCE_NAME = "ref.repository";
+    private static final String REPOSITORY_REFERNENCE_NAME = "repository";
 
     /** The dynamic class loader */
     @Reference(cardinality = ReferenceCardinality.OPTIONAL_UNARY, policy = ReferencePolicy.DYNAMIC)
@@ -123,6 +123,20 @@ public class JcrResourceProviderFactory 
         return null;
     }
 
+    @SuppressWarnings("unused")
+    private void bindRepository(final ServiceReference ref) {
+        this.repositoryReference = ref;
+        this.repository = null; // make sure ...
+    }
+
+    @SuppressWarnings("unused")
+    private void unbindRepository(final ServiceReference ref) {
+        if (this.repositoryReference == ref) {
+            this.repositoryReference = null;
+            this.repository = null; // make sure ...
+        }
+    }
+
     /**
      * @see org.apache.sling.api.resource.ResourceProviderFactory#getResourceProvider(java.util.Map)
      */
@@ -169,8 +183,8 @@ public class JcrResourceProviderFactory 
                     final Object serviceBundleObject = authenticationInfo.get(SERVICE_BUNDLE);
                     if (serviceBundleObject instanceof Bundle) {
 
-                        final String serviceInfo = (authenticationInfo.get(SERVICE_INFO)
instanceof String)
-                                ? (String) authenticationInfo.get(SERVICE_INFO)
+                        final String serviceInfo = (authenticationInfo.get(ResourceResolverFactory.SERVICE_INFO)
instanceof String)
+                                ? (String) authenticationInfo.get(ResourceResolverFactory.SERVICE_INFO)
                                 : null;
 
                                 final BundleContext bc = ((Bundle) serviceBundleObject).getBundleContext();



Mime
View raw message