配置 Equinox 以修改“本地捆绑包缓存”的管理
关于上一个问题,如何让 OSGi 通过以下方式重用您的配置Config Admin,我还在尝试在 Equinox Framework 中解决这个问题。
帕沃尔·朱霍斯写道:
Equinox Config Admin (org.eclipse.equinox.cm) 将配置数据存储在框架提供的持久存储区域中。 这恰好是 Equinox 默认情况下的“本地捆绑包缓存”目录。
所以我阅读了这个主题,发现有几个 Equinox 的运行时选项(以及 osgi.configuration.area 等)。
我想要的是更改配置,以便本地捆绑包缓存不会被删除或清理,因此下次我运行框架时,将使用最后输入的配置(对于任何捆绑包)。
Relating to a previous question, how let OSGi to reuse your configuration via Config Admin, I am still trying to solve this problem in the Equinox Framework.
Pavol Juhos wrote:
Equinox Config Admin (org.eclipse.equinox.cm) stores the configuration data in the persistent storage area provided by the Framework. And that happens to be the "local bundle cache" directory by default for Equinox.
So i read up on this topic and found that there are several runtime options for Equinox (among other things osgi.configuration.area).
What I want is to change the configuration, in order that the local bundle cache won't be droped or cleaned, so the next time I'll run the Framework, the last entered configuration (for any bundle) will be used.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
还有 osgi.clean 属性。 如果将此设置为 true,则 OSGi 容器必须在启动时删除现有的包缓存(以及所有相关数据)并将包重新加载到运行时缓存中。 如果您将其设置为 false,那么您的捆绑包缓存应该可以在重新启动后继续存在。
这记录在 Eclipse SDK Equinox 运行时选项中。
There is also the
osgi.clean
property. If you set this to true, the OSGi container must delete the existing bundle cache (and all related data) on startup and reload the bundles into the runtime cache. If you set this to false then your bundle cache should survive a restart.This is documented in the Eclipse SDK Equinox Runtime Options.
CM 的设计目的不是在容器停止后保留数据。
如果您想这样做,则必须使用首选项服务。
因此,您的应用程序在初始化时必须从 PS 管理的持久存储中获取数据并将其“传递”到 CM 才能正常工作。
CM was not design to persist data after you stop the container.
If you want to do that you must use the Preferences Service.
So your application, at initialization, must get data from you persistent store managed by PS and 'pass it' to the CM do it works.
用于指定是否应在框架启动时清除包缓存的 OSGi 标准属性是 org.osgi.framework.storage.clean 。
这是一个相对较新的(事实上,它仍然是一个草稿,可以在 R4.2 草案(第 4.2.2 节下),但我猜它应该在最近的 Equinox 版本中工作。
The OSGi standard property for specifying whether the bundle cache should be purged on framework startup is
org.osgi.framework.storage.clean
This is a relatively new one (in fact, it is still a draft, find it in the R4.2 Draft under section 4.2.2), but it should work in recent Equinox versions, I guess.