Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cross-project-issues-dev] Re: [orbit-dev] Goolge Guice ( Bundle in Orbit exports wrong packages versions

cross-project-issues-dev-bounces@xxxxxxxxxxx wrote on 06/15/2010 09:13:30 AM:

> From:

> Gunnar Wagenknecht <gunnar@xxxxxxxxxxxxxxx>

> Sounds like a plan. So a bundle can export a package in multiple
> versions? Frankly, didn't know about such a feature.
> -Gunnar

Yeah, it is not a well known feature of the OSGi spec. and definitely not a best practice.  Way back in the R4.0 spec process there were a few requirements to allow a single bundle to be able to export the same package with different matching attributes and directives.  The intention was to allow parts of a package to be hidden to the normal consumer through the use of the include/exclude directives and then export the full package a second time without any include/exclude filters, but using a mandatory directive to specify a special matching attribute that must be specified to access the complete package.

Please never think about doing this, it is far too confusing and will lead to very hard class loading issues when a client cannot find some class in a package it thinks it is importing correctly.  Anyway, out of this "bad" requirement IMHO came the ability to export the same package with different matching attributes, one of those being the package version.  I don't expect you will ever read up on this in any of the OSGi books ;-)


Back to the top