[
https://issues.apache.org/jira/browse/OAK-2894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14661618#comment-14661618
]
Alex Parvulescu commented on OAK-2894:
--------------------------------------
[~frm] From a strict DI POV I get the problem, if a component gets a dependency
injected from outside it should not take care of its lifecycle. But here I'm
not sure what the issue is, the _RepositoryImpl_ is not dynamic (AFAIKT both
_RepositoryImpl_ and _ContentRepository_, are created in one call on the Jcr
class) so I guess the assumption was that there is no way to run one without
the other. Or a better question is then _who_ will be responsible for calling
ContentRepository#close?
Would you mind detailing what the usecase is? Maybe there's something I'm
missing.
> RepositoryImpl should not manage the lifecycle of ContentRepository
> -------------------------------------------------------------------
>
> Key: OAK-2894
> URL: https://issues.apache.org/jira/browse/OAK-2894
> Project: Jackrabbit Oak
> Issue Type: Sub-task
> Components: jcr
> Affects Versions: 1.2.2
> Reporter: Francesco Mari
> Assignee: Francesco Mari
> Labels: modularization, resilience, technical_debt
> Fix For: 1.3.5
>
>
> {{RepositoryImpl}} uses an instance of {{ContentRepository}} that is passed
> as an external dependency in its constructor.
> {{RepositoryImpl}} is not responsible for the creation of the
> {{ContentRepository}} instance and, as such, should not manage its lifecycle.
> In particular, the {{ContentRepository#close}} method should not be called
> when the {{RepositoryImpl#shutdown}} method is executed.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)