commit | 38626d35b920f82f99f9fafab667856d93ad8c09 | [log] [tgz] |
---|---|---|
author | Pierre De Rop <pderop@apache.org> | Thu Feb 04 23:34:17 2016 +0000 |
committer | Pierre De Rop <pderop@apache.org> | Thu Feb 04 23:34:17 2016 +0000 |
tree | 9634ae4ab04f13449a8743bae9cb355003df3fbf | |
parent | c90bfa3e43666dc051221ccfbaacd6f4949fbce9 [diff] |
FELIX-5177: Support injecting configuration proxies. git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1728568 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/dynamicdep/api/Activator.java b/dependencymanager/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/dynamicdep/api/Activator.java index 7821363..58016bf 100644 --- a/dependencymanager/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/dynamicdep/api/Activator.java +++ b/dependencymanager/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/dynamicdep/api/Activator.java
@@ -48,7 +48,7 @@ dm.add(createComponent() .setImplementation(DynamicDependency.class) .add(createServiceDependency().setService(LogService.class).setRequired(true)) - .add(createConfigurationDependency().setPid(DynamicDependencyConfiguration.class.getName())) + .add(createConfigurationDependency().setPid(DynamicDependencyConfiguration.class.getName()).setCallback("updated", DynamicDependencyConfiguration.class)) .add(createServiceDependency().setService(EventAdmin.class).setRequired(true))); }
diff --git a/dependencymanager/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/dynamicdep/api/DynamicDependency.java b/dependencymanager/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/dynamicdep/api/DynamicDependency.java index 371ce02..22989a9 100644 --- a/dependencymanager/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/dynamicdep/api/DynamicDependency.java +++ b/dependencymanager/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/dynamicdep/api/DynamicDependency.java
@@ -49,10 +49,8 @@ /** * This is the first callback: we are injected with our configuration. */ - public void updated(Dictionary<String, Object> properties) throws ConfigurationException { - // We use the bnd "Configurable" helper in order to get an implementation for our DictionaryConfiguration interface. - if (properties != null) { - DynamicDependencyConfiguration cnf = Configurable.createConfigurable(DynamicDependencyConfiguration.class, properties); + public void updated(DynamicDependencyConfiguration cnf) throws ConfigurationException { + if (cnf != null) { storageType = cnf.storageType(); storageRequired = cnf.storageRequired(); }