use the latest configadmin 1.2.8, which fixes an issue with respect to private properties whose name start with a dot
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@997056 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/samples.annotation/README b/dependencymanager/samples.annotation/README
index 38e855f..c981a7b 100644
--- a/dependencymanager/samples.annotation/README
+++ b/dependencymanager/samples.annotation/README
@@ -25,12 +25,12 @@
How to test:
- - Install the following bundles:
+ - Install the following bundles (with same or higher version):
- org.apache.felix.configadmin
- org.apache.felix.metatype
- org.apache.felix.http.jetty
- org.apache.felix.webconsole
+ org.apache.felix.configadmin-1.2.8.jar
+ org.apache.felix.metatype-1.0.4.jar
+ org.apache.felix.http.jetty-2.0.4.jar
+ org.apache.felix.webconsole-3.1.2.jar
- compile dependency manager from trunk:
diff --git a/dependencymanager/samples.annotation/src/main/java/org/apache/felix/dm/samples/annotation/DictionaryImpl.java b/dependencymanager/samples.annotation/src/main/java/org/apache/felix/dm/samples/annotation/DictionaryImpl.java
index a0a6204..c44c5bf 100644
--- a/dependencymanager/samples.annotation/src/main/java/org/apache/felix/dm/samples/annotation/DictionaryImpl.java
+++ b/dependencymanager/samples.annotation/src/main/java/org/apache/felix/dm/samples/annotation/DictionaryImpl.java
@@ -52,15 +52,21 @@
cardinality=0),
@PropertyMetaData(
heading="Dictionary words",
- description="Declare here the list of words supported by this dictionary.",
+ description="Declare here the list of words supported by this dictionary. This properties starts with a Dot and won't be propagated with Dictionary OSGi service properties.",
defaults={"hello", "world"},
- id="words",
+ id=DictionaryImpl.WORDS,
cardinality=Integer.MAX_VALUE)
}
)
public class DictionaryImpl implements DictionaryService
{
/**
+ * The key of our config admin dictionary values. This key stats with a "." (dot), meaning
+ * that this property won't be propagated along with our OSGi service properties.
+ */
+ final static String WORDS = ".words";
+
+ /**
* We store all configured words in a thread-safe data structure, because ConfigAdmin
* may invoke our updated method at any time.
*/
@@ -79,12 +85,12 @@
/**
* Our service will be initialized from ConfigAdmin.
- * @param config The configuration where we'll lookup our words list (key="words").
+ * @param config The configuration where we'll lookup our words list (key=".words").
*/
protected void updated(Dictionary<String, ?> config) {
m_lang = (String) config.get("lang");
m_words.clear();
- String[] words = (String[]) config.get("words");
+ String[] words = (String[]) config.get(WORDS);
for (String word : words) {
m_words.add(word);
}