Sharing a configuration file between OSGi bundles in Apache Servicemix 4?

自作多情 提交于 2019-12-03 04:04:36

I share my configuration located in

$SMX_HOME/etc/my.config.cfg

using this declaration

<!-- get properties as bean from OSGi Configuration Admin Service -->
<osgix:cm-properties id="myConfig" persistent-id="my.config" />

<!-- activate ${...} placeholder -->
<ctx:property-placeholder properties-ref="myConfig" />

in each of my bundles. Looks quite similar to your solution and works perfect! You can share your configuration (do not need to provide a configuration file for each bundle) but you have to declare the reference to this configuration in each spring-application-context file.

Im using FUSE 4.3 which is based on apache-servicemix-4.3.0-fuse-01-00.

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