Author: fmeschbe
Date: Tue Dec 18 03:40:12 2007
New Revision: 605188

URL: http://svn.apache.org/viewvc?rev=605188&view=rev
Log:
SLING-134 Rename JcrResourceManagerFactory to JcrResourceResolverFactory
and adapt the implementations to read JcrResourceResolver* instead
of JcrResourceManager*.

Added:
    
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceResolverFactory.java
      - copied, changed from r605136, 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceManagerFactory.java
    
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
      - copied, changed from r605136, 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceManager.java
    
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
      - copied, changed from r605136, 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceManagerFactoryImpl.java
    
incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverTest.java
      - copied, changed from r605136, 
incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceManagerTest.java
Removed:
    
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceManagerFactory.java
    
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceManager.java
    
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceManagerFactoryImpl.java
    
incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceManagerTest.java
Modified:
    
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/Mapping.java
    
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProvider.java
    
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/bundle/BundleResourceProvider.java
    
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
    
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResourceIterator.java
    
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/loader/Loader.java
    
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/ObjectContentManagerFactory.java
    
incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntryTest.java

Copied: 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceResolverFactory.java
 (from r605136, 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceManagerFactory.java)
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceResolverFactory.java?p2=incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceResolverFactory.java&p1=incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceManagerFactory.java&r1=605136&r2=605188&rev=605188&view=diff
==============================================================================
--- 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceManagerFactory.java
 (original)
+++ 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceResolverFactory.java
 Tue Dec 18 03:40:12 2007
@@ -21,28 +21,28 @@
 import javax.jcr.Session;
 
 import org.apache.sling.api.SlingException;
-import org.apache.sling.api.resource.ResourceManager;
+import org.apache.sling.api.resource.ResourceResolver;
 
 /**
- * The <code>JcrResourceManagerFactory</code> interface defines the service
- * interface to have JCR-based <code>ResourceManager</code> instances created
+ * The <code>JcrResourceResolverFactory</code> interface defines the service
+ * interface to have JCR-based <code>ResourceResolver</code> instances created
  * for JCR sessions.
  * <p>
  * This interface is not intended to be implemented by client applications. It
  * is implemented by this bundle and the implementation registered as a service
  * for use by client applications.
  */
-public interface JcrResourceManagerFactory {
+public interface JcrResourceResolverFactory {
 
     /**
-     * Returns a <code>ResourceManager</code> for the given session. Calling
+     * Returns a <code>ResourceResolver</code> for the given session. Calling
      * this method repeatedly returns a new instance on each call.
-     *
+     * 
      * @param session The JCR <code>Session</code> used by the created
      *            resource manager to access the repository.
      * @throws SlingException May be thrown if an error occurrs setting up the
-     *             <code>ResourceManager</code>.
+     *             <code>ResourceResolver</code>.
      */
-    ResourceManager getResourceManager(Session session) throws SlingException;
+    ResourceResolver getResourceResolver(Session session) throws 
SlingException;
 
 }

Copied: 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
 (from r605136, 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceManager.java)
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java?p2=incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java&p1=incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceManager.java&r1=605136&r2=605188&rev=605188&view=diff
==============================================================================
--- 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceManager.java
 (original)
+++ 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
 Tue Dec 18 03:40:12 2007
@@ -41,8 +41,8 @@
 import org.apache.sling.api.SlingException;
 import org.apache.sling.api.resource.NonExistingResource;
 import org.apache.sling.api.resource.Resource;
-import org.apache.sling.api.resource.ResourceManager;
 import org.apache.sling.api.resource.ResourceMetadata;
+import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.jcr.resource.DefaultMappedObject;
 import org.apache.sling.jcr.resource.JcrResourceUtil;
 import org.apache.sling.jcr.resource.PathResolver;
@@ -56,14 +56,14 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * The <code>JcrResourceManager</code> class implements the Sling
+ * The <code>JcrResourceResolver</code> class implements the Sling
  * <code>ResourceManager</code> and <code>ResourceResolver</code> interfaces
  * and in addition is a [EMAIL PROTECTED] PathResolver}. Instances of this 
