1

是否有正确的方法来定义 JBoss 7.1 应用程序服务器上 osgi 包的启动级别,例如在Equinox 配置中?

谢谢!!!

4

1 回答 1

1

从概念上讲,您应该首先确定服务器内部的哪个包或代码实际安装了您的包。这个捆绑包,通常被称为“管理代理”,也应该负责为这些捆绑包设置正确的启动级别。OSGi 定义了一个“StartLevel”服务(在规范的第 8 章中描述),除其他外,它允许您通过以下任一方式设置捆绑包的启动级别:

setInitialBundleStartLevel(int) // sets the start level for
                                   all bundles installed afterwards

或者:

setBundleStartLevel(Bundle, int) // sets the start level for a
                                    specific bundle

当然,很可能 JBoss 已经提供了一种机制来做到这一点,但至少这应该给你一个起点。

于 2013-02-15T16:15:43.923 回答