You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by j3rem1e <je...@gmail.com> on 2016/01/12 20:23:43 UTC
Karaf shell command and optionals references
Hello,
I am trying to migrate a bundle containing severals command from Karaf 2 to
the new command api of karaf 4. This bundle was using blueprint to declare
theses commands. previously, some commands use optionals services :
translating theses commands with @Reference(optional = true) didn't seem to
work.
As far as i understand CommandExtension :
- If one Action use a service which is not bound, then none of the commands
on the bundle are registered
- The optional property of @Reference is ignored
am i correct ? how can i declare a command with an optional reference
without using a BundleContext ? (using a pojo looked interesting!)
can i declare a command without the CommandExtender ? maybe with scr ? (i
didn't found a tracker on the Action interface)
Thanks
--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-shell-command-and-optionals-references-tp4044793.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Karaf shell command and optionals references
Posted by Benson Margulies <be...@basistech.com>.
On Tue, Jan 12, 2016 at 2:39 PM, j3rem1e <je...@gmail.com> wrote:
> thanks, do you have a working example of a shell command using ds ? i was
> talking about org.apache.karaf.shell.api.action.lifecycle.Reference, not the
> ds annotation.
No, not I. Sorry, I should have read more carefully.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-shell-command-and-optionals-references-tp4044793p4044795.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Karaf shell command and optionals references
Posted by j3rem1e <je...@gmail.com>.
thanks, do you have a working example of a shell command using ds ? i was
talking about org.apache.karaf.shell.api.action.lifecycle.Reference, not the
ds annotation.
--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-shell-command-and-optionals-references-tp4044793p4044795.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Karaf shell command and optionals references
Posted by Benson Margulies <be...@basistech.com>.
@Reference(cardinality = ...) for the appropriate OPTIONAL constant,
using the current DS annotations.
On Tue, Jan 12, 2016 at 2:23 PM, j3rem1e <je...@gmail.com> wrote:
> Hello,
>
> I am trying to migrate a bundle containing severals command from Karaf 2 to
> the new command api of karaf 4. This bundle was using blueprint to declare
> theses commands. previously, some commands use optionals services :
> translating theses commands with @Reference(optional = true) didn't seem to
> work.
>
> As far as i understand CommandExtension :
> - If one Action use a service which is not bound, then none of the commands
> on the bundle are registered
> - The optional property of @Reference is ignored
>
> am i correct ? how can i declare a command with an optional reference
> without using a BundleContext ? (using a pojo looked interesting!)
> can i declare a command without the CommandExtender ? maybe with scr ? (i
> didn't found a tracker on the Action interface)
>
> Thanks
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-shell-command-and-optionals-references-tp4044793.html
> Sent from the Karaf - User mailing list archive at Nabble.com.