OSGI:osgi.bundles与osgi.bundles.defaultStartLevel

红色内容来自个人理解,其余来自eclipse helps。 英文: osgi.bundles
The comma-separated list of bundles which are automatically installed and optionally started once the system is up and running. Each entry is of the form:
    <URL | simple bundle location>[@ [<start-level>] [":start"]]
If the start-level (>0 integer) is omitted then the framework will use the default start level for the bundle. If the "start" tag is added then the bundle will be marked as started after being installed. Simple bundle locations are interepreted as relative to the framework's parent directory. The start-level indicates the OSGi start level at which the bundle should run. If this value is not set, the system computes an appropriate default.

osgi.bundles.defaultStartLevel
this is the startlevel that all bundles will be set to if installed by Eclipse Update. Bundles which are specified on the osgi.bundles list can specify a particular startlevel. If they do not specify a startlevel then they default to the value of osgi.bundles.defaultStartLevel. The default value of osgi.bundles.defaultStartLevel is 4.
中文:
osgi.bundles
用逗号分隔的捆绑软件列表,它们是自动安装的,在系统启动并运行后可选择启动它们。每个条目的格式是:
    <URL | 简单捆绑软件位置>[@ [<启动级别>] [":start"]]
如果省略启动级别(大于零的整数),则框架将对捆绑软件使用缺省启动级别。如果添加了“start”标记,则在安装后,会将捆绑软件标记为已启动。简单捆绑软件位置是相对于框架的父目录解释的。启动级别指示捆绑软件应该运行于的 OSGi 启动级别。如果未设置此值,系统将计算适当的缺省值。
osgi.bundles.defaultStartLevel
这是“Eclipse 更新”安装捆绑软件时对所有捆绑软件设置的启动级别。osgi.bundles列表中指定的捆绑软件可以指定特定的启动级别。如果它们未指定启动级别,则将使用osgi.bundles.defaultStartLevel 的值作为缺省值。osgi.bundles.defaultStartLevel 的缺省值是 4。


我的个人理解:在config.ini中的osgi.bundles节点中所配置的插件,都会在框架启动后自动启动,不管是否有加上启动级别和"start"标签。当没有设置启动级别时(reference\:file\:plugins/Bundle2_1.0.0.201211051608.jar@start),则使用osgi.bundles.defaultStartLevel的启动级别,如果添加了“start”标记,则在安装后,会将捆绑软件标记为已启动。我们可以在自己的RCP产品中config.ini的osgi.bundles中添加需要在框架启动后就启动的插件,并且可对他们的启动顺序进行定制。
eg:
osgi.bundles=reference\:file\:plugins/Bundle1_1.0.0.201211051608.jar@4\:start,\
reference\:file\:plugins/Bundle2_1.0.0.201211051608.jar@start,\
reference\:file\:plugins/Bundle3_1.0.0.201211051608.jar@4\:start,\
reference\:file\:plugins/Bundle4_1.0.0.201211051608.jar@5\:start,\
reference\:file\:plugins/Bundle5_1.0.0.201211051608.jar@6\:start
osgi.bundles.defaultStartLevel=3
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值