On Thu, Feb 24, 2011 at 5:23 PM, Bertrand Delacretaz <[email protected]> wrote: > On Thu, Feb 24, 2011 at 5:15 PM, Markus Joschko > <[email protected]> wrote: >> ...That brings us back to the original question whether it is possible to >> handle the JCRNodeResource less restrictive as >> it could be used by all kinds of alternative JCR based Resolvers.... > > Could you instead use a (to be created) JCRNodeResourceFactory service > with a method like this? > > Resource createJCRNodeResource(Session session, String path) > > (I haven't checked if that needs other parameters, just the general idea) > > This would avoid exporting the JCRNodeResource class and keep coupling low. >
Yes, that would be fine. It was one of the alternatives of my original suggestion. public Resource createJcrResource(ResourceResolver resolver, Item item) should work. It couldn't be a static method though, as a DynamicClassLoaderManager would need to be injected for the creation of the JcrNodeResource.
