I am looking for a example of getting configuration using Karaf 4.3.x from JSON
configuration file. Below is an example, based on Karaf 4.2.x
karaf-config-example-scr, of getting the value for “key1” from the
configuration file “etc/foo.conf” that I am looking to Karaf 4.3 and JSON.
Ideally the example will include array and map examples for JSON file similar
to the following.
{
“Array”: [ “a”,’b”,”c”],
“Map”: {
“key1”: “value 1”,
“key2”: “value 2”
}
}
***
* Karaf 4.2 Bundle Class
***
@Component(configuationPid = “foo”)
…
@Activate
public activate( ComponentContext context) {
String keyValue = context.getProperties().get(“key1”);
}
***
* etc/foo.cfg
***
key1 = value 1
key2 = value 2
Paul Spencer