Author: fmeschbe
Date: Tue Dec 18 03:45:41 2007
New Revision: 605191
URL: http://svn.apache.org/viewvc?rev=605191&view=rev
Log:
SLING-134 Remove all notions of ResourceManager and replace by ResourceResolver
Modified:
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
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/ResourceProvider.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/mapping/ObjectContentManagerFactory.java
incubator/sling/trunk/jcr/resource/src/main/resources/OSGI-INF/metatype/metatype.properties
incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverTest.java
incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntryTest.java
Modified:
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
URL:
http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java?rev=605191&r1=605190&r2=605191&view=diff
==============================================================================
---
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
(original)
+++
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
Tue Dec 18 03:45:41 2007
@@ -57,10 +57,10 @@
/**
* The <code>JcrResourceResolver</code> class implements the Sling
- * <code>ResourceManager</code> and <code>ResourceResolver</code> interfaces
+ * <code>ResourceResolver</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.JcrResourceResolverFactory#getResourceManager(Session)}
+ * [EMAIL PROTECTED]
org.apache.sling.jcr.resource.JcrResourceResolverFactory#getResourceResolver(Session)}
* method.
*/
public class JcrResourceResolver implements ResourceResolver, PathResolver {
@@ -304,7 +304,7 @@
return href;
}
- // ---------- ResourceManager interface -----------------------------------
+ // ---------- former ResourceManager interface
-----------------------------------
/**
* @throws AccessControlException If this manager has does not have enough
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=605191&r1=605190&r2=605191&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
Tue Dec 18 03:45:41 2007
@@ -238,12 +238,12 @@
return new String[] { "/" };
}
- public Resource getResource(JcrResourceResolver jcrResourceManager,
+ public Resource getResource(JcrResourceResolver jcrResourceResolver,
String path) throws RepositoryException {
- if (jcrResourceManager.itemExists(path)) {
+ if (jcrResourceResolver.itemExists(path)) {
log.info("getResource: Found JCR Node Resource at path '{}'",
path);
- return new JcrNodeResource(jcrResourceManager, path);
+ return new JcrNodeResource(jcrResourceResolver, path);
}
return null;
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=605191&r1=605190&r2=605191&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:45:41 2007
@@ -47,7 +47,7 @@
* @throws Exception may be thrown in case of any problem creating the
* <code>Resource</code> instance.
*/
- Resource getResource(JcrResourceResolver jcrResourceManager, String path)
+ Resource getResource(JcrResourceResolver jcrResourceResolver, String path)
throws Exception;
}
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=605191&r1=605190&r2=605191&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:45:41 2007
@@ -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 JcrResourceResolver resourceManager;
+ private final JcrResourceResolver resourceResolver;
private final Node node;
@@ -71,7 +71,7 @@
public JcrNodeResource(JcrResourceResolver cMgr, String path)
throws RepositoryException {
- this.resourceManager = cMgr;
+ this.resourceResolver = cMgr;
node = (Node) cMgr.getSession().getItem(path);
this.path = node.getPath();
metadata = new ResourceMetadata();
@@ -81,9 +81,9 @@
setMetaData(node, metadata);
}
- public JcrNodeResource(JcrResourceResolver resourceManager, Node node)
+ public JcrNodeResource(JcrResourceResolver resourceResolver, Node node)
throws RepositoryException {
- this.resourceManager = resourceManager;
+ this.resourceResolver = resourceResolver;
this.node = node;
this.path = node.getPath();
metadata = new ResourceMetadata();
@@ -126,8 +126,8 @@
return "JcrNodeResource, type=" + resourceType + ", path=" + path;
}
- JcrResourceResolver getResourceManager() {
- return resourceManager;
+ JcrResourceResolver getResourceResolver() {
+ return resourceResolver;
}
Node getNode() {
@@ -162,7 +162,7 @@
private Object getObject() {
if (object == UNDEFINED) {
// lazy loaded object
- object = resourceManager.getObject(getURI(), objectType);
+ object = resourceResolver.getObject(getURI(), objectType);
}
return object;
@@ -187,7 +187,7 @@
public Resource getDescendent(String relPath) {
try {
if (node.hasNode(relPath)) {
- return new JcrNodeResource(resourceManager,
+ return new JcrNodeResource(resourceResolver,
node.getNode(relPath));
}
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=605191&r1=605190&r2=605191&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:45:41 2007
@@ -41,7 +41,7 @@
private final Logger log = LoggerFactory.getLogger(getClass());
/** resource manager used to create resources from nodes */
- private JcrResourceResolver resourceManager;
+ private JcrResourceResolver resourceResolver;
/** underlying node iterator to be used for resources */
private NodeIterator nodes;
@@ -57,20 +57,20 @@
try {
NodeIterator nodes = parent.getNode().getNodes();
- this.resourceManager = parent.getResourceManager();
+ this.resourceResolver = parent.getResourceResolver();
this.nodes = nodes;
this.nextResult = seek();
} catch (RepositoryException re) {
log.error("<init>: Cannot get children of resource " + parent, re);
- this.resourceManager = null;
+ this.resourceResolver = null;
this.nodes = null;
this.nextResult = null;
}
}
- public JcrNodeResourceIterator(JcrResourceResolver resourceManager,
+ public JcrNodeResourceIterator(JcrResourceResolver resourceResolver,
NodeIterator nodes) {
- this.resourceManager = resourceManager;
+ this.resourceResolver = resourceResolver;
this.nodes = nodes;
this.nextResult = seek();
}
@@ -100,7 +100,7 @@
private Resource seek() {
while (nodes.hasNext()) {
try {
- return new JcrNodeResource(resourceManager, nodes.nextNode());
+ return new JcrNodeResource(resourceResolver, nodes.nextNode());
} catch (Throwable t) {
log.error(
"seek: Problem creating Resource for next node, skipping",
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=605191&r1=605190&r2=605191&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:45:41 2007
@@ -64,7 +64,7 @@
/** default log */
private static final Logger log =
LoggerFactory.getLogger(ObjectContentManagerFactory.class);
- private JcrResourceResolverFactoryImpl jcrResourceManagerFactory;
+ private JcrResourceResolverFactoryImpl jcrResourceResolverFactory;
/**
* The class loader used by the Jackrabbit OCM ReflectionUtils class to
load
@@ -82,8 +82,8 @@
private AtomicTypeConverterProvider converterProvider;
public ObjectContentManagerFactory(
- JcrResourceResolverFactoryImpl jcrResourceManagerFactory) {
- this.jcrResourceManagerFactory = jcrResourceManagerFactory;
+ JcrResourceResolverFactoryImpl jcrResourceResolverFactory) {
+ this.jcrResourceResolverFactory = jcrResourceResolverFactory;
// prepare the data converters and query manager
this.converterProvider = new SlingAtomicTypeConverterProvider();
@@ -257,7 +257,7 @@
Map<String, Object> props = new HashMap<String, Object>();
props.put(MAPPING_CLASS, mapper.getMappedClasses());
props.put(MAPPING_NODE_TYPE, mapper.getMappedNodeTypes());
- jcrResourceManagerFactory.fireEvent(sourceBundle, eventName,
props);
+ jcrResourceResolverFactory.fireEvent(sourceBundle, eventName,
props);
}
}
}
Modified:
incubator/sling/trunk/jcr/resource/src/main/resources/OSGI-INF/metatype/metatype.properties
URL:
http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/resources/OSGI-INF/metatype/metatype.properties?rev=605191&r1=605190&r2=605191&view=diff
==============================================================================
---
incubator/sling/trunk/jcr/resource/src/main/resources/OSGI-INF/metatype/metatype.properties
(original)
+++
incubator/sling/trunk/jcr/resource/src/main/resources/OSGI-INF/metatype/metatype.properties
Tue Dec 18 03:45:41 2007
@@ -24,7 +24,7 @@
# the SCR plugin
#
-# Localizations for JcrResourceManagerFactoryImpl configuration
+# Localizations for JcrResourceResolverFactoryImpl configuration
resource.resolver.name = Content Resolver
resource.resolver.description = Configures the Content Resolver for request \
URL and content path rewriting.
Modified:
incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverTest.java
URL:
http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverTest.java?rev=605191&r1=605190&r2=605191&view=diff
==============================================================================
---
incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverTest.java
(original)
+++
incubator/sling/trunk/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverTest.java
Tue Dec 18 03:45:41 2007
@@ -120,7 +120,7 @@
public void testResolveResource() throws Exception {
// existing resource
- Resource res = resResolver.resolve(new
ResourceManagerTestRequest(root));
+ Resource res = resResolver.resolve(new
ResourceResolverTestRequest(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 = resResolver.resolve(new ResourceManagerTestRequest(path));
+ res = resResolver.resolve(new ResourceResolverTestRequest(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 = resResolver.resolve(new ResourceManagerTestRequest(path));
+ res = resResolver.resolve(new ResourceResolverTestRequest(path));
assertNotNull(res);
assertEquals(root, res.getURI());
assertEquals(rootNode.getPrimaryNodeType().getName(),
@@ -153,18 +153,18 @@
// missing resource should return NON_EXISTING Resource
path = root + System.currentTimeMillis();
- res = resResolver.resolve(new ResourceManagerTestRequest(path));
+ res = resResolver.resolve(new ResourceResolverTestRequest(path));
assertNotNull(res);
assertTrue(res instanceof NonExistingResource);
assertEquals(path, res.getURI());
assertEquals(Resource.RESOURCE_TYPE_NON_EXISTING,
res.getResourceType());
}
- private static class ResourceManagerTestRequest implements
HttpServletRequest {
+ private static class ResourceResolverTestRequest implements
HttpServletRequest {
private String pathInfo;
- ResourceManagerTestRequest(String pathInfo) {
+ ResourceResolverTestRequest(String pathInfo) {
this.pathInfo = pathInfo;
}
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=605191&r1=605190&r2=605191&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:45:41 2007
@@ -157,7 +157,7 @@
roots = new String[] { root };
}
- public Resource getResource(JcrResourceResolver jcrResourceManager,
String path) {
+ public Resource getResource(JcrResourceResolver jcrResourceResolver,
String path) {
return null;
}