如何让OSGi(配置管理)持久/重用您的配置? [英] How let OSGi (Config Admin) persist/reuse your configuration?

查看:168
本文介绍了如何让OSGi(配置管理)持久/重用您的配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是OSGi的新手。我的目的是使用config admin创建一个结构,所以你可以输入一个配置,这将在重新启动服务器后重复使用。

I'm new to OSGi. My aim is to create a structure with the config admin, so you can enter a configuration, which will be reused after restarting the server.

当我阅读api和尝试了一些样本,我认为这个功能将被默认包括。

While I have read the api and tried some samples, I thought this feature will be included by default.

我的问题:这是可能的,如果是的:此功能?

My question to you: Is this possible at all and if yes: what have I to consider to get this functionality?

PS。我使用Equinox

PS. I'm using Equinox

干杯
chris

cheers chris

推荐答案

配置管理服务中输入的配置默认为持久。但是请注意,Config Admin Service的每个实现都以自己的方式保留配置。

Configuration entered into Configuration Admin Service is persisted by default. However note that each implementation of Config Admin Service persists the configuration in its own way.

Equinox Config Admin (org.eclipse.equinox.cm)将配置数据存储在Framework提供的持久存储区域中。默认情况下,这是Equinox的本地捆绑缓存目录。

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.

因此,每次您清除捆绑包缓存或卸载/重新安装配置管理服务捆绑您的配置数据将丢失。不幸的是,似乎没有简单的方法来显式更改Equinox Config Admin服务的配置数据存储位置(可能使用 Felix Configuration Admin Service )。

Therefore each time you wipe-out the bundle cache or uninstall/reinstall the Config Admin Service bundle your configuration data will be lost. Unfortunately there seems to be no easy way to explicitly change the configuration data storage location for Equinox Config Admin service (possible with Felix Configuration Admin Service).

这篇关于如何让OSGi(配置管理)持久/重用您的配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