If you don't need to iterator through osgi services, you could use a simple <list> element instead. The problem with using osgi services and references is that if the reference is mandatory, the blueprint context won't be started until the reference is satisfied, which can't happen since the the service will be provided by the bundle itself. However, it should work when using an optional availability instead.
2013/6/4 CLEMENT Jean-Philippe <[email protected]> > Yes, you are right, not exactly meant for but it is useful :)**** > > ** ** > > In fact I just wish to iterate through beans and call a method for each > bean. What is strange is that it is possible among bundles but not within > bundle :S**** > > ** ** > > JP**** > > ** ** > > [@@ OPEN @@]**** > > ** ** > > *De :* Achim Nierbeck [mailto:[email protected]] > *Envoyé :* mardi 4 juin 2013 16:37 > > *À :* [email protected] > *Objet :* Re: service / reference-list within same bundle**** > > ** ** > > It's not what it's meant for, reference-list is supposed to give you all > available services of a interface. **** > > Not exactly a for each, or?**** > > ** ** > > regards, Achim **** > > ** ** > > 2013/6/4 CLEMENT Jean-Philippe <[email protected]>* > *** > > In fact I would like to use the reference-list as a kind of “for each”. I > don’t know how to do the same thing using the bean.**** > > **** > > Is there a syntax to do so?**** > > **** > > Cheers,**** > > JP**** > > **** > > [@@ OPEN @@]**** > > **** > > *De :* Achim Nierbeck [mailto:[email protected]] > *Envoyé :* mardi 4 juin 2013 16:31 > *À :* [email protected] > *Objet :* Re: service / reference-list within same bundle**** > > **** > > Since you're referencing a bean from within the same bundle, it's probably > best to reference the bean and not the service of it. **** > > If you really want to use the service (which I don't understand why) you > should configure Karaf to start the bundles in a synchronous way. **** > > **** > > regards, Achim **** > > **** > > 2013/6/4 CLEMENT Jean-Philippe <[email protected]>* > *** > > Dear Karaf team,**** > > **** > > I would like to use a reference-list on a service which is exported in the > same bundle. Starting the bundle blocks on the GracePeriod state.**** > > **** > > Is there a way to use a service which is exposed within the same bundle?** > ** > > **** > > Cheers,**** > > JP**** > > **** > > [@@ OPEN @@]**** > > **** > > > > **** > > **** > > -- > > Apache Karaf <http://karaf.apache.org/> Committer & PMC > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & > Project Lead > OPS4J Pax for Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home> > Commiter & Project Lead > blog <http://notizblog.nierbeck.de/> **** > > > > **** > > ** ** > > -- > > Apache Karaf <http://karaf.apache.org/> Committer & PMC > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & > Project Lead > OPS4J Pax for Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home> > Commiter & Project Lead > blog <http://notizblog.nierbeck.de/> **** >
