osgi 中require-bundle import-package 的差别

来源:互联网 发布:http端口禁用 编辑:程序博客网 时间:2024/06/05 06:01


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).
原创粉丝点击