Jugu
Jugu

Reputation: 797

How and where configure bundles through "apache felix configAdmin"

I try to use the "Apache Felix" implementation of OSGi for my project, I launch the framework from the distributable jar (/bin /felix.jar). I have created simple example bundles to register or consume services in the registry. I want to use a configuration management service so I installed the bundle "org.apache.felix.configadmin" felix in the framework, and then I do not know how and where to put the configuration file of another bundle, for example I want to install the bundle "org.apache.felix.http.jetty" and then I want to configure this bundle through the configAdmin, so how I rename my config file, and where to put it?

Another question, what is the difference between setting, for example, the property "org.osgi.service.http.port" of the jetty bundle using the framework properties(conf/config.properties) or configure it through the bundle of configuration admin service.

Best regards,

Upvotes: 1

Views: 3313

Answers (2)

Christian Schneider
Christian Schneider

Reputation: 19626

Normally you use the felix config admin service together with the felix fileinstall. So fileinstall takes care of the directory to be monitored for config files and hands over to config admin to make it available as configs in OSGi.

For a fully working example take a look at Apache Karaf. There you can see the configs you need for it to work together. You might also consider to simply install your own bundles into karaf as it makes managing the felix framework a lot easier.

Upvotes: 2

Achim Nierbeck
Achim Nierbeck

Reputation: 5285

You probably also need the file-installer from felix for it to pick up the config files. If you want to see a working example of this take a look at Apache Karaf. It's a OSGi Container with lots of nice preconfigured features. The config admin service works out of the box.

Upvotes: 2

Related Questions