Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Is there a "Blacklist" for Eclipse/OSGi to deny starting some plugins?
Is there a "Blacklist" for Eclipse/OSGi to deny starting some plugins? [message #92685] Mon, 23 July 2007 16:41 Go to next message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
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 #92736 is a reply to message #92685] Mon, 23 July 2007 22:17 Go to previous messageGo to next message
Eclipse UserFriend
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 #92750 is a reply to message #92736] Mon, 23 July 2007 23:46 Go to previous messageGo to next message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
Thanks Chris!

but what I'd really like goes beyond a whitelist: my headless app should
be able to use e.g. Team Provider extensions that I do not know, as long
as they are written in a way so they can run headless. That's why I was
asking for a blacklist rather than a whitelist -- I still want to be
extendable by 3rd parties.

Only extensions / bundles that have dependencies which are not
compatible with headless (e.g. require org.eclipse.ui) should not be loaded.

Thinking about it, I guess there must be a way for achieving this, since
the debugger basically does it when I disable a plugin e.g.
org.eclipse.ui in my launch config.

Thanks,
Martin

Chris Aniszczyk schrieb:
> 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 #92866 is a reply to message #92750] Tue, 24 July 2007 16:36 Go to previous messageGo to next message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
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
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 Go to previous message
Danail Nachev is currently offline Danail NachevFriend
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
Previous Topic:Lazy Bundle Activation Policy
Next Topic:How does my plugin know if it's running headless?
Goto Forum:
  


Current Time: Tue Apr 23 16:23:12 GMT 2024

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

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

Back to the top