Hi Martin, afaik you still can also use the "old" style with blueprint. As you are using blueprint anyway that shouldn't be much of a big deal. The idea about the new command way is to not depend on blueprint for Karaf internals.
The @Reference annotation is actually a karaf own annotation, org.apache.karaf.shell.api.action.lifecycle.Reference There is no filtering available on that annotation. regards, Achim 2017-06-15 8:38 GMT+02:00 Martin Lichtin <[email protected]>: > So far I could not find a way to do this in the new Karaf command > framework. > A command is now instantiated each time it is invoked. > It can use OSGi services (@Reference) but there doesn't seem to be a way > to set a filter for it. > I can access the BlueprintContainer (it's available as a service), but > not the beans by their name. > oh well.. > > > > On 02.06.2017 20:23, Martin Lichtin wrote: > >> In Karaf 3, a command can be defined in Blueprint as: >> >> <command> >> <action class="my.Cmd"> >> <property name="producerTemplate" ref="producerTemplate" /> >> </action> >> </command> >> >> where in my case "producerTemplate" comes from a CamelContext created in >> the same Blueprint context. >> >> Now in Karaf 4, how would I do the same, i.e. set the property? >> >> - Martin >> > -- Apache Member Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead blog <http://notizblog.nierbeck.de/> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS> Software Architect / Project Manager / Scrum Master