class are
  * retrieved through the
- * [EMAIL PROTECTED] 
org.apache.sling.jcr.resource.JcrResourceManagerFactory#getResourceManager(Session)}
+ * [EMAIL PROTECTED] 
org.apache.sling.jcr.resource.JcrResourceResolverFactory#getResourceManager(Session)}
  * method.
  */
-public class JcrResourceManager implements ResourceManager, PathResolver {
+public class JcrResourceResolver implements ResourceResolver, PathResolver {
 
     /** default log */
     private final Logger log = LoggerFactory.getLogger(getClass());
@@ -84,13 +84,13 @@
 
     protected static final String ACTION_REMOVE = "remove";
 
-    private final JcrResourceManagerFactoryImpl factory;
+    private final JcrResourceResolverFactoryImpl factory;
 
     private final Session session;
 
     private ObjectContentManager objectContentManager;
 
-    public JcrResourceManager(JcrResourceManagerFactoryImpl factory,
+    public JcrResourceResolver(JcrResourceResolverFactoryImpl factory,
             Session session) {
         this.factory = factory;
         this.session = session;
@@ -206,6 +206,20 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
+    public <AdapterType> AdapterType adaptTo(Class<AdapterType> type) {
+        if (type.isInstance(getSession())) {
+            return (AdapterType) getSession();
+        } else if (type.isInstance(objectContentManager)) {
+            return (AdapterType) objectContentManager;
+        } else if (type == PathResolver.class) {
+            return (AdapterType) this;
+        }
+        
+        // no adapter available
+        return null;
+    }
+    
     // ---------- PathResolver interface --------------------------------------
 
     /**
@@ -234,7 +248,8 @@
         try {
 
             // translate url to a mapped url structure
-            return transformURL(uri);
+            Resource result = transformURL(uri);
+            return result;
 
         } catch (AccessControlException ace) {
             // rethrow AccessControlExceptions to be handled
@@ -529,6 +544,16 @@
 
             Resource resource = scanPath(mappedUri);
             if (resource != null) {
+                
+                ResourceMetadata rm = resource.getResourceMetadata();
+                String path = (String) 
rm.get(ResourceMetadata.RESOLUTION_PATH);
+                String uriPath = mappings[i].mapHandle(path);
+                if (uriPath != null && !uriPath.equals(path)) {
+                    resource.getResourceMetadata().put(
+                        ResourceMetadata.RESOLUTION_PATH, uriPath);
+                }
+
+
                 return resource;
             }
 

Copied: 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
 (from r605136, 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceManagerFactoryImpl.java)
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java?p2=incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java&p1=incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceManagerFactoryImpl.java&r1=605136&r2=605188&rev=605188&view=diff
==============================================================================
--- 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceManagerFactoryImpl.java
 (original)
+++ 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
 Tue Dec 18 03:40:12 2007
@@ -34,10 +34,10 @@
 import org.apache.commons.collections.bidimap.TreeBidiMap;
 import org.apache.jackrabbit.ocm.manager.ObjectContentManager;
 import org.apache.sling.api.resource.Resource;
-import org.apache.sling.api.resource.ResourceManager;
+import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.commons.mime.MimeTypeService;
 import org.apache.sling.jcr.api.SlingRepository;
-import org.apache.sling.jcr.resource.JcrResourceManagerFactory;
+import org.apache.sling.jcr.resource.JcrResourceResolverFactory;
 import org.apache.sling.jcr.resource.internal.helper.Mapping;
 import org.apache.sling.jcr.resource.internal.helper.ResourceProvider;
 import org.apache.sling.jcr.resource.internal.helper.ResourceProviderEntry;
@@ -57,25 +57,25 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * The <code>JcrResourceManagerFactoryImpl</code> is the
- * [EMAIL PROTECTED] JcrResourceManagerFactory} service providing the following
+ * The <code>JcrResourceResolverFactoryImpl</code> is the
+ * [EMAIL PROTECTED] JcrResourceResolverFactory} service providing the 
following
  * functionality:
  * <ul>
- * <li><code>JcrResourceManagerFactory</code> service
+ * <li><code>JcrResourceResolverFactory</code> service
  * <li>Bundle listener to load initial content and manage OCM mapping
  * descriptors provided by bundles.
  * <li>Fires OSGi EventAdmin events on behalf of internal helper objects
  * </ul>
- *
+ * 
  * @scr.component immediate="true" label="%resource.resolver.name"
  *                description="%resource.resolver.description"
  * @scr.property name="service.description" value="Sling
- *               JcrResourceManagerFactory Implementation"
+ *               JcrResourceResolverFactory Implementation"
  * @scr.property name="service.vendor" value="The Apache Software Foundation"
- * @scr.service 
interface="org.apache.sling.jcr.resource.JcrResourceManagerFactory"
+ * @scr.service 
interface="org.apache.sling.jcr.resource.JcrResourceResolverFactory"
  */
-public class JcrResourceManagerFactoryImpl implements
-        JcrResourceManagerFactory, SynchronousBundleListener, ResourceProvider 
{
+public class JcrResourceResolverFactoryImpl implements
+        JcrResourceResolverFactory, SynchronousBundleListener, 
ResourceProvider {
 
     /**
      * @scr.property value="true" type="Boolean"
@@ -87,7 +87,7 @@
      * maven plugin and the sling management console cannot handle empty
      * multivalue properties at the moment. So we just add a dummy direct
      * mapping.
-     *
+     * 
      * @scr.property values.1="/-/"
      */
     private static final String PROP_VIRTUAL = "resource.resolver.virtual";
@@ -105,14 +105,14 @@
 
     /**
      * The JCR Repository we access to resolve resources
-     *
+     * 
      * @scr.reference
      */
     private SlingRepository repository;
 
     /**
      * The OSGi EventAdmin service used to dispatch events
-     *
+     * 
      * @scr.reference cardinality="0..1" policy="dynamic"
      */
     private EventAdmin eventAdmin;
@@ -120,7 +120,7 @@
     /**
      * The MimeTypeService used by the initial content initialContentLoader to
      * resolve MIME types for files to be installed.
-     *
+     * 
      * @scr.reference cardinality="0..1" policy="dynamic"
      */
     private MimeTypeService mimeTypeService;
@@ -144,14 +144,14 @@
      * Map of administrative sessions used to check item existence. Indexed by
      * workspace name. The map is filled on-demand. The sessions are closed 
when
      * the factory is deactivated.
-     *
+     * 
      * @see #itemReallyExists(Session, String)
      */
     private Map<String, Session> adminSessions = new HashMap<String, 
Session>();
 
     /**
      * The [EMAIL PROTECTED] ObjectContentManagerFactory} used retrieve object 
content
-     * managers on-demand on behalf of [EMAIL PROTECTED] JcrResourceManager} 
instances.
+     * managers on-demand on behalf of [EMAIL PROTECTED] JcrResourceResolver} 
instances.
      */
     private ObjectContentManagerFactory objectContentManagerFactory;
 
@@ -165,21 +165,21 @@
 
     private Map<Long, BundleResourceProvider> bundleResourceProviderMap = new 
HashMap<Long, BundleResourceProvider>();
 
-    public JcrResourceManagerFactoryImpl() {
+    public JcrResourceResolverFactoryImpl() {
         this.rootProviderEntry = new ResourceProviderEntry("/", this);
     }
 
-    // ---------- JcrResourceManagerFactory 
------------------------------------
+    // ---------- JcrResourceResolverFactory 
-----------------------------------
 
     /**
-     * Returns a new <code>ResourceManager</code> for the given session. Note
+     * Returns a new <code>ResourceResolve</code> for the given session. Note
      * that each call to this method returns a new resource manager instance.
      * The resource manager returned also implements the
      * [EMAIL PROTECTED] org.apache.sling.jcr.resource.PathResolver} interface 
to which it
      * may be cast.
      */
-    public ResourceManager getResourceManager(Session session) {
-        return new JcrResourceManager(this, session);
+    public ResourceResolver getResourceResolver(Session session) {
+        return new JcrResourceResolver(this, session);
     }
 
     // ---------- BundleListener 
-----------------------------------------------
@@ -188,7 +188,7 @@
      * Loads and unloads any components provided by the bundle whose state
      * changed. If the bundle has been started, the components are loaded. If
      * the bundle is about to stop, the components are unloaded.
-     *
+     * 
      * @param event The <code>BundleEvent</code> representing the bundle state
      *            change.
      */
@@ -238,7 +238,7 @@
         return new String[] { "/" };
     }
 
-    public Resource getResource(JcrResourceManager jcrResourceManager,
+    public Resource getResource(JcrResourceResolver jcrResourceManager,
             String path) throws RepositoryException {
 
         if (jcrResourceManager.itemExists(path)) {
@@ -253,7 +253,7 @@
 
     /**
      * Fires an OSGi event through the EventAdmin service.
-     *
+     * 
      * @param sourceBundle The Bundle from which the event originates. This may
      *            be <code>null</code> if there is no originating bundle.
      * @param eventName The name of the event
@@ -271,7 +271,7 @@
         // get a private copy of the properties
         Dictionary<String, Object> table = new Hashtable<String, 
Object>(props);
 
-        // service information of this JcrResourceManagerFactoryImpl service
+        // service information of this JcrResourceResolverFactoryImpl service
         ServiceReference sr = serviceReference;
         if (sr != null) {
             table.put(EventConstants.SERVICE, sr);
@@ -301,12 +301,12 @@
 
     // ---------- Implementation helpers --------------------------------------
 
-    /** return the ObjectContentManager, used by JcrResourceManager */
+    /** return the ObjectContentManager, used by JcrResourceResolver */
     ObjectContentManager getObjectContentManager(Session session) {
         return objectContentManagerFactory.getObjectContentManager(session);
     }
 
-    /** check existence of an item with admin session, used by 
JcrResourceManager */
+    /** check existence of an item with admin session, used by 
JcrResourceResolver */
     boolean itemReallyExists(Session clientSession, String path)
             throws RepositoryException {
 

Modified: 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/Mapping.java
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/Mapping.java?rev=605188&r1=605187&r2=605188&view=diff
==============================================================================
--- 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/Mapping.java
 (original)
+++ 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/Mapping.java
 Tue Dec 18 03:40:12 2007
@@ -23,7 +23,7 @@
 /**
  * The <code>Mapping</code> class conveys the mapping configuration used by
  * the
- * [EMAIL PROTECTED] 
org.apache.sling.jcr.resource.internal.JcrResourceManagerFactoryImpl}.
+ * [EMAIL PROTECTED] 
org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl}.
  */
 public class Mapping {
 

Modified: 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProvider.java
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProvider.java?rev=605188&r1=605187&r2=605188&view=diff
==============================================================================
--- 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProvider.java
 (original)
+++ 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProvider.java
 Tue Dec 18 03:40:12 2007
@@ -19,16 +19,16 @@
 package org.apache.sling.jcr.resource.internal.helper;
 
 import org.apache.sling.api.resource.Resource;
-import org.apache.sling.jcr.resource.internal.JcrResourceManager;
+import org.apache.sling.jcr.resource.internal.JcrResourceResolver;
 
 /**
- * API for providers of resources. Used by the [EMAIL PROTECTED] 
JcrResourceManager} and
- * [EMAIL PROTECTED] 
org.apache.sling.jcr.resource.internal.JcrResourceManagerFactoryImpl}
+ * API for providers of resources. Used by the [EMAIL PROTECTED] 
JcrResourceResolver} and
+ * [EMAIL PROTECTED] 
org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl}
  * classes to transparently access resources from different locations such as a
  * JCR repository (the default) or OSGi bundles.
  * <p>
  * This is an internal interface not available outside this bundle. It refers 
to
- * the internal [EMAIL PROTECTED] JcrResourceManager} class, which is also not 
visible from
+ * the internal [EMAIL PROTECTED] JcrResourceResolver} class, which is also 
not visible from
  * outside of this bundle.
  */
 public interface ResourceProvider {
@@ -47,7 +47,7 @@
      * @throws Exception may be thrown in case of any problem creating the
      *             <code>Resource</code> instance.
      */
-    Resource getResource(JcrResourceManager jcrResourceManager, String path)
+    Resource getResource(JcrResourceResolver jcrResourceManager, String path)
             throws Exception;
 
 }

Modified: 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/bundle/BundleResourceProvider.java
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/bundle/BundleResourceProvider.java?rev=605188&r1=605187&r2=605188&view=diff
==============================================================================
--- 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/bundle/BundleResourceProvider.java
 (original)
+++ 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/bundle/BundleResourceProvider.java
 Tue Dec 18 03:40:12 2007
@@ -23,7 +23,7 @@
 import java.util.StringTokenizer;
 
 import org.apache.sling.api.resource.Resource;
-import org.apache.sling.jcr.resource.internal.JcrResourceManager;
+import org.apache.sling.jcr.resource.internal.JcrResourceResolver;
 import org.apache.sling.jcr.resource.internal.helper.ResourceProvider;
 import org.osgi.framework.Bundle;
 
@@ -61,10 +61,10 @@
 
     /**
      * Returns a BundleResource for the path if such an entry exists in the
-     * bundle of this provider. The JcrResourceManager is ignored by this
+     * bundle of this provider. The JcrResourceResolver is ignored by this
      * implementation.
      */
-    public Resource getResource(JcrResourceManager jrm, String path) {
+    public Resource getResource(JcrResourceResolver jrm, String path) {
         return BundleResource.getResource(bundle, path);
     }
 

Modified: 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java?rev=605188&r1=605187&r2=605188&view=diff
==============================================================================
--- 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
 (original)
+++ 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
 Tue Dec 18 03:40:12 2007
@@ -39,7 +39,7 @@
 import org.apache.jackrabbit.net.URLFactory;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceMetadata;
-import org.apache.sling.jcr.resource.internal.JcrResourceManager;
+import org.apache.sling.jcr.resource.internal.JcrResourceResolver;
 import org.apache.sling.jcr.resource.internal.helper.Descendable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -55,7 +55,7 @@
     /** The relative path name of the data property of an nt:file node */
     private static final String FILE_DATA_PROP = JCR_CONTENT + "/" + JCR_DATA;
 
-    private final JcrResourceManager resourceManager;
+    private final JcrResourceResolver resourceManager;
 
     private final Node node;
 
@@ -69,7 +69,7 @@
 
     private final ResourceMetadata metadata;
 
-    public JcrNodeResource(JcrResourceManager cMgr, String path)
+    public JcrNodeResource(JcrResourceResolver cMgr, String path)
             throws RepositoryException {
         this.resourceManager = cMgr;
         node = (Node) cMgr.getSession().getItem(path);
@@ -81,7 +81,7 @@
         setMetaData(node, metadata);
     }
 
-    public JcrNodeResource(JcrResourceManager resourceManager, Node node)
+    public JcrNodeResource(JcrResourceResolver resourceManager, Node node)
             throws RepositoryException {
         this.resourceManager = resourceManager;
         this.node = node;
@@ -126,7 +126,7 @@
         return "JcrNodeResource, type=" + resourceType + ", path=" + path;
     }
 
-    JcrResourceManager getResourceManager() {
+    JcrResourceResolver getResourceManager() {
         return resourceManager;
     }
 

Modified: 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResourceIterator.java
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResourceIterator.java?rev=605188&r1=605187&r2=605188&view=diff
==============================================================================
--- 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResourceIterator.java
 (original)
+++ 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResourceIterator.java
 Tue Dec 18 03:40:12 2007
@@ -25,7 +25,7 @@
 import javax.jcr.RepositoryException;
 
 import org.apache.sling.api.resource.Resource;
-import org.apache.sling.jcr.resource.internal.JcrResourceManager;
+import org.apache.sling.jcr.resource.internal.JcrResourceResolver;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -41,7 +41,7 @@
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     /** resource manager used to create resources from nodes */
-    private JcrResourceManager resourceManager;
+    private JcrResourceResolver resourceManager;
 
     /** underlying node iterator to be used for resources */
     private NodeIterator nodes;
@@ -68,7 +68,7 @@
         }
     }
 
-    public JcrNodeResourceIterator(JcrResourceManager resourceManager,
+    public JcrNodeResourceIterator(JcrResourceResolver resourceManager,
             NodeIterator nodes) {
         this.resourceManager = resourceManager;
         this.nodes = nodes;

Modified: 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/loader/Loader.java
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/loader/Loader.java?rev=605188&r1=605187&r2=605188&view=diff
==============================================================================
--- 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/loader/Loader.java
 (original)
+++ 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/loader/Loader.java
 Tue Dec 18 03:40:12 2007
@@ -41,7 +41,7 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
-import org.apache.sling.jcr.resource.internal.JcrResourceManagerFactoryImpl;
+import org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl;
 import org.osgi.framework.Bundle;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -60,7 +60,7 @@
     /** default log */
     private static final Logger log = LoggerFactory.getLogger(Loader.class);
 
-    private JcrResourceManagerFactoryImpl jcrContentHelper;
+    private JcrResourceResolverFactoryImpl jcrContentHelper;
     private XmlReader xmlReader;
     private JsonReader jsonReader;
     private Map<String, List<String>> delayedReferences;
@@ -68,7 +68,7 @@
     // bundles whose registration failed and should be retried
     private List<Bundle> delayedBundles;
 
-    public Loader(JcrResourceManagerFactoryImpl jcrContentHelper) {
+    public Loader(JcrResourceResolverFactoryImpl jcrContentHelper) {
         this.jcrContentHelper = jcrContentHelper;
         this.delayedReferences = new HashMap<String, List<String>>();
         this.delayedBundles = new LinkedList<Bundle>();

Modified: 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/ObjectContentManagerFactory.java
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/ObjectContentManagerFactory.java?rev=605188&r1=605187&r2=605188&view=diff
==============================================================================
--- 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/ObjectContentManagerFactory.java
 (original)
+++ 
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/ObjectContentManagerFactory.java
 Tue Dec 18 03:40:12 2007
@@ -49,7 +49,7 @@
 import org.apache.jackrabbit.ocm.query.impl.QueryManagerImpl;
 import org.apache.jackrabbit.ocm.reflection.ReflectionUtils;
 import org.apache.jackrabbit.value.ValueFactoryImpl;
-import org.apache.sling.jcr.resource.internal.JcrResourceManagerFactoryImpl;
+import org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl;
 import 
org.apache.sling.jcr.resource.internal.mapping.classloader.MapperClassLoader;
 import org.osgi.framework.Bundle;
 import org.slf4j.Logger;
@@ -64,7 +64,7 @@
     /** default log */
     private static final Logger log = 
LoggerFactory.getLogger(ObjectContentManagerFactory.class);
 
-    private JcrResourceManagerFactoryImpl jcrResourceManagerFactory;
+    private JcrResourceResolverFactoryImpl jcrResourceManagerFactory;
 
     /**
      * The class loader used by the Jackrabbit OCM ReflectionUtils class to 
load
@@ -82,7 +82,7 @@
     private AtomicTypeConverterProvider converterProvider;
 
     public ObjectContentManagerFactory(
-            JcrResourceManagerFactoryImpl jcrResourceManagerFactory) {
+            JcrResourceResolverFactoryImpl jcrResourceManagerFactory) {
         this.jcrResourceManagerFactory = jcrResourceManagerFactory;
 
         // prepare the data converters and query manager

Copied: 
incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverTest.java
 (from r605136, 
incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceManagerTest.java)
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverTest.java?p2=incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverTest.java&p1=incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceManagerTest.java&r1=605136&r2=605188&rev=605188&view=diff
==============================================================================
--- 
incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceManagerTest.java
 (original)
+++ 
incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverTest.java
 Tue Dec 18 03:40:12 2007
@@ -39,13 +39,13 @@
 import org.apache.sling.api.SlingConstants;
 import org.apache.sling.api.resource.NonExistingResource;
 import org.apache.sling.api.resource.Resource;
-import org.apache.sling.api.resource.ResourceManager;
+import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.jcr.resource.JcrResourceConstants;
 import org.apache.sling.jcr.resource.internal.helper.Mapping;
 import org.apache.sling.jcr.resource.testhelper.RepositoryUtil;
 
-public class JcrResourceManagerTest extends TestCase {
+public class JcrResourceResolverTest extends TestCase {
 
     private Session session;
 
@@ -53,13 +53,13 @@
 
     private Node rootNode;
 
-    private ResourceManager resMgr;
+    private ResourceResolver resResolver;
 
     protected void setUp() throws Exception {
         RepositoryUtil.startRepository();
         SlingRepository repository = RepositoryUtil.getRepository();
 
-        JcrResourceManagerFactoryImpl resFac = new 
JcrResourceManagerFactoryImpl();
+        JcrResourceResolverFactoryImpl resFac = new 
JcrResourceResolverFactoryImpl();
 
         Field repoField = resFac.getClass().getDeclaredField("repository");
         repoField.setAccessible(true);
@@ -79,7 +79,7 @@
             // don't care for now
         }
 
-        resMgr = resFac.getResourceManager(session);
+        resResolver = resFac.getResourceResolver(session);
 
         root = "/test" + System.currentTimeMillis();
         rootNode = session.getRootNode().addNode(root.substring(1),
@@ -103,7 +103,7 @@
 
     public void testGetResource() throws Exception {
         // existing resource
-        Resource res = resMgr.getResource(root);
+        Resource res = resResolver.getResource(root);
         assertNotNull(res);
         assertEquals(root, res.getURI());
         assertEquals(rootNode.getPrimaryNodeType().getName(),
@@ -114,13 +114,13 @@
 
         // missing resource
         String path = root + "/missing";
-        res = resMgr.getResource(path);
+        res = resResolver.getResource(path);
         assertNull(res);
     }
 
     public void testResolveResource() throws Exception {
         // existing resource
-        Resource res = resMgr.resolve(new ResourceManagerTestRequest(root));
+        Resource res = resResolver.resolve(new 
ResourceManagerTestRequest(root));
         assertNotNull(res);
         assertEquals(root, res.getURI());
         assertEquals(rootNode.getPrimaryNodeType().getName(),
@@ -131,7 +131,7 @@
 
         // missing resource below root should resolve root
         String path = root + "/missing";
-        res = resMgr.resolve(new ResourceManagerTestRequest(path));
+        res = resResolver.resolve(new ResourceManagerTestRequest(path));
         assertNotNull(res);
         assertEquals(root, res.getURI());
         assertEquals(rootNode.getPrimaryNodeType().getName(),
@@ -142,7 +142,7 @@
 
         // root with selectors/ext should resolve root
         path = root + ".print.a4.html";
-        res = resMgr.resolve(new ResourceManagerTestRequest(path));
+        res = resResolver.resolve(new ResourceManagerTestRequest(path));
         assertNotNull(res);
         assertEquals(root, res.getURI());
         assertEquals(rootNode.getPrimaryNodeType().getName(),
@@ -153,7 +153,7 @@
 
         // missing resource should return NON_EXISTING Resource
         path = root + System.currentTimeMillis();
-        res = resMgr.resolve(new ResourceManagerTestRequest(path));
+        res = resResolver.resolve(new ResourceManagerTestRequest(path));
         assertNotNull(res);
         assertTrue(res instanceof NonExistingResource);
         assertEquals(path, res.getURI());

Modified: 
incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntryTest.java
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntryTest.java?rev=605188&r1=605187&r2=605188&view=diff
==============================================================================
--- 
incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntryTest.java
 (original)
+++ 
incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntryTest.java
 Tue Dec 18 03:40:12 2007
@@ -21,7 +21,7 @@
 import junit.framework.TestCase;
 
 import org.apache.sling.api.resource.Resource;
-import org.apache.sling.jcr.resource.internal.JcrResourceManager;
+import org.apache.sling.jcr.resource.internal.JcrResourceResolver;
 import org.apache.sling.jcr.resource.internal.helper.ResourceProvider;
 import org.apache.sling.jcr.resource.internal.helper.ResourceProviderEntry;
 
@@ -157,7 +157,7 @@
             roots = new String[] { root };
         }
 
-        public Resource getResource(JcrResourceManager jcrResourceManager, 
String path) {
+        public Resource getResource(JcrResourceResolver jcrResourceManager, 
String path) {
             return null;
         }
 


Reply via email to