adding the third example

git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@383795 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/org.apache.felix.examples.frenchdictionary/pom.xml b/org.apache.felix.examples.frenchdictionary/pom.xml
new file mode 100644
index 0000000..dfb1197
--- /dev/null
+++ b/org.apache.felix.examples.frenchdictionary/pom.xml
@@ -0,0 +1,50 @@
+<project>
+  <parent>
+    <groupId>org.apache.felix</groupId>
+    <artifactId>felix</artifactId>
+    <version>0.8-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <packaging>osgi-bundle</packaging>
+  <name>Apache Felix Examples: French Dictionary Service</name>
+  <artifactId>org.apache.felix.examples.frenchdictionary</artifactId>
+  <dependencies>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>org.osgi</artifactId>
+      <version>${pom.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>org.apache.felix.examples.dictionaryservice</artifactId>
+      <version>${pom.version}</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix.plugins</groupId>
+        <artifactId>maven-osgi-plugin</artifactId>
+        <version>${pom.version}</version>
+        <extensions>true</extensions>
+        <configuration>
+          <osgiManifest>
+            <bundleName>French Dictionary Example</bundleName>
+            <bundleVendor>Apache Software Foundation</bundleVendor>
+            <bundleDescription>
+              A bundle that registers a French dictionary service.
+            </bundleDescription>
+            <bundleActivator>
+              org.apache.felix.examples.frenchdictionary.Activator
+            </bundleActivator>
+            <importPackage>
+              org.apache.felix.examples.dictionaryservice
+            </importPackage>
+          </osgiManifest>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/org.apache.felix.examples.frenchdictionary/src/main/java/org/apache/felix/examples/frenchdictionary/Activator.java b/org.apache.felix.examples.frenchdictionary/src/main/java/org/apache/felix/examples/frenchdictionary/Activator.java
new file mode 100644
index 0000000..5615600
--- /dev/null
+++ b/org.apache.felix.examples.frenchdictionary/src/main/java/org/apache/felix/examples/frenchdictionary/Activator.java
@@ -0,0 +1,98 @@
+/*
+ *   Copyright 2006 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.felix.examples.frenchdictionary;
+
+
+import java.util.Properties;
+
+import org.apache.felix.examples.dictionaryservice.DictionaryService;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * This class implements a simple bundle that uses the bundle context to
+ * register an French language dictionary service with the OSGi framework. The
+ * dictionary service interface is defined in a separate class file and is
+ * implemented by an inner class. This class is identical to the class in
+ * Example 2, except that the dictionary contains French words.
+ * 
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ */
+public class Activator implements BundleActivator
+{
+    /**
+     * Implements BundleActivator.start(). Registers an instance of a dictionary
+     * service using the bundle context; attaches properties to the service that
+     * can be queried when performing a service look-up.
+     * 
+     * @param context the framework context for the bundle.
+     */
+    public void start( BundleContext context )
+    {
+        Properties props = new Properties();
+        props.put( "Language", "French" );
+        context.registerService( DictionaryService.class.getName(), new DictionaryImpl(), props );
+    }
+
+
+    /**
+     * Implements BundleActivator.stop(). Does nothing since the framework will
+     * automatically unregister any registered services.
+     * 
+     * @param context
+     *            the framework context for the bundle.
+     */
+    public void stop( BundleContext context )
+    {
+        // NOTE: The service is automatically unregistered.
+    }
+
+    
+    /**
+     * A private inner class that implements a dictionary service; see
+     * DictionaryService for details of the service.
+     */
+    private static class DictionaryImpl implements DictionaryService
+    {
+        // The set of words contained in the dictionary.
+        String[] m_dictionary = { "bienvenue", "au", "tutoriel", "osgi" };
+
+        /**
+         * Implements DictionaryService.checkWord(). Determines if the passed in
+         * word is contained in the dictionary.
+         * 
+         * @param word
+         *            the word to be checked.
+         * @return true if the word is in the dictionary, false otherwise.
+         */
+        public boolean checkWord( String word )
+        {
+            word = word.toLowerCase();
+
+            // This is very inefficient
+            for ( int i = 0; i < m_dictionary.length; i++ )
+            {
+                if ( m_dictionary[i].equals( word ) )
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
+    }
+}
diff --git a/pom.xml b/pom.xml
index e9285e6..8ef498d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -16,6 +16,7 @@
     <module>org.apache.felix.main</module>
     <module>org.apache.felix.examples.eventlistener</module>
     <module>org.apache.felix.examples.dictionaryservice</module>
+    <module>org.apache.felix.examples.frenchdictionary</module>
   </modules>
 
   <repositories>