osgi中bootdelegation和DynamicImport-Package有什么区别 [英] What is the difference between bootdelegation and DynamicImport-Package in osgi

查看:751
本文介绍了osgi中bootdelegation和DynamicImport-Package有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

两者都将解决osgi中的包依赖关系它们之间有什么区别

Both will resolve package dependencies in osgi what is the difference between them

推荐答案

Bootdelegation是一个需要的hack,因为一些VM中的代码假定应用程序类加载器具有com.sun。*类的可见性。在OSGi中,显然不是这种情况。引导委派是一个参数,它指定框架可以在引导类路径上执行查找的包。由于这不是模块化的,所以不要这样做。它是框架的全局。

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类似,但仅适用于定义的包,仅适用于导出的包。如果在普通包内容或Import-Package中找不到包,则DynamicImport-Package指定允许在导出包集中搜索的包的模式。这个想法类似于classpath,你不知道你将得到什么版本。找到包后,它将永久使用。但是,如果没有找到,每次访问都会继续查看。即您可以在事后安装软件包,而无需重新启动软件包。

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.

这篇关于osgi中bootdelegation和DynamicImport-Package有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