You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2010/01/02 16:44:55 UTC

[jira] Created: (SLING-1262) Implement ResourceResolverFactory concept

Implement ResourceResolverFactory concept
-----------------------------------------

                 Key: SLING-1262
                 URL: https://issues.apache.org/jira/browse/SLING-1262
             Project: Sling
          Issue Type: New Feature
          Components: API, JCR
            Reporter: Felix Meschberger
            Assignee: Felix Meschberger


See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SLING-1262) Implement ResourceResolverFactory concept

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler resolved SLING-1262.
-------------------------------------

    Resolution: Fixed

> Implement ResourceResolverFactory concept
> -----------------------------------------
>
>                 Key: SLING-1262
>                 URL: https://issues.apache.org/jira/browse/SLING-1262
>             Project: Sling
>          Issue Type: New Feature
>          Components: API, JCR
>    Affects Versions: JCR Resource 2.0.6, API 2.0.8
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: JCR Resource 2.0.8, API 2.1.0
>
>
> See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1262) Implement ResourceResolverFactory concept

Posted by "Justin Edelson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12880519#action_12880519 ] 

Justin Edelson commented on SLING-1262:
---------------------------------------

can this be marked as resolved?

> Implement ResourceResolverFactory concept
> -----------------------------------------
>
>                 Key: SLING-1262
>                 URL: https://issues.apache.org/jira/browse/SLING-1262
>             Project: Sling
>          Issue Type: New Feature
>          Components: API, JCR
>    Affects Versions: JCR Resource 2.0.6, API 2.0.8
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: JCR Resource 2.0.8, API 2.1.0
>
>
> See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1262) Implement ResourceResolverFactory concept

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840109#action_12840109 ] 

Carsten Ziegeler commented on SLING-1262:
-----------------------------------------

We also need support for impersonation:
Instead of providing a separate method we define a constant for a sudo user property. If this is set in the map passed to getResourceResolver or getAdmin...RR, the factory internally does the login and then sudo's the resource resolver and only returns the sudo'ed one.
This makes handling impersonation easier

> Implement ResourceResolverFactory concept
> -----------------------------------------
>
>                 Key: SLING-1262
>                 URL: https://issues.apache.org/jira/browse/SLING-1262
>             Project: Sling
>          Issue Type: New Feature
>          Components: API, JCR
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>
> See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1262) Implement ResourceResolverFactory concept

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841484#action_12841484 ] 

Felix Meschberger commented on SLING-1262:
------------------------------------------

Sorry, to be a PITA: Shouldn't LoginException extend SlingException ?

> Implement ResourceResolverFactory concept
> -----------------------------------------
>
>                 Key: SLING-1262
>                 URL: https://issues.apache.org/jira/browse/SLING-1262
>             Project: Sling
>          Issue Type: New Feature
>          Components: API, JCR
>    Affects Versions: JCR Resource 2.0.6, API 2.0.8
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: JCR Resource 2.0.8, API 2.0.10
>
>
> See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1262) Implement ResourceResolverFactory concept

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12843606#action_12843606 ] 

Carsten Ziegeler commented on SLING-1262:
-----------------------------------------

Merged the two factories into a single component; factored out the resource provider handling

> Implement ResourceResolverFactory concept
> -----------------------------------------
>
>                 Key: SLING-1262
>                 URL: https://issues.apache.org/jira/browse/SLING-1262
>             Project: Sling
>          Issue Type: New Feature
>          Components: API, JCR
>    Affects Versions: JCR Resource 2.0.6, API 2.0.8
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: JCR Resource 2.0.8, API 2.0.10
>
>
> See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1262) Implement ResourceResolverFactory concept

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841279#action_12841279 ] 

Carsten Ziegeler commented on SLING-1262:
-----------------------------------------

As discussed on the mailing list, I reverted to a close() method on the resource resolver.

The question is now, what exceptions do we except to be thrown by the factory? 
What happens if a login fails?


> Implement ResourceResolverFactory concept
> -----------------------------------------
>
>                 Key: SLING-1262
>                 URL: https://issues.apache.org/jira/browse/SLING-1262
>             Project: Sling
>          Issue Type: New Feature
>          Components: API, JCR
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>
> See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (SLING-1262) Implement ResourceResolverFactory concept

Posted by Carsten Ziegeler <cz...@apache.org>.
Carsten Ziegeler  wrote
> Felix Meschberger  wrote
>> Hi,
>>
>> On 03.03.2010 20:24, Carsten Ziegeler (JIRA) wrote:
>>> Rethinking this, I think we should rather add a dispose method
>>> to the factory than a close method to the resource resolver itself.
>>> This makes the lifecycle a little bit more obvious and prevents
>>> clients from calling the close method. Only the code who created
>>> the resource resolver has the factory and can therefore dispose
>>> the resource resolver
>>
>> While you may be right from a "safety" POV, from a "custom-use" POV
>> having the close method is proably better:
>>
>>   * JCR has a Session.logout() method; where the Repository is
>>       the factory
>>   * JDBC Connections have a Connection.close() method; where the
>>       DataSource is the factory
>>   * Declarative Services ComponentInstance has a dispose() method;
>>       where the ComponentFactory is the factory
>>
>> Ok, have the dispose method on the factory is more symmetric (creation
>> and disposal in the same location); but it is probably more natural to
>> be able to just close/dispose off the ResourceResolver directly.
>>
>> Thus, I would prefer to have a close() method on the ResourceResolver
>> interface.
>>
> Yes, I think haven the dispose method in the factory has another
> advantage: we don't have to change (extend) the resource resolver interface.
> 
> I would prefer having dispose on the factory for the explained reasons,
> but we can go with a close() method on the resolver as well. It's not a
> big deal.
> 
Ok to move this forward, let's go with a close() method :)


