Reputation: 459
We are developing a Netbeans RCP application that includes NB modules, and OSGi modules. We are trying to use config admin service within our OSGi modules. Our basic goal is to get a osgi module's configuration from a config property file via OSGi admin service.
But we don't have been able to read our config property file even if we tried possible file locations( under user dir, osgi run dir etc...). We have also tried to set up felix but no success.
It should be very helpful, if someone can guide use how to place config property file to an appropriate location and get it read by config admin service.
Netbeans version is 7.3.1 and we run in Windows 8 64 bit.
Thanks...
Upvotes: 1
Views: 188
Reputation: 15372
A simple solution (there are many others as @arivanw explains) is to use Apache FileInstall. It can be used to define configurations in .cfg files and instal then when you put them in a magic folder. They're uninstalled when you remove them from that folder.
Upvotes: 1
Reputation: 1146
The way to set the properties for a configuration admin service is actually by means of the configuration admin interface itself. How the configurations are stored is up to the service and not necessarily via property files. Therefore, the way to go, if you want to follow the specifications, is to let a bundle load the property files into the configuration admin via its interface.
As an alternative, the Felix configuration admin service allows you to plug-in your own persister solution to read and write the configurations. An implementation of a persister that uses property files can be found here. It is a very basic persister and specifically written for the Felix configuration admin implementation.
Upvotes: 2