To be clear, require-bundle and import-package are not equivalent, but
they certainly overlap. A simple way of looking at require-bundle is
that it is a shorthand way of importing every package that is exported
by another bundle, but it a slightly different than this in reality.
Import-package terminates when a class from the package is not found
(i.e., packages are assumed to be self-contained), while require-bundle
does NOT terminate when a class from a package is not found, it
continues searching other required bundles as well as the local bundle
itself (i.e., packages are assumed to be split).
osgi 中require-bundle import-package 的差别
Require-Bundle与Import-Package的区别
最新推荐文章于 2022-01-13 16:00:10 发布
本文探讨了OSGi中Require-Bundle与Import-Package指令的区别。Require-Bundle类似于导入另一个bundle的所有包的一种快捷方式,但实际操作上有所不同。Import-Package在找不到指定包内的类时会终止搜索,而Require-Bundle则会继续在其他依赖bundle中查找,假设包可能被分割。
1万+

被折叠的 条评论
为什么被折叠?



