关于OSGI模块化编程中MENIFEST.MF文件中的Required Plug-ins和Imported Packages的区别

本文探讨了OSGI模块化编程中MANIFEST.MF文件中的Required Plug-ins和Imported Packages的区别。Required-Bundle指定运行此插件所需的其他插件,而Imported-Package仅依赖特定包,不指定来源插件。使用Import-Package可以实现更松散的耦合,但当相同包存在于多个插件中时,需依赖插件本身。建议优先考虑Import-Package以提高灵活性。
摘要由CSDN通过智能技术生成

最近在做一个“把OSIG上的bundle结构的工程打成标准的war包来在各中间件上发布”的工作,给了自己一个了解OSGI底层源码的机会。过程中也发现了许多之前开发时没注意的小问题,譬如这个Dependencise中的Required Plug-ins和Imported Packages的区别,网上搜集了些资料,总结到这里吧:

参考自:http://blog.sina.com.cn/s/blog_69d0d3310100mehz.html

Required-Bundle: Specifythe list of plug-ins required for the operation of this plug-in.

Imported-Package:Specifypackages on which this plug-in depends without explicitly identifying theiroriginating plug-in.

Eclipse allows to define dependencies between plug-ins based on bundle or on package level. In theMANIFEST.MFof the plugin.xml you can tell that your plug-in should either depend onanother plug-in (and all its exported packages) or if your plug-in should onlydepend on the availability of certain packages no matter which plug-in isexporting t

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值