Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[orbit-dev] Problems with the Export-Package "uses" directive

Hello all.

I am sending this note to inform the community that the Export-Package "uses" directive can critically effect the performance of the Equinox OSGi package resolver when a system contains a large set of bundles (1000s) and there are multiple exporters of the same package name. See

Unfortunately this means that as a community we should *not* include any bundles that declare the Export-Package "uses" directive in the Ganymede release. Here is an example of a bundle manifest file (META-INF/MANIFEST.MF) with an Export-Package statement that contains a "uses" directive

Bundle-SymbolicName: foo
Export-Package:; uses:=""

More details:

The Export-Package "uses" directive in OSGi is used by the Framework to ensure class space consistencies when multiple exporters of a package exist in the Framework. In the above example there may be multiple exporters of the "" package in the Framework. This Export-Package statement is informing the Framework that in order for a bundle to get wired to the "" package exported by the "foo" bundle then the importing (or requiring) bundle must be wired to the same exporter of "" as the foo bundle is.

This is essential when dealing with multiple exporters of the same package. Unfortunately the problem of resolving the state with "uses" clauses appears to be an NP-hard problem to solve. Please see bug if you have ideas of how to solve such a problem.

Thanks and sorry for the inconvenience.


Back to the top