felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Jencks (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-4831) Simplify the declaration of capabilities
Date Wed, 18 Mar 2015 18:06:40 GMT

    [ https://issues.apache.org/jira/browse/FELIX-4831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14367577#comment-14367577

David Jencks commented on FELIX-4831:

Please look at bnd, it is totally implausible to implement this stuff anywhere else.  Looking
at master, it already has very elegant @ProvideCapability and @RequireCapability annotations.
 I still don't think annotations are an appropriate solution for this kind of problem.  For
instance, an extender is typically going to export some services and therefore there should
be a bnd plugin for it that identifies those services from the existing information that the
extender uses to identify what its' going to export and add provide-capability headers for
the exported services.  This bnd plugin can also add the extender requirement at the same
time.  Making someone use annotations that basically duplicate what the extender is looking
for is too hard for the user.

> Simplify the declaration of capabilities
> ----------------------------------------
>                 Key: FELIX-4831
>                 URL: https://issues.apache.org/jira/browse/FELIX-4831
>             Project: Felix
>          Issue Type: Improvement
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.5.3
>            Reporter: Florian Brunner
> Declaring capabilities is currently rather cryptic. It requires a specific syntax, which
I believe is hard to remember for non-OSGi experts.
> E.g. to provide a CDI extension using PAX-CDI you would need something like this:
>                         <Provide-Capability>
>                             org.ops4j.pax.cdi.extension; extension=my-extension
>                         </Provide-Capability>
> To require the CDI extension you would need something like this:
>                     <instructions>
>                         <Require-Capability>
>                             osgi.extender; filter:="(osgi.extender=pax.cdi)", org.ops4j.pax.cdi.extension;
>                         </Require-Capability>
>                     </instructions>
> The proposed solutions consists of 3 parts:
>  - a new property for the bundle goal of the Maven Bundle Plugin: instructionsFile 
>   This property defines a properties file containing additional BND instructions to take
into consideration when executing the goal
> - a annotation library, which provides annotations for declaring BND instructions
> - a custom annotation processor, which generates the instructionsFile from the annotations
> This approach would:
> - guide the developer what to specify
> - doesn't require the developer to know the exact syntax
> - helps avoiding typos

This message was sent by Atlassian JIRA

View raw message