Find the dependent bundles in Eclipse at runtime

最后都变了- 提交于 2019-12-01 06:36:17

There is no easy way to determine the dependency. The best way is to go through the PackageAdmin interface. See the OSGi spec for PackageAdmin and getImportingBundles in particular: http://www.osgi.org/javadoc/r4v42/org/osgi/service/packageadmin/ExportedPackage.html#getImportingBundles()

You need to determine for all installed bundles, which one exports one or more packages that your bundle is importing. The easiest way to achieve this is to call PackageAdmin.getExportedPackages(Bundle bundle) with bundles = null. This returns an array of all exported packages. You then need to iterate of this array and call ExportPackage.getImportingBundles().

Holger Hoffstätte

Please see my answer to this question. 4.3 will have a new bundle wiring API that will allow things like this.

You can open an OSGi console and issue the following commands:

ss

To the the list of bundles, including the numeric id

bundle <id>

to get more information, including dependencies.

You should also try

help

to get more commands

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!