Is there a "Blacklist" for Eclipse/OSGi to deny starting some plugins? [message #92685] |
Mon, 23 July 2007 12:41  |
Eclipse User |
|
|
|
Hello,
I'm writing an Eclipse based IDE that provides some services which can
also be used as part of a headless application. Some of these services
should use Extensions contributed through Eclipse extension points like
e.g. org.eclipse.core.variables.
The problem I have now is, that when any 3rd party contributes to
org.eclipse.core.variables in a UI-plugin, that plugin gets loaded also
when I'm running my headless application.
I'd therefore like to pass kind of a "Blacklist" to the Equinox runtime
when starting my headless application. I'm thinking that if my
"Blacklist" denies loading plugins such as org.eclipse.ui, then other
3rd party UI plugins which would otherwise contribute to
org.eclipse.core.variables can not do so, because their dependency
requirements are not met.
Does such an approach make sense?
Does such a "Blacklist" mechanism exist?
Thanks,
--
Martin Oberhuber
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
|
|
|
|
|
|
Re: Is there a "Blacklist" for Eclipse/OSGi to deny starting some plugins? [message #92976 is a reply to message #92866] |
Wed, 25 July 2007 02:04  |
Eclipse User |
|
|
|
Hi, Martin,
Bundle uninstallation is persistent. The bundle is removed from the
framework state and will not be available the next time you launch. One
trick here is that org.eclipse.update.configurator will most probably
install it again on the next run, because in the default configuration,
update.configurator bundle will install all bundles found in the plugins
folder.
Review the documentation for platform.xml. It can be found in the
Eclipse Help. You can specify which plugins should be disabled and they
will be not available in the runtime. This depends on the policy of the
site. Chris Aniszczyk already mentioned one such policy: MANAGED_ONLY.
There are two more: USER_INCLUDE and USER_EXCLUDE. USER_EXCLUDE lets you
provide a list of plugins, which must not be in the runtime. For this to
work you need to include update.configurator in your configuration
specified in the update.configurator.
Danail
Martin Oberhuber wrote:
> Hello again,
>
> here is an idea that I got from another source for implementing the
> "Blacklist": If my headless application code marked those plugins that I
> like to be on the blacklist as "uninstalled" while booting, OSGi would
> no longer be able to resolve those bundles. The "uninstalled" state is
> not persistent so the next time I run my application in UI mode they
> would still be there:
>
> Iterator it = blacklist.iterator();
> while (it.hasNext()) {
> String bundleId = (String)it.next();
> Bundle bundle= Platform.getBundle(bundleID);
> if (bundle != null) {
> int state= bundle.getState();
> if (state == Bundle.INSTALLED || state == Bundle.RESOLVED) {
> bundle.uninstall();
> }
> else {
> // why was the plugin already activated that early?
> assert false: bundleID + " was activated.";
> }
> }
> }
>
>
> What do the Equinox Gurus think, does this make sense?
>
> Thanks,
> --
> Martin Oberhuber
> Target Management Project Lead, DSDP PMC Member
> http://www.eclipse.org/dsdp/tm
|
|
|
Powered by
FUDForum. Page generated in 0.06728 seconds