Example from Didier that uses SCR.


git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@430375 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/examples/spellcheckscr/src/main/resources/OSGI-INF/component.properties b/examples/spellcheckscr/src/main/resources/OSGI-INF/component.properties
new file mode 100644
index 0000000..467c98c
--- /dev/null
+++ b/examples/spellcheckscr/src/main/resources/OSGI-INF/component.properties
@@ -0,0 +1,9 @@
+
+service.pid=org.apache.felix.examples.spellcheckscr
+# service.ranking=10
+service.vendor=Apache Software Foundation
+
+foo=bar
+tic=tac toe
+
+
diff --git a/examples/spellcheckscr/src/main/resources/OSGI-INF/component.xml b/examples/spellcheckscr/src/main/resources/OSGI-INF/component.xml
new file mode 100644
index 0000000..624b2a7
--- /dev/null
+++ b/examples/spellcheckscr/src/main/resources/OSGI-INF/component.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<component name="spellcheckscr">
+
+  <!-- xmlns="http://www.osgi.org/xmlns/scr/v1.0.0" -->
+  <!--
+     This metadata file instructs the Apache Felix Service Component
+     Runtime to create one instance of "SpellCheckServiceImpl". It also
+     tells the generic activator that this instance implements the
+     "SpellCheckService" service interface and that it has an
+     aggregate dependency on "DictionaryService" services. Since
+     the service dependency on dictionary services has a lower
+     cardinality of one, the generic activator will create the instance
+     and offer its spell check service only when there is at least
+     one dictionary service available. The service dependency is
+     "dynamic", which means that dictionary service availability
+     will be monitored dynamically at runtime and it also tells the
+     generic activator which methods to call when adding and removing
+     dictionary services.
+    -->
+	<implementation class="org.apache.felix.examples.spellcheckscr.SpellCheckServiceImpl"/>
+
+	<property name="category" value="demo" type="String"/>
+	
+	<properties entry="OSGI-INF/component.properties"/>	
+	
+	<service>
+		<provide interface="org.apache.felix.examples.spellcheckservice.SpellCheckService"/>
+	</service>
+
+	<reference name="DICTONARY"
+	    interface="org.apache.felix.examples.dictionaryservice.DictionaryService"
+	    filter="(Language=*)"
+	    cardinality="1..n"
+	    policy="dynamic"
+	    bind="addDictionary"
+	    unbind="removeDictionary"
+	/>
+</component>