|
Re: Is there a "Blacklist" for Eclipse/OSGi to deny starting some plugins? [message #92736 is a reply to message #92685] |
Mon, 23 July 2007 22:17 |
Eclipse User |
|
|
|
Originally posted by: zx.us.ibm.com
Martin, there are probably a few ways to do this, but the simplest I
think is to use Update. Are you familiar with update policies in the
platform.xml and MANAGED_ONLY?
If you have MANAGED_ONLY on, only features listed in the platform.xml
are enabled by the platform. This gives you a way to control what is
loaded by the Platform. I guess this could be your "whitelist" :)
Cheers,
~ Chris
|
|
|
|
|
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 06:04 |
Danail Nachev Messages: 36 Registered: July 2009 |
Member |
|
|
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.03196 seconds