I have 10 bundles (A,B,C..). And in bundle A I want to create service tracker to track those services which implement some interface. These osgi services can be in any bundle (A,B,C..). I thought that I should create one service tracker and start it. However, what confuses me is that it's necessary to pass a reference to bundleContext to constructor (of what bundle???)
public class MyServiceTracker extends ServiceTracker{
public MyServiceTracker(BundleContext context){
super(context, SomeInterface.class.getName(), null);
open();
}
....
}
And in javadoc it says (about constructor)
context - The BundleContext against which the tracking is done.
The question - why should I pass bundleContext, what bundleContext should I pass or should I create instance of tracker for every bundle (A,B,C..)?