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

Raymond Augé commented on FELIX-5970:
-------------------------------------

I've implemented it slightly differently. There's a gogo specific namespace 
called {{org.apache.felix.gogo}} and it is used to resolve the Gogo _love 
triangle_ (runtime, shell impl, command.)

A third party uses the requirement like so:
{code:java}
// for `org.apache.felix.gogo.shell`
Require-Capability: 
org.apache.felix.gogo;filter:="(&(org.apache.felix.gogo=shell.implementation)(implementation.name=gogo.shell))"

// for `org.apache.felix.gogo.jline`
Require-Capability: 
org.apache.felix.gogo;filter:="(&(org.apache.felix.gogo=shell.implementation)(implementation.name=gogo.jline))"{code}
However, the simpler way to use it is with the {{@Retention(CLASS)}} annotation
{code:java}
@org.apache.felix.service.command.annotation.RequireGogo{code}
With this annotation you can choose which shell impl you want:
{code:java}
// for `org.apache.felix.gogo.shell`
@RequireGogo
OR
@RequireGogo(RequireGogo.SHELL)

// for `org.apache.felix.gogo.jline`
@RequireGogo(RequireGogo.JLINE){code}
The annotation is
{code:java}
@Target({TYPE, PACKAGE}{code}

> Add requirement & capabilities model so gogo can be resolved
> ------------------------------------------------------------
>
>                 Key: FELIX-5970
>                 URL: https://issues.apache.org/jira/browse/FELIX-5970
>             Project: Felix
>          Issue Type: Improvement
>          Components: Gogo Command, Gogo JLine, Gogo Runtime, Gogo Shell
>            Reporter: Raymond Augé
>            Assignee: Raymond Augé
>            Priority: Major
>             Fix For: gogo.command-1.1.0, gogo.runtime-1.1.2, 
> gogo.shell-1.1.2, gogo.jline-1.1.2
>
>




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

Reply via email to