|Multiple applications bundled in a single product / DS conflicts [message #665986]
||Mon, 18 April 2011 09:23
| Christophe Fondacci
Registered: July 2009
I got a little problem with OSGi service injection when I try to play with several application.
Here it is :
1. I have one RCP application bundled as a product with one feature
2. Now I want to expose some of the logic of this app in the command-line, so I created another "headless" application
3. The headless application has been created in a new plugin. Services declared by this plugin have a negative ranking, so that when embedded with the RCP UI app, the services declared anywhere else (typically the UI plugins) override headless service declaration.
In debug, everything works fine :
* When I run my headless app, only non-ui plugins are in the launch config and it works like a charm
* When I run the UI application, I can select every plugin and it works as expected.
Now the problem comes from the packaging :
I would have liked a single archive providing everything. The user would have an executable which runs the UI app, as usual, and another shortcut that run headless application.
I run the headless application through a command line like :
java -jar plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar -application com.neXtep.designer.headless.batch.application
The problem is that in this situation, all plugins from the "plugins" folder are considered, and all UI declared services override my headless services so nothing works.
So here is my question :
* Is there a solution to this ?
* In other words, is it possible to restrict the plugins which are being "loaded" when starting an application ?
* I think that everything would work fine if I create another headless product based on a new feature containing only the plugins I want and that I package separately... But it seems to me very much work for this little constraint.
But I am sure you guys will have a great idea / workaround !
Powered by FUDForum
. Page generated in 0.01853 seconds