Carsten

-- 
Carsten Ziegeler
cziegeler@apache.org

Re: [jira] Commented: (SLING-1262) Implement ResourceResolverFactory concept

Posted by Carsten Ziegeler <cz...@apache.org>.
Felix Meschberger  wrote
> Hi,
> 
> On 03.03.2010 20:24, Carsten Ziegeler (JIRA) wrote:
>> Rethinking this, I think we should rather add a dispose method
>> to the factory than a close method to the resource resolver itself.
>> This makes the lifecycle a little bit more obvious and prevents
>> clients from calling the close method. Only the code who created
>> the resource resolver has the factory and can therefore dispose
>> the resource resolver
> 
> While you may be right from a "safety" POV, from a "custom-use" POV
> having the close method is proably better:
> 
>   * JCR has a Session.logout() method; where the Repository is
>       the factory
>   * JDBC Connections have a Connection.close() method; where the
>       DataSource is the factory
>   * Declarative Services ComponentInstance has a dispose() method;
>       where the ComponentFactory is the factory
> 
> Ok, have the dispose method on the factory is more symmetric (creation
> and disposal in the same location); but it is probably more natural to
> be able to just close/dispose off the ResourceResolver directly.
> 
> Thus, I would prefer to have a close() method on the ResourceResolver
> interface.
> 
Yes, I think haven the dispose method in the factory has another
advantage: we don't have to change (extend) the resource resolver interface.

I would prefer having dispose on the factory for the explained reasons,
but we can go with a close() method on the resolver as well. It's not a
big deal.

Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: [jira] Commented: (SLING-1262) Implement ResourceResolverFactory concept

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

On 03.03.2010 20:24, Carsten Ziegeler (JIRA) wrote:
> Rethinking this, I think we should rather add a dispose method
> to the factory than a close method to the resource resolver itself.
> This makes the lifecycle a little bit more obvious and prevents
> clients from calling the close method. Only the code who created
> the resource resolver has the factory and can therefore dispose
> the resource resolver

While you may be right from a "safety" POV, from a "custom-use" POV
having the close method is proably better:

  * JCR has a Session.logout() method; where the Repository is
      the factory
  * JDBC Connections have a Connection.close() method; where the
      DataSource is the factory
  * Declarative Services ComponentInstance has a dispose() method;
      where the ComponentFactory is the factory

Ok, have the dispose method on the factory is more symmetric (creation
and disposal in the same location); but it is probably more natural to
be able to just close/dispose off the ResourceResolver directly.

Thus, I would prefer to have a close() method on the ResourceResolver
interface.

Regards
Felix

> 
>> Implement ResourceResolverFactory concept
>> -----------------------------------------
>>
>>                 Key: SLING-1262
>>                 URL: https://issues.apache.org/jira/browse/SLING-1262
>>             Project: Sling
>>          Issue Type: New Feature
>>          Components: API, JCR
>>            Reporter: Felix Meschberger
>>            Assignee: Felix Meschberger
>>
>> See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html
> 

[jira] Commented: (SLING-1262) Implement ResourceResolverFactory concept

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840823#action_12840823 ] 

Carsten Ziegeler commented on SLING-1262:
-----------------------------------------

I've added a first version of the ResourceResolverFactory to the API in revision 918645

Rethinking this, I think we should rather add a dispose method to the factory than a close method to the resource resolver itself. This makes the lifecycle a little bit more obvious and prevents clients from calling the close method. Only the code who created the resource resolver has the factory and can therefore dispose the resource resolver 

> Implement ResourceResolverFactory concept
> -----------------------------------------
>
>                 Key: SLING-1262
>                 URL: https://issues.apache.org/jira/browse/SLING-1262
>             Project: Sling
>          Issue Type: New Feature
>          Components: API, JCR
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>
> See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1262) Implement ResourceResolverFactory concept

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840069#action_12840069 ] 

Carsten Ziegeler commented on SLING-1262:
-----------------------------------------

I think as a first step we should:
- introduce the ResourceResolverFactory interface in the API with the following methods:
- getResourceResolver(Map)
- getAdministrativeResourceResolver()
- add the close() methode to the ResourceResolver

Support for anonymous login: if the provided map to getResourceResolver does not contain a user name and no credentials object, anonymous login is tried

> Implement ResourceResolverFactory concept
> -----------------------------------------
>
>                 Key: SLING-1262
>                 URL: https://issues.apache.org/jira/browse/SLING-1262
>             Project: Sling
>          Issue Type: New Feature
>          Components: API, JCR
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>
> See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (SLING-1262) Implement ResourceResolverFactory concept

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12842949#action_12842949 ] 

