Using Eclipse Virgo i have a Bundle with a bean that implements BundleContextAware, i add a addBundleListener and receive the events correctly when a Bundle is started or stoped, thats OK. and have a bundle installed by the bundleChanged event.
Now, i need retrieve all beans of application context of the bundle installed, whats is the best way to retrieve the application context of the bundle?
public class PluginManager implements BundleContextAware {
private BundleContext bundleContext;
@Override
public void setBundleContext(BundleContext bundleContext) {
this.bundleContext = bundleContext;
bundleContext.addBundleListener(this);
}
@Override
public void bundleChanged(BundleEvent event) {
Bundle bundle = event.getBundle();
//HOW TO DO TO GET ALL BEANS OF BUNDLE
}
}