How let OSGi (Config Admin) persist/reuse your configuration?

笑着哭i 提交于 2019-12-07 06:13:08

问题


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.

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. I'm using Equinox

cheers chris


回答1:


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) 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.

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).



来源:https://stackoverflow.com/questions/1221951/how-let-osgi-config-admin-persist-reuse-your-configuration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!