added a maven build creating the 10 minutes tutorial
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1470471 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/build.xml b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/build.xml
new file mode 100644
index 0000000..86f682b
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/build.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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.
+ -->
+
+<project name="spell.checker.example" default="package" basedir=".">
+
+ <target name="clean">
+ <ant dir="spell.services" target="clean"/>
+ <ant dir="spell.english" target="clean"/>
+ <ant dir="spell.checker" target="clean"/>
+ <ant dir="spell.checker.gui" target="clean"/>
+ <ant dir="solution" target="clean"/>
+ <delete dir="felix-framework-${felix.version}/felix-cache"/>
+ <delete dir="dist"/>
+ </target>
+
+ <target name="package">
+ <ant dir="spell.services" target="package"/>
+ <ant dir="spell.english" target="package"/>
+ <ant dir="spell.checker" target="package"/>
+ <ant dir="spell.checker.gui" target="package"/>
+ <ant dir="solution" target="package"/>
+ </target>
+
+ <target name="dist" depends="clean">
+ <mkdir dir="dist"/>
+ <zip destfile="dist/tutorial.zip">
+ <fileset dir=".">
+ <exclude name="build.xml"/>
+ <exclude name="dist"/>
+ <exclude name=".*"/>
+ <exclude name="*/_*"/>
+ </fileset>
+ </zip>
+ </target>
+
+</project>
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker.gui/build.xml b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker.gui/build.xml
new file mode 100644
index 0000000..78999e6
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker.gui/build.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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.
+ -->
+
+<project name="spell.checker.gui" default="package" basedir="">
+
+ <property name="src.dir" value="src"/>
+ <property name="lib.dir" value="libs"/>
+ <property name="build.dir" value="output/classes"/>
+ <property name="output.dir" value="output"/>
+
+ <taskdef resource="aQute/bnd/ant/taskdef.properties"
+ classpath="../tasks/bnd-${bnd.version}.jar"/>
+ <taskdef name="ipojo" classpath="../tasks/org.apache.felix.ipojo.ant-${ipojo.ant.version}.jar"
+ classname="org.apache.felix.ipojo.task.IPojoTask"/>
+
+ <target name="clean">
+ <delete dir="${build.dir}"/>
+ <delete dir="${output.dir}"/>
+ <delete dir="${lib.dir}"/>
+ </target>
+
+ <target name="buildclasspath">
+ <copy file="../spell.services/output/spell.services.jar" todir="${lib.dir}"/>
+ <copy file="../tasks/org.apache.felix.ipojo.ant-${ipojo.ant.version}.jar" todir="${lib.dir}"/>
+ </target>
+
+ <path id="classpath">
+ <fileset dir="${lib.dir}" includes="**/*.jar"/>
+ </path>
+
+ <target name="compile" depends="clean, buildclasspath">
+ <mkdir dir="${output.dir}"/>
+ <mkdir dir="${build.dir}"/>
+
+ <javac srcdir="${src.dir}"
+ destdir="${build.dir}"
+ debug="on"
+ classpathref="classpath"
+ />
+
+ </target>
+
+ <target name="package" depends="compile">
+ <bnd
+ classpath="${build.dir}"
+ failok="false"
+ exceptions="true"
+ files="${ant.project.name}.bnd"
+ output="${output.dir}"/>
+
+ <ipojo
+ input="${output.dir}/${ant.project.name}.jar"
+ />
+ </target>
+
+</project>
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker.gui/spell.checker.gui.bnd b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker.gui/spell.checker.gui.bnd
new file mode 100644
index 0000000..f367fa1
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker.gui/spell.checker.gui.bnd
@@ -0,0 +1 @@
+Private-Package: spell.gui
\ No newline at end of file
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker.gui/src/spell/gui/SpellCheckerGui.java b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker.gui/src/spell/gui/SpellCheckerGui.java
new file mode 100644
index 0000000..b288c2d
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker.gui/src/spell/gui/SpellCheckerGui.java
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 spell.gui;
+
+import org.apache.felix.ipojo.annotations.*;
+import spell.services.SpellChecker;
+
+import javax.swing.*;
+
+/**
+ * A very simple Gui interacting with the CheckSpeller service
+ */
+@Component // It's a component
+@Instantiate // We declarare an instance
+public class SpellCheckerGui extends JFrame {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Swing component where the user write the passage to check.
+ */
+ private JTextField passage = null;
+
+ /**
+ * Area where the result is displayed.
+ */
+ private JLabel result = null;
+
+ /**
+ * Service dependency on the SpellChecker.
+ */
+ @Requires // It's a service dependency
+ private SpellChecker checker;
+
+ /**
+ * Constructor.
+ * Initialize the GUI.
+ */
+ public SpellCheckerGui() {
+ super();
+ initComponents();
+ this.setTitle("Spellchecker Gui");
+ }
+
+ /**
+ * Initialize the Swing Gui.
+ */
+ private void initComponents() {
+ java.awt.GridBagConstraints gridBagConstraints;
+
+ // The check button
+ JButton checkButton = new JButton();
+ result = new JLabel();
+ passage = new JTextField();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); // Stop Felix...
+ getContentPane().setLayout(new java.awt.GridBagLayout());
+
+ checkButton.setText("Check");
+ checkButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent e) {
+ check();
+ }
+ });
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
+ getContentPane().add(checkButton, gridBagConstraints);
+
+ result.setPreferredSize(new java.awt.Dimension(175, 20));
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 2;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+ gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
+ getContentPane().add(result, gridBagConstraints);
+
+ passage.setPreferredSize(new java.awt.Dimension(175, 20));
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 0;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+ gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
+ getContentPane().add(passage, gridBagConstraints);
+
+ pack();
+ }
+
+ /**
+ * Check Button action.
+ * Collects the user input and checks it.
+ */
+ private void check() {
+ // TODO
+ }
+
+ /**
+ * Start callback.
+ * This method will be called when the instance becomes valid.
+ * It set the Gui visibility to true.
+ */
+ @Validate
+ public void start() {
+ // TODO
+ }
+
+ /**
+ * Stop callback.
+ * This method will be called when the instance becomes invalid or stops.
+ * It deletes the Gui.
+ */
+ @Invalidate
+ public void stop() {
+ // TODO
+ }
+}
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker/build.xml b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker/build.xml
new file mode 100644
index 0000000..559991f
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker/build.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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.
+ -->
+
+<project name="spell.checker" default="package" basedir="">
+
+ <property name="src.dir" value="src"/>
+ <property name="lib.dir" value="libs"/>
+ <property name="build.dir" value="output/classes"/>
+ <property name="output.dir" value="output"/>
+
+ <taskdef resource="aQute/bnd/ant/taskdef.properties"
+ classpath="../tasks/bnd-${bnd.version}.jar"/>
+ <taskdef name="ipojo" classpath="../tasks/org.apache.felix.ipojo.ant-${ipojo.ant.version}.jar"
+ classname="org.apache.felix.ipojo.task.IPojoTask"/>
+
+ <target name="clean">
+ <delete dir="${build.dir}"/>
+ <delete dir="${output.dir}"/>
+ <delete dir="${lib.dir}"/>
+ </target>
+
+ <target name="buildclasspath">
+ <copy file="../spell.services/output/spell.services.jar" todir="${lib.dir}"/>
+ <copy file="../tasks/org.apache.felix.ipojo.ant-${ipojo.ant.version}.jar" todir="${lib.dir}"/>
+ </target>
+
+ <path id="classpath">
+ <fileset dir="${lib.dir}" includes="**/*.jar"/>
+ </path>
+
+ <target name="compile" depends="clean, buildclasspath">
+ <mkdir dir="${output.dir}"/>
+ <mkdir dir="${build.dir}"/>
+
+ <javac srcdir="${src.dir}"
+ destdir="${build.dir}"
+ debug="on"
+ classpathref="classpath"
+ />
+
+ </target>
+
+ <target name="package" depends="compile">
+ <bnd
+ classpath="${build.dir}"
+ failok="false"
+ exceptions="true"
+ files="${ant.project.name}.bnd"
+ output="${output.dir}"/>
+
+ <ipojo
+ input="${output.dir}/${ant.project.name}.jar"
+ />
+ </target>
+
+</project>
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker/spell.checker.bnd b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker/spell.checker.bnd
new file mode 100644
index 0000000..8405db2
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker/spell.checker.bnd
@@ -0,0 +1 @@
+Private-Package: spell.checker
\ No newline at end of file
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker/src/spell/checker/SpellCheck.java b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker/src/spell/checker/SpellCheck.java
new file mode 100644
index 0000000..4710a3e
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.checker/src/spell/checker/SpellCheck.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 spell.checker;
+
+import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.annotations.Instantiate;
+import org.apache.felix.ipojo.annotations.Provides;
+import org.apache.felix.ipojo.annotations.Requires;
+import spell.services.DictionaryService;
+import spell.services.SpellChecker;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+//TODO
+public class SpellCheck implements SpellChecker {
+
+ //TODO
+
+ /**
+ * Implements SpellChecker.check(). Checks the given passage for misspelled words.
+ *
+ * @param passage the passage to spell check.
+ * @return An array of misspelled words or null if no words are misspelled.
+ */
+ public String[] check(String passage) {
+ //TODO
+ return new String[] {};
+ }
+}
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.english/build.xml b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.english/build.xml
new file mode 100644
index 0000000..75ffd2f
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.english/build.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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.
+ -->
+
+<project name="spell.english" default="package" basedir="">
+
+ <property name="src.dir" value="src"/>
+ <property name="lib.dir" value="libs"/>
+ <property name="build.dir" value="output/classes"/>
+ <property name="output.dir" value="output"/>
+
+ <taskdef resource="aQute/bnd/ant/taskdef.properties"
+ classpath="../tasks/bnd-${bnd.version}.jar"/>
+ <taskdef name="ipojo" classpath="../tasks/org.apache.felix.ipojo.ant-${ipojo.ant.version}.jar"
+ classname="org.apache.felix.ipojo.task.IPojoTask"/>
+
+ <target name="clean">
+ <delete dir="${build.dir}"/>
+ <delete dir="${output.dir}"/>
+ <delete dir="${lib.dir}"/>
+ </target>
+
+ <target name="buildclasspath">
+ <copy file="../spell.services/output/spell.services.jar" todir="${lib.dir}"/>
+ <copy file="../tasks/org.apache.felix.ipojo.ant-${ipojo.ant.version}.jar" todir="${lib.dir}"/>
+ </target>
+
+ <path id="classpath">
+ <fileset dir="${lib.dir}" includes="**/*.jar"/>
+ </path>
+
+ <target name="compile" depends="clean, buildclasspath">
+ <mkdir dir="${output.dir}"/>
+ <mkdir dir="${build.dir}"/>
+
+ <javac srcdir="${src.dir}"
+ destdir="${build.dir}"
+ debug="on"
+ classpathref="classpath"
+ />
+
+ </target>
+
+ <target name="package" depends="compile">
+ <bnd
+ classpath="${build.dir}"
+ failok="false"
+ exceptions="true"
+ files="${ant.project.name}.bnd"
+ output="${output.dir}"/>
+
+ <ipojo
+ input="${output.dir}/${ant.project.name}.jar"
+ />
+ </target>
+
+</project>
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.english/spell.english.bnd b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.english/spell.english.bnd
new file mode 100644
index 0000000..e68a9f2
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.english/spell.english.bnd
@@ -0,0 +1 @@
+Private-Package: spell.english
\ No newline at end of file
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.english/src/spell/english/EnglishDictionary.java b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.english/src/spell/english/EnglishDictionary.java
new file mode 100644
index 0000000..4386dc5
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.english/src/spell/english/EnglishDictionary.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 spell.english;
+
+import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.annotations.Instantiate;
+import org.apache.felix.ipojo.annotations.Provides;
+import spell.services.DictionaryService;
+
+/**
+ * An implementation of the Dictionary service containing English words
+ * see DictionaryService for details of the service.
+ **/
+@Component // It's an iPOJO Component
+@Provides // We provide a service
+@Instantiate // We declare an instance of our component
+public class EnglishDictionary implements DictionaryService {
+
+ /**
+ * 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) {
+ //TODO
+ return false;
+ }
+}
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.services/build.xml b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.services/build.xml
new file mode 100644
index 0000000..0f87b8f
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.services/build.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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.
+ -->
+
+<project name="spell.services" default="package" basedir="">
+
+ <property name="src.dir" value="src"/>
+ <property name="build.dir" value="output/classes"/>
+ <property name="output.dir" value="output"/>
+
+ <taskdef resource="aQute/bnd/ant/taskdef.properties"
+ classpath="../tasks/bnd-${bnd.version}.jar"/>
+
+ <target name="clean">
+ <delete dir="${build.dir}"/>
+ <delete dir="${output.dir}"/>
+ </target>
+
+ <target name="compile" depends="clean">
+ <mkdir dir="${output.dir}"/>
+ <mkdir dir="${build.dir}"/>
+
+ <javac srcdir="${src.dir}"
+ destdir="${build.dir}"
+ debug="on"
+ />
+ </target>
+
+ <target name="package" depends="compile">
+ <bnd
+ classpath="${build.dir}"
+ failok="false"
+ exceptions="true"
+ files="${ant.project.name}.bnd"
+ output="${output.dir}"/>
+ </target>
+
+</project>
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.services/spell.services.bnd b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.services/spell.services.bnd
new file mode 100644
index 0000000..d976ef0
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.services/spell.services.bnd
@@ -0,0 +1 @@
+Export-Package: spell.services
\ No newline at end of file
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.services/src/spell/services/DictionaryService.java b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.services/src/spell/services/DictionaryService.java
new file mode 100644
index 0000000..8fdbfb5
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.services/src/spell/services/DictionaryService.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 spell.services;
+
+public interface DictionaryService {
+
+ /**
+ * Check for the existence of a word.
+ * @param word the word to be checked.
+ * @return true if the word is in the dictionary,
+ * false otherwise.
+ **/
+ public boolean checkWord(String word);
+}
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.services/src/spell/services/SpellChecker.java b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.services/src/spell/services/SpellChecker.java
new file mode 100644
index 0000000..e1874a7
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/skeleton/spell.services/src/spell/services/SpellChecker.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 spell.services;
+
+public interface SpellChecker
+{
+ //TODO
+}
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/solution/build.xml b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/build.xml
new file mode 100644
index 0000000..bf8d10d
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/build.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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.
+ -->
+
+<project name="spell.checker.example" default="package" basedir=".">
+
+ <target name="clean">
+ <ant dir="spell.services" target="clean"/>
+ <ant dir="spell.english" target="clean"/>
+ <ant dir="spell.checker" target="clean"/>
+ <ant dir="spell.checker.gui" target="clean"/>
+ </target>
+
+ <target name="package">
+ <ant dir="spell.services" target="package"/>
+ <ant dir="spell.english" target="package"/>
+ <ant dir="spell.checker" target="package"/>
+ <ant dir="spell.checker.gui" target="package"/>
+ </target>
+
+</project>
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker.gui/build.xml b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker.gui/build.xml
new file mode 100644
index 0000000..cecf4dd
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker.gui/build.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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.
+ -->
+
+<project name="spell.checker.gui" default="package" basedir="">
+
+ <property name="src.dir" value="src"/>
+ <property name="lib.dir" value="libs"/>
+ <property name="build.dir" value="output/classes"/>
+ <property name="output.dir" value="output"/>
+
+ <taskdef resource="aQute/bnd/ant/taskdef.properties"
+ classpath="../../tasks/bnd-${bnd.version}.jar"/>
+ <taskdef name="ipojo" classpath="../../tasks/org.apache.felix.ipojo.ant-${ipojo.ant.version}.jar"
+ classname="org.apache.felix.ipojo.task.IPojoTask"/>
+
+ <target name="clean">
+ <delete dir="${build.dir}"/>
+ <delete dir="${output.dir}"/>
+ <delete dir="${lib.dir}"/>
+ </target>
+
+ <target name="buildclasspath">
+ <copy file="../spell.services/output/spell.services.jar" todir="${lib.dir}"/>
+ <copy file="../../tasks/org.apache.felix.ipojo.ant-${ipojo.ant.version}.jar" todir="${lib.dir}"/>
+ </target>
+
+ <path id="classpath">
+ <fileset dir="${lib.dir}" includes="**/*.jar"/>
+ </path>
+
+ <target name="compile" depends="clean, buildclasspath">
+ <mkdir dir="${output.dir}"/>
+ <mkdir dir="${build.dir}"/>
+
+ <javac srcdir="${src.dir}"
+ destdir="${build.dir}"
+ debug="on"
+ classpathref="classpath"
+ />
+
+ </target>
+
+ <target name="package" depends="compile">
+ <bnd
+ classpath="${build.dir}"
+ failok="false"
+ exceptions="true"
+ files="${ant.project.name}.bnd"
+ output="${output.dir}"/>
+
+ <ipojo
+ input="${output.dir}/${ant.project.name}.jar"
+ />
+ </target>
+
+</project>
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker.gui/spell.checker.gui.bnd b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker.gui/spell.checker.gui.bnd
new file mode 100644
index 0000000..f367fa1
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker.gui/spell.checker.gui.bnd
@@ -0,0 +1 @@
+Private-Package: spell.gui
\ No newline at end of file
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker.gui/src/spell/gui/SpellCheckerGui.java b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker.gui/src/spell/gui/SpellCheckerGui.java
new file mode 100644
index 0000000..8aa867e
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker.gui/src/spell/gui/SpellCheckerGui.java
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 spell.gui;
+
+import org.apache.felix.ipojo.annotations.*;
+import spell.services.SpellChecker;
+
+import javax.swing.*;
+
+/**
+ * A very simple Gui interacting with the CheckSpeller service
+ */
+@Component
+@Instantiate
+public class SpellCheckerGui extends JFrame {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Swing component where the user write the passage to check.
+ */
+ private JTextField passage = null;
+
+ /**
+ * Area where the result is displayed.
+ */
+ private JLabel result = null;
+
+ /**
+ * Service dependency on the SpellChecker.
+ */
+ @Requires
+ private SpellChecker checker;
+
+ /**
+ * Constructor.
+ * Initialize the GUI.
+ */
+ public SpellCheckerGui() {
+ super();
+ initComponents();
+ this.setTitle("Spellchecker Gui");
+ }
+
+ /**
+ * Initialize the Swing Gui.
+ */
+ private void initComponents() {
+ java.awt.GridBagConstraints gridBagConstraints;
+
+ // The check button
+ JButton checkButton = new JButton();
+ result = new JLabel();
+ passage = new JTextField();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); // Stop Felix...
+ getContentPane().setLayout(new java.awt.GridBagLayout());
+
+ checkButton.setText("Check");
+ checkButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent e) {
+ check();
+ }
+ });
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
+ getContentPane().add(checkButton, gridBagConstraints);
+
+ result.setPreferredSize(new java.awt.Dimension(175, 20));
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 2;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+ gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
+ getContentPane().add(result, gridBagConstraints);
+
+ passage.setPreferredSize(new java.awt.Dimension(175, 20));
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 0;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+ gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
+ getContentPane().add(passage, gridBagConstraints);
+
+ pack();
+ }
+
+ /**
+ * Check Button action.
+ * Collects the user input and checks it.
+ */
+ private void check() {
+ String[] result = checker.check(passage.getText());
+ if (result != null) {
+ this.result.setText(result.length + " word(s) are misspelled");
+ } else {
+ this.result.setText("All words are correct");
+ }
+ }
+
+ /**
+ * Start callback.
+ * This method will be called when the instance becomes valid.
+ * It set the Gui visibility to true.
+ */
+ @Validate
+ public void start() {
+ this.setVisible(true);
+ }
+
+ /**
+ * Stop callback.
+ * This method will be called when the instance becomes invalid or stops.
+ * It deletes the Gui.
+ */
+ @Invalidate
+ public void stop() {
+ this.dispose();
+ }
+}
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker/build.xml b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker/build.xml
new file mode 100644
index 0000000..62edb7b
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker/build.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+
+<project name="spell.checker" default="package" basedir="">
+
+ <property name="src.dir" value="src"/>
+ <property name="lib.dir" value="libs"/>
+ <property name="build.dir" value="output/classes"/>
+ <property name="output.dir" value="output"/>
+
+ <taskdef resource="aQute/bnd/ant/taskdef.properties"
+ classpath="../../tasks/bnd-${bnd.version}.jar"/>
+ <taskdef name="ipojo" classpath="../../tasks/org.apache.felix.ipojo.ant-${ipojo.ant.version}.jar"
+ classname="org.apache.felix.ipojo.task.IPojoTask"/>
+
+ <target name="clean">
+ <delete dir="${build.dir}"/>
+ <delete dir="${output.dir}"/>
+ <delete dir="${lib.dir}"/>
+ </target>
+
+ <target name="buildclasspath">
+ <copy file="../spell.services/output/spell.services.jar" todir="${lib.dir}"/>
+ <copy file="../../tasks/org.apache.felix.ipojo.ant-${ipojo.ant.version}.jar" todir="${lib.dir}"/>
+ </target>
+
+ <path id="classpath">
+ <fileset dir="${lib.dir}" includes="**/*.jar"/>
+ </path>
+
+ <target name="compile" depends="clean, buildclasspath">
+ <mkdir dir="${output.dir}"/>
+ <mkdir dir="${build.dir}"/>
+
+ <javac srcdir="${src.dir}"
+ destdir="${build.dir}"
+ debug="on"
+ classpathref="classpath"
+ />
+
+ </target>
+
+ <target name="package" depends="compile">
+ <bnd
+ classpath="${build.dir}"
+ failok="false"
+ exceptions="true"
+ files="${ant.project.name}.bnd"
+ output="${output.dir}"/>
+
+ <ipojo
+ input="${output.dir}/${ant.project.name}.jar"
+ />
+ </target>
+
+</project>
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker/spell.checker.bnd b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker/spell.checker.bnd
new file mode 100644
index 0000000..8405db2
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker/spell.checker.bnd
@@ -0,0 +1 @@
+Private-Package: spell.checker
\ No newline at end of file
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker/src/spell/checker/SpellCheck.java b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker/src/spell/checker/SpellCheck.java
new file mode 100644
index 0000000..8d8a35a
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.checker/src/spell/checker/SpellCheck.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 spell.checker;
+
+import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.annotations.Instantiate;
+import org.apache.felix.ipojo.annotations.Provides;
+import org.apache.felix.ipojo.annotations.Requires;
+import spell.services.DictionaryService;
+import spell.services.SpellChecker;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+@Component
+@Provides
+@Instantiate
+public class SpellCheck implements SpellChecker {
+
+ @Requires // This is a service dependency.
+ private DictionaryService dictionary;
+
+ /**
+ * Implements SpellChecker.check(). Checks the given passage for misspelled words.
+ *
+ * @param passage the passage to spell check.
+ * @return An array of misspelled words or null if no words are misspelled.
+ */
+ public String[] check(String passage) {
+ // No misspelled words for an empty string.
+ if ((passage == null) || (passage.length() == 0)) {
+ return null;
+ }
+
+ List<String> errorList = new ArrayList<String>();
+
+ // Tokenize the passage using spaces and punctuation.
+ StringTokenizer st = new StringTokenizer(passage, " ,.!?;:");
+
+ // Loop through each word in the passage.
+ while (st.hasMoreTokens()) {
+ String word = st.nextToken();
+
+ // Check the current word.
+ if (!dictionary.checkWord(word)) {
+ // If the word is not correct, then add it
+ // to the incorrect word list.
+ errorList.add(word);
+ }
+ }
+
+ // Return null if no words are incorrect.
+ if (errorList.size() == 0) {
+ return null;
+ }
+
+ // Return the array of incorrect words.
+ System.out.println("Wrong words:" + errorList);
+ return errorList.toArray(new String[errorList.size()]);
+ }
+}
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.english/build.xml b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.english/build.xml
new file mode 100644
index 0000000..946ac59
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.english/build.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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.
+ -->
+
+<project name="spell.english" default="package" basedir="">
+
+ <property name="src.dir" value="src"/>
+ <property name="lib.dir" value="libs"/>
+ <property name="build.dir" value="output/classes"/>
+ <property name="output.dir" value="output"/>
+
+ <taskdef resource="aQute/bnd/ant/taskdef.properties"
+ classpath="../../tasks/bnd-${bnd.version}.jar"/>
+ <taskdef name="ipojo" classpath="../../tasks/org.apache.felix.ipojo.ant-${ipojo.ant.version}.jar"
+ classname="org.apache.felix.ipojo.task.IPojoTask"/>
+
+ <target name="clean">
+ <delete dir="${build.dir}"/>
+ <delete dir="${output.dir}"/>
+ <delete dir="${lib.dir}"/>
+ </target>
+
+ <target name="buildclasspath">
+ <copy file="../spell.services/output/spell.services.jar" todir="${lib.dir}"/>
+ <copy file="../../tasks/org.apache.felix.ipojo.ant-${ipojo.ant.version}.jar" todir="${lib.dir}"/>
+ </target>
+
+ <path id="classpath">
+ <fileset dir="${lib.dir}" includes="**/*.jar"/>
+ </path>
+
+ <target name="compile" depends="clean, buildclasspath">
+ <mkdir dir="${output.dir}"/>
+ <mkdir dir="${build.dir}"/>
+
+ <javac srcdir="${src.dir}"
+ destdir="${build.dir}"
+ debug="on"
+ classpathref="classpath"
+ />
+
+ </target>
+
+ <target name="package" depends="compile">
+ <bnd
+ classpath="${build.dir}"
+ failok="false"
+ exceptions="true"
+ files="${ant.project.name}.bnd"
+ output="${output.dir}"/>
+
+ <ipojo
+ input="${output.dir}/${ant.project.name}.jar"
+ />
+ </target>
+
+</project>
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.english/spell.english.bnd b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.english/spell.english.bnd
new file mode 100644
index 0000000..e68a9f2
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.english/spell.english.bnd
@@ -0,0 +1 @@
+Private-Package: spell.english
\ No newline at end of file
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.english/src/spell/english/EnglishDictionary.java b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.english/src/spell/english/EnglishDictionary.java
new file mode 100644
index 0000000..c261e7b
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.english/src/spell/english/EnglishDictionary.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 spell.english;
+
+import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.annotations.Instantiate;
+import org.apache.felix.ipojo.annotations.Provides;
+import spell.services.DictionaryService;
+
+/**
+ * An implementation of the Dictionary service containing English words
+ * see DictionaryService for details of the service.
+ **/
+@Component // It's an iPOJO Component
+@Provides // We provide a service
+@Instantiate // We declare an instance of our component
+public class EnglishDictionary implements DictionaryService {
+
+ // The set of words contained in the dictionary.
+ String[] dictionary = { "welcome", "to", "the", "ipojo", "tutorial" };
+
+ /**
+ * 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 (String dict : dictionary) {
+ if (dict.equals(word)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.services/build.xml b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.services/build.xml
new file mode 100644
index 0000000..0b4e2fa
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.services/build.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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.
+ -->
+
+<project name="spell.services" default="package" basedir="">
+
+ <property name="src.dir" value="src"/>
+ <property name="build.dir" value="output/classes"/>
+ <property name="output.dir" value="output"/>
+
+ <taskdef resource="aQute/bnd/ant/taskdef.properties"
+ classpath="../../tasks/bnd-${bnd.version}.jar"/>
+
+ <target name="clean">
+ <delete dir="${build.dir}"/>
+ <delete dir="${output.dir}"/>
+ </target>
+
+ <target name="compile" depends="clean">
+ <mkdir dir="${output.dir}"/>
+ <mkdir dir="${build.dir}"/>
+
+ <javac srcdir="${src.dir}"
+ destdir="${build.dir}"
+ debug="on"
+ />
+ </target>
+
+ <target name="package" depends="compile">
+ <bnd
+ classpath="${build.dir}"
+ failok="false"
+ exceptions="true"
+ files="${ant.project.name}.bnd"
+ output="${output.dir}"/>
+ </target>
+
+</project>
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.services/spell.services.bnd b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.services/spell.services.bnd
new file mode 100644
index 0000000..d976ef0
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.services/spell.services.bnd
@@ -0,0 +1 @@
+Export-Package: spell.services
\ No newline at end of file
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.services/src/spell/services/DictionaryService.java b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.services/src/spell/services/DictionaryService.java
new file mode 100644
index 0000000..5f53d62
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.services/src/spell/services/DictionaryService.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 spell.services;
+
+public interface DictionaryService {
+
+ /**
+ * Check for the existence of a word.
+ * @param word the word to be checked.
+ * @return true if the word is in the dictionary,
+ * false otherwise.
+ **/
+ public boolean checkWord(String word);
+
+}
diff --git a/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.services/src/spell/services/SpellChecker.java b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.services/src/spell/services/SpellChecker.java
new file mode 100644
index 0000000..e6c0cf2
--- /dev/null
+++ b/ipojo/distributions/ten-minutes-tutorial/src/main/solution/spell.services/src/spell/services/SpellChecker.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 spell.services;
+
+/**
+ * A simple service interface that defines a spell checker service.
+ * A spell checker service checks the spelling of all words in a
+ * given passage. A passage is any number of words separated by
+ * a space character and the following punctuation marks: comma,
+ * period, exclamation mark, question mark, semi-colon, and colon.
+**/
+public interface SpellChecker
+{
+ /**
+ * Checks a given passage for spelling errors. A passage is any
+ * number of words separated by a space and any of the following
+ * punctuation marks: comma (,), period (.), exclamation mark (!),
+ * question mark (?), semi-colon (;), and colon(:).
+ * @param passage the passage to spell check.
+ * @return An array of misspelled words or null if no
+ * words are misspelled.
+ **/
+ public String[] check(String passage);
+}