[
https://issues.apache.org/jira/browse/SLING-8309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16791741#comment-16791741
]
Francesco Mari edited comment on SLING-8309 at 3/13/19 2:13 PM:
----------------------------------------------------------------
I second [~mduerig]'s opinion. I want to add that configuring Commit Hooks (and
their implementations) dynamically at runtime is unpredictable. Since OSGi
services can come and go at any time, your repository configuration is going to
be flaky. Instead, you want your repository to come up with its configuration
in place, and that's the reason why the list of Commit Hooks is hardcoded in
the Sling Repository Manager. There are so many things that can go wrong with
this approach that I beg you to refrain from going forward with it.
was (Author: frm):
I second [~mduerig]'s opinion. I want to add that configuring Commit Hooks (and
their implementations) dynamically at runtime is unpredictable. Since OSGi
services can come and go at any time, your repository configuration is going to
be flaky. Instead, you want your repository to come up with its configuration
in place, and that's the reason why the list of Commit Hooks is hardcoded in
Sling Repository Manager. There is so many things that can go wrong with this
approach that I beg you to refrain from going forward with it.
> Allow adding CommitHooks and EditorProviders dynamically from bundles
> ---------------------------------------------------------------------
>
> Key: SLING-8309
> URL: https://issues.apache.org/jira/browse/SLING-8309
> Project: Sling
> Issue Type: Improvement
> Components: Oak
> Reporter: Sergiu Dumitriu
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Currently, {{OakSlingRepositoryManager}} uses a hard-coded list of
> {{CommitHook}} and {{EditorProvider}} to be used by the Oak repository. This
> means that other than building a patched version of
> {{OakSlingRepositoryManager}} there's no way to include a new commit
> observer. Ideally, a single pseudo-\{{CommitHook}} and
> pseudo-\{{EditorProvider}} should be handled to Oak, and these should just
> dynamically aggregate all the {{CommitHook}} and {{EditorProvider}} instances
> registered in the {{Whiteboard}}.
> All the currently hardcoded components are already available in the
> whiteboard, so no functionality will be lost, but this change will
> automatically enable support for {{mix:atomicCounter}} via the
> {{AtomicCounterEditorProvider}} that's not used at the moment.
> The old behavior should still be available via a new configuration,
> {{OakSlingRepositoryManagerConfiguration#dynamic_components}}.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)