[
https://issues.apache.org/jira/browse/KARAF-6429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16936505#comment-16936505
]
Jean-Baptiste Onofré edited comment on KARAF-6429 at 9/24/19 7:20 AM:
----------------------------------------------------------------------
Hi [~j3rem1e], basically, you are proposing we actually inject the service at
first {{execute()}} of the command ?
was (Author: jbonofre):
Hi [~j3rem1e], basically, you are proposing we actually inject the service at
first `execution()` for the command ?
> Karaf is too eager with commands dependencies
> ---------------------------------------------
>
> Key: KARAF-6429
> URL: https://issues.apache.org/jira/browse/KARAF-6429
> Project: Karaf
> Issue Type: Bug
> Components: karaf
> Affects Versions: 4.2.6
> Reporter: J. Brébec
> Priority: Major
>
> If a Karaf Command have a @Reference to an osgi services, then Karaf resolves
> these services even if the command is not used /was never called.
> More concretely, I'm using Declarative Services to define my services. DS by
> default is lazy : a Service is instanciated only when it's used by another
> component (by calling bundleContext.getService).
> If I define a Karaf Command with a dependency on my service, then this
> service is instanciated even if no user uses them. I have severals commands
> for each services, which defeat the lazyness of DS
--
This message was sent by Atlassian Jira
(v8.3.4#803005)