[
https://issues.apache.org/jira/browse/JCRVLT-248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16277519#comment-16277519
]
Tobias Bocanegra commented on JCRVLT-248:
-----------------------------------------
bq. With JCRVLT-116 you can already use hooks that leverage OSGi services.
it depends a bit on the classloader hierarchy. for example, when installing
with the JCR installer, the hook fails to retrieve the bundle context. this
might be a bug in the jcr installer, but in order to make the hooks simple, it
is better to turn them into services.
bq. Regarding the related PR I think it would be useful to refer to OSGi
service hooks not only via the bundle symbolic name but also via an optional
OSGi service filter.
it is not using the bundle symbolic name. the .jar is considered as bundle and
installed as such.
bq. Also I think instead of iterating through all declared services of a
referenced bundle it would be beneficial to use
https://osgi.org/javadoc/r4v43/core/org/osgi/framework/BundleContext.html#getServiceReferences(java.lang.Class,
java.lang.String) to only list services implementing InstallHook.
IIUC, the BundleContext.getServiceReference() gets the service references of
all bundles. but here we only want the ones of hooks in the bundle.
> Support install hook bundles
> ----------------------------
>
> Key: JCRVLT-248
> URL: https://issues.apache.org/jira/browse/JCRVLT-248
> Project: Jackrabbit FileVault
> Issue Type: Improvement
> Components: Packaging
> Affects Versions: 3.1.42
> Reporter: Tobias Bocanegra
>
> it would be helpful if the package installer could handle install hook
> bundles OR if it could register install "hook" components in the felix admin
> for execution. this would simplify the implementation of hooks that require
> other osgi services for execution.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)