|bundle starting order [message #717041]
||Fri, 19 August 2011 02:52
| Maxime Jeanmart
Registered: November 2010
I'm building an OSGi service which is listing all eclipse plugins which hold a specific type of EMF model, then loads that model.
The installed plugins which hold that model declare themselves to the OSGi service when they load and it's working fine.
However, I also want to list those plugins that are still in development in the workspace. So I created a scanner OSGi service that is finding those plugins and models in the workspace. This scanner only runs at Eclipse startup.
Unfortunately, It runs too early. I cannot load some models because some dependencies are not loaded yet. For example, I have model B in workspace which has a dependency on model A in an installed plugin. The scanner runs before A declares itself so B cannot be loaded.
I tried to manually start the plugins I depend on using this:
IPluginModelBase model = PluginRegistry.findModel(project);
BundleDescription desc = model.getBundleDescription();
for (BundleSpecification requiredBundle : desc.getRequiredBundles())
BundleContext context = Activator.getContext();
Bundle bundle = context.getBundle(requiredBundle.getName());
but the bundle variable is null.
Is there something I missed here? Is there another technique I should use to solve my problem?
Thanks for your help,
[Updated on: Fri, 19 August 2011 02:56]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01578 seconds