更改 OSGi 运行时的启动级别状态
OSGi 包启动级别可以在运行时根据 BundleStartLevel API 为每个包定义。
OSGi 框架提供了一个初始启动级别“org.osgi.framework.startlevel.beginning”,框架在启动时将运行时设置为该级别。
我想知道的是,是否有一种方法可以在运行时更改框架的当前启动级别,以便在更改时,所有不再满足启动级别的捆绑包都将按正确的顺序关闭。或者反之反之亦然,当前未运行的任何包都将启动到新的启动级别,类似于 UNIX 运行级别。
OSGi bundle start levels can be defined per bundle during runtime per the BundleStartLevel API.
The OSGi framework offers an initial start level "org.osgi.framework.startlevel.beginning", which the framework takes the runtime to at startup.
What I would like to know is if there is a way during runtime to change the current start level of the framework such that on change, all bundles that are no longer meeting the start level would be shut off in the proper order.. or vice versa, any bundles that are not currently running would then be started up to the new start level, akin to unix run levels.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用旧的(现已弃用)StartLevel.setStartLevel 或新的 FrameworkStartLevel.setStartLevel 方法。
You can use the old (now deprecated) StartLevel.setStartLevel or the new FrameworkStartLevel.setStartLevel methods.