Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » OSGI Cache and Feature Dependency: How does it work?( OSGI Cache and Feature Dependency: How does it work?)
OSGI Cache and Feature Dependency: How does it work? [message #1844723] Thu, 23 September 2021 05:49 Go to next message
Mike Bassett is currently offline Mike BassettFriend
Messages: 1
Registered: September 2021
Junior Member
I understand that Eclipse needs to have read/write access to its installation folders in order to create/refresh the cache used for plug-in features. What I need is a clear explanation of the Eclipse process when there is a feature version compatibility issue.

I am working with the IBM IDz RCP in 2 different scenarios where a dependency exists on an already installed feature that impacts a plug-in being installed into Eclipse.

I tried to figure this out myself observing Eclipse/IDz behavior and through research from various articles I found using Google search. As a result, I made the following conclusions for each of the scenarios:

In IDz 14 the feature that XYZ 1.0 plug-in included as part of it's installation as a dependency was at the same version level as the feature already installed and cached in the Eclipse 4.06/IDz 14 configuration. When the versions match, the XYZ plug-in will work as expected. The Eclipse cache does not need to be cleared and rebuilt in this scenario.

In IDz 15 the feature that XYZ 2.0 plug-in included as part of it's installation as a dependency was at a higher version level then the feature already installed and cached in the Eclipse 4.08/IDz 15 configuration. When this happens, the XYZ plug-in will try to use the cached version only to find out it is incompatible/not at the required version level, and a Java exception occurs. In this case the Eclipse cache does need to be cleared and rebuilt.

The only way to resolve the feature version incompatibility in scenario 2 is to use the "-clean" function to tell Eclipse to clear the cache and rebuild it so that all current feature versions are loaded.

Could someone kindly review these statements and if possible 1) confirm my statements above, 2) provide a clearer explanation, or 3) point me to a Eclipse document that fully explains the process.

I look forward to hear from many of the experts out there that have a much deeper knowledge on this subject than I do.
Re: OSGI Cache and Feature Dependency: How does it work? [message #1844750 is a reply to message #1844723] Fri, 24 September 2021 06:01 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
This sounds like it's related to something called wiring and is in no way related to features but only to plugins. Plugins can require other plugins based on import packages and on required plugins. Many/most plugins are singletons, so the requirement on another plugin can only be satisfied by one plugin. But if the required plugin is not a singleton, or in the case of an imported package where more than one bundle/plugin provides that package, a choice must be made which plugin to "wire" to satisfy the requirement. The details of the wiring algorithm are complex because it's important to create a consistent set of wirings. I.e., if A requires B requires C and each of A, B, C also require D1, D2, or E, then it's generally good (and necessary if the classes from D1, D2, or E are exposed in the API of A, B, and C) if A, B, and C are all wired to the same choice of D1, D2, or E, not to different ones.

The issue you describe arises because of incremental updates to the wiring. I.e., new things are added/installed, which OSGi detects at startup so it must determine wirings for those things. But, in older versions of Eclipse, it did that incrementally, generally preserving the wirings of those things previously wired. As such, it could well come up with a wiring that is different from the wiring produced by rewiring all the plugins from scratch, i.e., what you see with -clean.

So this behavior of an already-installed plugin wiring to an already installed older version of some plugin for which an additional newer version has been installed is to be expected.

I believe this behavior was changed, last year, but I don't remember specifically when.

Of course you have influence over the wiring by explicitly requiring new/higher versions...


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Configure Jetty to use HTTPS
Next Topic:Regrading R4_19_maintenance branch
Goto Forum:
  


Current Time: Fri Apr 19 13:05:56 GMT 2024

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

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

Back to the top