Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » bundle starting order
bundle starting order [message #717041] Fri, 19 August 2011 06:52 Go to next message
Maxime Jeanmart is currently offline Maxime JeanmartFriend
Messages: 35
Registered: November 2010
Member
Hi all,

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());
   bundle.start();
}

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,
Max

[Updated on: Fri, 19 August 2011 06:56]

Report message to a moderator

Re: bundle starting order [message #717197 is a reply to message #717041] Fri, 19 August 2011 14:58 Go to previous message
Maxime Jeanmart is currently offline Maxime JeanmartFriend
Messages: 35
Registered: November 2010
Member
I solved the problem by using Platform.getBundle instead of context.getBundle
Previous Topic:How to control bundles' lifesycle with code?
Next Topic:Drools install problem
Goto Forum:
  


Current Time: Sat Apr 20 03:03:08 GMT 2024

Powered by FUDForum. Page generated in 0.02684 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top