[
https://issues.apache.org/jira/browse/FELIX-4961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14628074#comment-14628074
]
Pierre De Rop commented on FELIX-4961:
--------------------------------------
Hi Paul;
Here is a quick response (I'm currently in vacations, will get back next 24
july):
Since the r1 release (see FELIX-4676), there is now the possibility to
configure the DM bnd annotation plugin in order to generate a
"Require-Capability" header in annotated bundles. Such header requires the
presence of the DM runtime bundle.
For instance, if you add the following option in the plugin:
{code}
-plugin:
org.apache.felix.dm.annotation.plugin.bnd.AnnotationPlugin;add-require-capability=true;\
{code}
then the bundle will include the following generated header:
{code}
Require-Capability:
osgi.extender;filter:="(&(osgi.extender=org.apache.felix.dependencymanager.runtime)(version>=4.0.0))"
{code}
Now, the DM runtime provides a corresponding "Require-Capability" header, and
if the DM runtime is missing, then the bundle won't be installed and the
following error will be logged:
{code}
! Failed to start bundle
org.apache.felix.dependencymanager.samples.dynamicdep.annot-1.0.0, exception
Unresolved constraint in bundle
org.apache.felix.dependencymanager.samples.dynamicdep.annot [25]: Unable to
resolve 25.0: missing requirement [25.0] osgi.extender;
(&(osgi.extender=org.apache.felix.dependencymanager.runtime)(version>=4.0.0))
{code}
I think this corresponds to what you are asking for ? If yes, then may be the
Amdatu bootstrap could generate by default the "add-require-capability=true" dm
annotation plugin option ?
Also, please notice that the deprecated "Import-Service" header is not
generated anymore so you don't have to use the
"build-import-export-service=false" option (I'm not sure but I think that
Amdatu bootstrap is currently using the "import-export-service=false" option).
Also, this new option is not currently documented (I will do it when back from
holidays, sorry about that).
One last note: if you have more than one annotated component in a given bundle,
then currently, multiple dm runtime extenders are concatenated in the
"Require-Capability" header, but this does not causes problems ... however I
will also fix this when back from vacations.
let me know if all this corresponds to what you are asking for.
> Make the relationship to dependencymanager.runtime more clear
> -------------------------------------------------------------
>
> Key: FELIX-4961
> URL: https://issues.apache.org/jira/browse/FELIX-4961
> Project: Felix
> Issue Type: Improvement
> Components: Dependency Manager Annotations
> Reporter: Paul Bakker
> Priority: Minor
>
> For components that I wrote using DM annotations I often get questions why
> the component doesn't work. It always turns out the dependencymanager.runtime
> bundle is missing.
> There is not really an obvious way to learn about this requirement for new
> users besides the docs. The docs are ok for DM users, but not an obvious
> place to look for users of a component that uses DM internally.
> I do not have a solution for this issue, but would like to start discussing
> how we can improve this situation.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)