Hi Am 21.08.2014 um 13:04 schrieb Andreas Klotz <[email protected]<mailto:[email protected]>>:
Hi all, I’d like to know if ServiceListeners/ServiceTracker are called synchronously called during the service registration process. The specification says (10.1.26): “When a ServiceEvent is fired, it is synchronously delivered to a ServiceListener. The Framework may deliver ServiceEvent objects to a ServiceListener out of order and may concurrently call and/or reenter a ServiceListener.” So the decision how to deliver events is up to the implementation? No, ServiceListeners are called during the service registration process: Before the BundleContext.registerService returns, all listeners have been called. But there may be multiple services of the same type being registered at „the same time“, in which case the ServiceListener may be called on multiple threads concurrently for these different service registrations. In my use case I register an EventHandler as a service. I need to know when the registration method terminates if the EventHandler is already tracked by the EventAdmin and is ready to receive Events. Yes, when the registerService method returns, the EventAdmin service (provided it does ServletListener style access to the services as opposed to on-demand style access by the calling Bundle.getService when an event is to be dispatched), should be knowing it and thus be able to dispatcher to your EventHandler. Regards Felix Thanks and best regards, Andreas -- phone: +49 221 222896 - 24 fax: +49 221 222896 - 11 email: [email protected]<mailto:[email protected]> ________________________________ n - d e s i g n G m b H www.n-design.de<http://www.n-design.de/> Alpenerstr. 16 D-50825 Köln Amtsgericht Köln HRB 33766 B Geschäftsführer Andy Kohl <Mail-Anhang.png><http://ea.sendcockpit.net/_s.php?&fid=19878&fpw=d44e1b06d576c366a1b94b9bf8218761>Verpassen Sie zukünftig keine wichtigen Neuigkeiten mehr zum Thema Softwareentwicklung, moderne Technologien und eHealth sowie zu unserem Unternehmen n-design! Der kostenlose vierteljährliche n-design Newsletter informiert Sie! Zum Anmeldeformular<http://ea.sendcockpit.net/_s.php?&fid=19878&fpw=d44e1b06d576c366a1b94b9bf8218761> <Mail-Anhang.png><http://www.n-design.de/index.php/blog.html>Wie wäre es mit „n-design zum Mitmachen“? Besuchen Sie unseren spannenden Blog<http://www.n-design.de/index.php/blog.html>. Wir freuen uns auf Ihre Kommentare! <Mail-Anhang.jpeg>Vernetzen Sie sich noch heute mit uns auf XING<http://www.xing.com/companies/n-designgmbh>! _______________________________________________ OSGi Developer Mail List [email protected]<mailto:[email protected]> https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
