Pierre De Rop | faca289 | 2016-01-31 23:27:05 +0000 | [diff] [blame] | 1 | package org.apache.felix.dm.lambda.samples.compositefactory; |
| 2 | |
| 3 | import java.io.IOException; |
| 4 | import java.util.Dictionary; |
| 5 | import java.util.Hashtable; |
| 6 | |
| 7 | import org.osgi.service.cm.Configuration; |
| 8 | import org.osgi.service.cm.ConfigurationAdmin; |
| 9 | |
| 10 | public class Configurator { |
| 11 | volatile ConfigurationAdmin m_cm; // injected by reflection. |
| 12 | |
| 13 | void start() throws IOException { |
| 14 | // Configure the ServiceConsumer component |
| 15 | Configuration c = m_cm.getConfiguration(ProviderFactory.class.getName(), null); |
| 16 | Dictionary<String, Object> props = new Hashtable<>(); |
| 17 | props.put("foo", "bar"); |
| 18 | c.update(props); |
| 19 | } |
| 20 | } |