Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

Frequently Asked Questions

Should a bundle import its own packages?

In OSGi R3 this was always the case, since Export-Package implied Import-Package. It was a good idea then and is generally a good idea now.

The whole point is substitutability of providers.

If you import what you export, then the framework is free to choose a different provider of those packages for your bundle, which means that your exports may go unused. However, this is a good thing, because the framework tries to minimize the number of active versions of a given package. This is a good thing because more active versions means divisions in the service registry and less interoperability of bundles.

If your bundle only exports its packages, then it is forcing the framework to use its own version, which can result in more active version of the given package.

...

  • OSGi FAQ - Contains answers to general OSGi-related questions.
  • Framework FAQ - Contains answers to questions that are specifically related to Felix' OSGi framework implementation.
  • Bundle Plugin FAQ - Contains answers to questions about the Felix maven-bundle-plugin
  • SCR Plugin FAQ - Contains answers to questions about the Felix maven-scr-plugin