[ 
https://issues.apache.org/jira/browse/SLING-7790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Georg Henzler updated SLING-7790:
---------------------------------
    Description: 
Normally bundles configurations are installed asynchronously after a bundle is 
saved to the JCR during package installation (vault packages). This is due to 
the backgroundThread that the OsgiInstallerImpl is using. Since the 
introduction of the pauseInstallation signal node via SLING-3747, the 
installation of bundles and configurations is even forced to after the 
completed vault package installation. This behaviour also means that the 
package dependency can be declared, but it is not effective on "contained 
bundle level" but only on JCR content level. The following is not possible 
today:

Complete Package with sub packages:
* Package A (containing Bundle A)
* Package B (containing Bundle B) with dependency to Bundle A

If it is just a OSGi package dependency from Bundle B to Bundle A the 
installation order does not matter (the OSGi framework will sort it out). 
However if the content of Package B has a dependency to bundle A (think custom 
oak restrictions [1] or install hooks referenced) there will be an error. 

To allow for those cases and to avoid manual steps (not providing a complete 
package often means exactly that), it would be good to have a means to install 
contained bundles of a package synchronously. This can be achieved by a fairly 
simple install hook that "pre-installs" the contained InstallableResources with 
the correct digest to the OsgiInstaller. The subsequent call of 
sling-org-apache-sling-installer-provider-jcr will just update the already 
installed resource again with the same digest (which will not cause any action 
in the system). 

Obviously this mechanism should only be used where needed and only for 
configurations and bundles that are safe to install (bundles/configs that will 
never restart any of the base services). Using the install hook makes the 
mechanism "opt-in". 

[1] 
https://sling.apache.org/documentation/bundles/sling-oak-restrictions.html
https://jackrabbit.apache.org/oak/docs/security/authorization/restriction.html#pluggability

  was:
Normally bundles configurations are installed asynchronously after a bundle is 
saved to the JCR during package installation (vault packages). This is due to 
the backgroundThread that the OsgiInstallerImpl is using. Since the 
introduction of the pauseInstallation signal node SLING-3747, the installation 
of bundles and configurations is forced to after the completed vault package 
installation. This behaviour also means that the package dependency can be 
declared, but they are not effective on "contained bundle level" but only on 
JCR content level. The following is not possible today:

Complete Package with sub packages:
* Package A (containing Bundle A)
* Package B (containing Bundle B) with dependency to bundle A

If it is just a OSGi package dependency from Bundle B to bundle A the 
installation order does not matter (the OSGi framework will sort it out). 
However if the content of package B has a dependency to bundle A (think custom 
oak restrictions [1] or install hooks referenced) there will be an error. 

To allow for those cases and to avoid manual steps (not providing a complete 
package often means exactly that), it would be good to have a means to install 
contained bundles of a package synchronously. This can be achieved by a fairly 
simple install hook that "pre-installs" the contained InstallableResources with 
the correct digest to the via the OsgiInstaller. The subsequent call of 
sling-org-apache-sling-installer-provider-jcr will just update the already 
installed resource again with the same digest (which will not cause any action 
in the system). 

Obviously this mechanism should only be used where needed and only for 
configurations and bundles that are safe to install (that will never restart 
any of the base services), using the install hook makes the mechanism "opt-in". 

[1] 
https://sling.apache.org/documentation/bundles/sling-oak-restrictions.html
https://jackrabbit.apache.org/oak/docs/security/authorization/restriction.html#pluggability





> Allow for synchronous installation of bundles and configurations via install 
> hook
> ---------------------------------------------------------------------------------
>
>                 Key: SLING-7790
>                 URL: https://issues.apache.org/jira/browse/SLING-7790
>             Project: Sling
>          Issue Type: New Feature
>          Components: Installer
>            Reporter: Georg Henzler
>            Assignee: Georg Henzler
>            Priority: Major
>
> Normally bundles configurations are installed asynchronously after a bundle 
> is saved to the JCR during package installation (vault packages). This is due 
> to the backgroundThread that the OsgiInstallerImpl is using. Since the 
> introduction of the pauseInstallation signal node via SLING-3747, the 
> installation of bundles and configurations is even forced to after the 
> completed vault package installation. This behaviour also means that the 
> package dependency can be declared, but it is not effective on "contained 
> bundle level" but only on JCR content level. The following is not possible 
> today:
> Complete Package with sub packages:
> * Package A (containing Bundle A)
> * Package B (containing Bundle B) with dependency to Bundle A
> If it is just a OSGi package dependency from Bundle B to Bundle A the 
> installation order does not matter (the OSGi framework will sort it out). 
> However if the content of Package B has a dependency to bundle A (think 
> custom oak restrictions [1] or install hooks referenced) there will be an 
> error. 
> To allow for those cases and to avoid manual steps (not providing a complete 
> package often means exactly that), it would be good to have a means to 
> install contained bundles of a package synchronously. This can be achieved by 
> a fairly simple install hook that "pre-installs" the contained 
> InstallableResources with the correct digest to the OsgiInstaller. The 
> subsequent call of sling-org-apache-sling-installer-provider-jcr will just 
> update the already installed resource again with the same digest (which will 
> not cause any action in the system). 
> Obviously this mechanism should only be used where needed and only for 
> configurations and bundles that are safe to install (bundles/configs that 
> will never restart any of the base services). Using the install hook makes 
> the mechanism "opt-in". 
> [1] 
> https://sling.apache.org/documentation/bundles/sling-oak-restrictions.html
> https://jackrabbit.apache.org/oak/docs/security/authorization/restriction.html#pluggability



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to