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 exported 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 the packages you export, then the framework is free to choose a different provider of those packages for your bundle at resolve time, 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. The reason why this is a good thing is because it allows for higher levels of bundle interoperability. The more versions of a given package that are in use at any given time can lead to conflicts when trying to resolve bundle package dependencies and this also leads to partitioning of the service registry, since bundles can only see a single version of a given service package.

If your bundle only exports its packages, then it is forcing the framework to wire itself to 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