I have a general question regarding the “best practices” for populating the OSGi system bundle please.
The OSGi documentation describes the system bundle as containing both the OSGi framework (no surprise there, since it implements
org.osgi.framework.launcher.Framework) and the packages implemented by the JVM itself. And I’ve also noticed that packages from a host application can be “exported” into an embedded framework’s system bundle so that the host app and framework can communicate with each other. This all makes sense to me, and I have been regarding the system bundle as one that does not “require” anything that it cannot “provide” itself.
However, I have recently discovered an instance of a system bundle which doesn’t do this. Which is to say, the framework’s
org.framework.system.packages.extra property lists packages whose “uses” directives refer to other packages that are not exported by the system bundle.
I don’t understand how a system bundle like this can be “right”, but I also cannot find any resource that declares it to be definitively “wrong” either. (Although by the same token, nor does my gas oven have a sign advising me not to stick my head inside - YMMV!) It does beg the question of how OSGi is currently parsing those “uses” directives that contain unexported packages though?! After all, it’s not as if the system bundle has a property equivalent for
Import-Package to provide those packages with version ranges.
Can anyone point me to a document or resource that can resolve this point either way please?