You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Guillaume Nodet (JIRA)" <ji...@apache.org> on 2015/02/16 14:04:12 UTC

[jira] [Commented] (KARAF-3469) It should be possible to create a reference to an optional service from a command

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

Guillaume Nodet commented on KARAF-3469:
----------------------------------------

What's the use case for that ? I'd like to avoid making this small framework a fully featured OSGi dependency injection mechanism such as DS.
For an optional dependency, the best way may be to inject a BundleContext and retrieve the service manually when the command is executed.

> It should be possible to create a reference to an optional service from a command
> ---------------------------------------------------------------------------------
>
>                 Key: KARAF-3469
>                 URL: https://issues.apache.org/jira/browse/KARAF-3469
>             Project: Karaf
>          Issue Type: Improvement
>            Reporter: Christian Schneider
>             Fix For: 4.0.0
>
>
> To inject services into commands you use the @org.apache.karaf.shell.api.action.lifecycle.Reference annotation. Unlike the one from DS this annotation does not have an optional flag.
> We should allow to reference optional services and have them injected with null if they are not present.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)