Carsten Ziegeler edited comment on SLING-1262 at 3/9/10 7:49 AM:
-----------------------------------------------------------------

Implemented the close() method in the JcrResourceResolver

      was (Author: cziegeler):
    Implemented the close() method in the JcrResourceResolver factory
  
> Implement ResourceResolverFactory concept
> -----------------------------------------
>
>                 Key: SLING-1262
>                 URL: https://issues.apache.org/jira/browse/SLING-1262
>             Project: Sling
>          Issue Type: New Feature
>          Components: API, JCR
>    Affects Versions: JCR Resource 2.0.6, API 2.0.8
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: JCR Resource 2.0.8, API 2.0.10
>
>
> See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SLING-1262) Implement ResourceResolverFactory concept

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated SLING-1262:
------------------------------------

    Affects Version/s: JCR Resource 2.0.6
                       API 2.0.8
        Fix Version/s: API 2.0.10
                       JCR Resource 2.0.8

> Implement ResourceResolverFactory concept
> -----------------------------------------
>
>                 Key: SLING-1262
>                 URL: https://issues.apache.org/jira/browse/SLING-1262
>             Project: Sling
>          Issue Type: New Feature
>          Components: API, JCR
>    Affects Versions: JCR Resource 2.0.6, API 2.0.8
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: JCR Resource 2.0.8, API 2.0.10
>
>
> See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1262) Implement ResourceResolverFactory concept

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12842949#action_12842949 ] 

Carsten Ziegeler commented on SLING-1262:
-----------------------------------------

Implemented the close() method in the JcrResourceResolver factory

> Implement ResourceResolverFactory concept
> -----------------------------------------
>
>                 Key: SLING-1262
>                 URL: https://issues.apache.org/jira/browse/SLING-1262
>             Project: Sling
>          Issue Type: New Feature
>          Components: API, JCR
>    Affects Versions: JCR Resource 2.0.6, API 2.0.8
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: JCR Resource 2.0.8, API 2.0.10
>
>
> See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1262) Implement ResourceResolverFactory concept

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841283#action_12841283 ] 

Felix Meschberger commented on SLING-1262:
------------------------------------------

> What happens if a login fails?

This is actually described on the wiki page: A LoginException is thrown.

> Implement ResourceResolverFactory concept
> -----------------------------------------
>
>                 Key: SLING-1262
>                 URL: https://issues.apache.org/jira/browse/SLING-1262
>             Project: Sling
>          Issue Type: New Feature
>          Components: API, JCR
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>
> See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1262) Implement ResourceResolverFactory concept

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841360#action_12841360 ] 

Carsten Ziegeler commented on SLING-1262:
-----------------------------------------

Ups, right :)

Ok, I've added the LoginException to the api and added a first simple implementation to the jcr resource bundle.

> Implement ResourceResolverFactory concept
> -----------------------------------------
>
>                 Key: SLING-1262
>                 URL: https://issues.apache.org/jira/browse/SLING-1262
>             Project: Sling
>          Issue Type: New Feature
>          Components: API, JCR
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>
> See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1262) Implement ResourceResolverFactory concept

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795863#action_12795863 ] 

Felix Meschberger commented on SLING-1262:
------------------------------------------

Starting prototype implementation in http://svn.apache.org/repos/asf/sling/whiteboard/fmeschbe/resource

> Implement ResourceResolverFactory concept
> -----------------------------------------
>
>                 Key: SLING-1262
>                 URL: https://issues.apache.org/jira/browse/SLING-1262
>             Project: Sling
>          Issue Type: New Feature
>          Components: API, JCR
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>
> See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1262) Implement ResourceResolverFactory concept

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840105#action_12840105 ] 

Carsten Ziegeler commented on SLING-1262:
-----------------------------------------

We should pass an (optional) map into getAdministrativeResourceResolver() for further information like workspace etc. But this should be optional

> Implement ResourceResolverFactory concept
> -----------------------------------------
>
>                 Key: SLING-1262
>                 URL: https://issues.apache.org/jira/browse/SLING-1262
>             Project: Sling
>          Issue Type: New Feature
>          Components: API, JCR
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>
> See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1262) Implement ResourceResolverFactory concept

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841797#action_12841797 ] 

Carsten Ziegeler commented on SLING-1262:
-----------------------------------------

Hmm, no I don't think that so - our docs for the SlingException state that SlingException (and sub classes) are not meant to be catched by client code.
A LoginException is something you definitly want to catch and do somethin

> Implement ResourceResolverFactory concept
> -----------------------------------------
>
>                 Key: SLING-1262
>                 URL: https://issues.apache.org/jira/browse/SLING-1262
>             Project: Sling
>          Issue Type: New Feature
>          Components: API, JCR
>    Affects Versions: JCR Resource 2.0.6, API 2.0.8
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: JCR Resource 2.0.8, API 2.0.10
>
>
> See http://cwiki.apache.org/SLING/add-resourceresolverfactory-service-interface.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.