On 1/30/11 15:39, Lindsay Smith wrote:

Hi everyone,

Section 3.8.4 of the osgi core spec 'Overall Search Order' describes the order that classes are loaded by the bundle class loader.

I'd like to understand better the rule that the Import-Package list has precedence of the bundle's embedded classpath. In particular, consider a class file within the bundle. At linkage time, since the bundle imports are considered before the bundle classpath, then it is not possible for classpath libs to 'shadow' the packages imported by the bundle.

What would be the ramifications if the bundle classpath libs were able to shadow imported packages to the internal classes?

My instinct is that if this were possible, then while that internal class may see a consistent class space, that class could never be exported outside the bundle because its transitive dependencies ('uses' etc) could differ from its bundle imports (by coming from the classpath instead), meaning that consumers of that class would get class loader violations for those classes.

Is my analysis sound?


Yes. The issue would be if any of the imported (and shadowed) packages appeared in any "uses" constraints of any exported packages.

-> richard

Lindsay


_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to