[ 
https://issues.apache.org/jira/browse/SLING-1129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12760240#action_12760240
 ] 

Ian Boston commented on SLING-1129:
-----------------------------------

allowing an extending class to overwrite the generation of NonExistingResource 
means that the extending class can potentially return something else, eg some 
other type of Resource with different properties. That Resource depending on 
things outside the scope of JcrResoruceResolver2. Eg, properties derived from a 
parent node.

---
If you extend the Factory and the SCR plugin does not generate the bind and 
unbind for properties annotated with the QDoc in the parent class. It only 
generates methods for the current class. Without these, the component wont 
start. (discovered by experimentation)

 

> Patch to make it easier to extend JcrResourceResolver2 and its factory.
> -----------------------------------------------------------------------
>
>                 Key: SLING-1129
>                 URL: https://issues.apache.org/jira/browse/SLING-1129
>             Project: Sling
>          Issue Type: Improvement
>          Components: JCR
>    Affects Versions: JCR Resource 2.0.4
>            Reporter: Ian Boston
>             Fix For: JCR Resource 2.0.6
>
>         Attachments: SLING-1129.diff
>
>
> At the moment, its hard if not impossible to extend the functionallity of the 
> JcrResourceResolver2 and its Factory without succumbing to the dangerous 
> practice of duplicating and patching implementation code.
> The patch to follow add some small extension points that makes it possible to 
> extend the Factory as a component, and the JcrResourceResolver2 itself. It 
> make no changes to functionality or API.

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

Reply via email to