Both will resolve package dependencies in osgi what is the difference between them
OSGi allows for dependencies to be determined via Import-Package , which just wires up a single package (exported from any bundle), and Require-Bundle , which wires up to a specific named bundle's exports.
This header declares the external dependencies of the bundle that the OSGi Framework uses to resolve the bundle. Specific versions or version ranges for each package can be declared.
jar,. The Bundle-ClassPath header defines a comma-separated list of JAR file path names or directories (inside the bundle) containing classes and resources. The full stop ( '. ' \u002E ) specifies the root directory of the bundle's JAR. The full stop is also the default.
Bootdelegation is a hack that is needed because some code inside the VM assumed that application class loaders had visibility to com.sun.* classes. In OSGi, this is obviously NOT the case. Boot delegation is parameter that specifies for which packages the framework may do a lookup on the boot classpath. Since this is not modular, don't do it. It is global for the framework.
DynamicImport-Package is similar but only for the bundle it is defined in and only for exported packages. If a package cannot be found in the normal bundle contents or Import-Package then a DynamicImport-Package specifies the patterns of packages that are allowed to be searched in the set of exported packages. This idea is similar to the classpath, you've no idea what version you're going to get. Once a package is found, it is used forever. However, if it is not found every access will keep looking. I.e. you can install the package after the fact without restarting the bundle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With