Hi Tom, Thanks for your response, my comments inline:
Il 02/08/2012 14:42, Thomas Watson ha scritto:
Is your preference not to use ServiceTracker because you would prefer to use some kind of injection (e.g. Declarative Services or Blueprint)?
Yes i prefer to use Declarative Services :-)
I would think you would be able to develop a service component that has a optional/dynamic dependency on EventAdmin and gets injected with the BundleContext of your bundle (by specifying an activate method that takes a BundleContext). This would allow you to create and open your BundleTracker when your service component is activated and have access to the optional EventAdmin service. You likely would want the service component to be immediately activated (using the immediate=true attribute) so that you can register your BundleTracker eagerly.
Great idea, i'll try it. I've not think about it before because, to create the BundleTracker i need the BundleContext.... and for this reason i've to get it from an Activator, but your solutions is definitely better :-)
Thx Andrea
_______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
