Author: pderop
Date: Tue Sep 14 19:42:56 2010
New Revision: 997056
URL: http://svn.apache.org/viewvc?rev=997056&view=rev
Log:
use the latest configadmin 1.2.8, which fixes an issue with respect to private
properties whose name start with a dot
Modified:
felix/trunk/dependencymanager/samples.annotation/README
felix/trunk/dependencymanager/samples.annotation/src/main/java/org/apache/felix/dm/samples/annotation/DictionaryImpl.java
Modified: felix/trunk/dependencymanager/samples.annotation/README
URL:
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/samples.annotation/README?rev=997056&r1=997055&r2=997056&view=diff
==============================================================================
--- felix/trunk/dependencymanager/samples.annotation/README (original)
+++ felix/trunk/dependencymanager/samples.annotation/README Tue Sep 14 19:42:56
2010
@@ -25,12 +25,12 @@ Sample description:
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:
Modified:
felix/trunk/dependencymanager/samples.annotation/src/main/java/org/apache/felix/dm/samples/annotation/DictionaryImpl.java
URL:
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/samples.annotation/src/main/java/org/apache/felix/dm/samples/annotation/DictionaryImpl.java?rev=997056&r1=997055&r2=997056&view=diff
==============================================================================
---
felix/trunk/dependencymanager/samples.annotation/src/main/java/org/apache/felix/dm/samples/annotation/DictionaryImpl.java
(original)
+++
felix/trunk/dependencymanager/samples.annotation/src/main/java/org/apache/felix/dm/samples/annotation/DictionaryImpl.java
Tue Sep 14 19:42:56 2010
@@ -52,15 +52,21 @@ import org.osgi.service.log.LogService;
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 @@ public class DictionaryImpl implements D
/**
* 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);
}