Hi all,

I try to set dynamically a property associated at a bundle.
Explanation:

in /etc I have a configuration file for my x.y.z.MyBundle
(x.y.z.MyBundle-default.cfg)
inside it there are some properties (key/value)

The goal is outside this MyBundle (an another) I would like update some
properties of it.

I succeeded with this code
ConfigRepository configRepository;
Configuration[] configs =
configRepository.getConfigAdmin().listConfigurations("(service.factoryPid=x.y.z.MyBundle)");

Dictionary props = configs[0].getProperties();
props.put("myKey", 20);
configs[0].update(props);

It's works perfectly, but the issue, is I don't know, how I can retrieve the
factoryPid for an bundle 
in fact I have the bundle object or the bundleContext, but????
I use Ipojo too

Thx for any help.

Regards





--
View this message in context: 
http://karaf.922171.n3.nabble.com/Set-dynamically-a-property-hosted-in-a-etc-config-file-tp4049866.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to