felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r1443044 - in /felix/site/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted: ipojo-hello-word-maven-based-tutorial.mdtext ipojo-in-10-minutes.mdtext
Date Wed, 06 Feb 2013 16:25:48 GMT
Author: clement
Date: Wed Feb  6 16:25:48 2013
New Revision: 1443044

URL: http://svn.apache.org/viewvc?rev=1443044&view=rev
Log:
translate tutorials to the CMS system

Modified:
    felix/site/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-hello-word-maven-based-tutorial.mdtext
    felix/site/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-in-10-minutes.mdtext

Modified: felix/site/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-hello-word-maven-based-tutorial.mdtext
URL: http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-hello-word-maven-based-tutorial.mdtext?rev=1443044&r1=1443043&r2=1443044&view=diff
==============================================================================
--- felix/site/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-hello-word-maven-based-tutorial.mdtext (original)
+++ felix/site/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-hello-word-maven-based-tutorial.mdtext Wed Feb  6 16:25:48 2013
@@ -29,72 +29,75 @@ Download the tutorial archive [here](htt
 
 ### Preparing Maven & Installing the tutorial
 
-The first step is to download and install Maven; the example was created using Maven 2.1+. Once maven is installed on your machine, you can compile the tutorial by unzipping the archive, and by launching the '*mvn clean install*' command at the root of tutorial.
+The first step is to download and install Maven; the example was created using Maven 2.1+. Once maven is installed on your machine, you can compile the tutorial by unzipping the archive, and by launching the `mvn clean install` command at the root of tutorial.
 
 *Be aware that Maven outputs a lot of information while it executes and often downloads a lot of required JAR files into its local repository.*
 
 ### Hello Service
 
-The first project is the *hello.service* project. This project contains only the *hello* service interface. Look at the `src/main/java/ipojo/example/hello/Hello.java` file.
-{code:java}
-/**
- * Hello Interface.
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public interface Hello {
+The first project is the *hello.service* project. This project contains only the *hello* service interface. Look at the `src/main/java/ipojo/example/hello/Hello.java` file:
 
+    :::java
     /**
-     * Returns a message like: "Hello $user_name".
-     * @param name the name
-     * @return the hello message
+     * Hello Interface.
+     * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
      */
-    String sayHello(String name);
-}
+    public interface Hello {
+
+        /**
+         * Returns a message like: "Hello $user_name".
+         * @param name the name
+         * @return the hello message
+         */
+        String sayHello(String name);
+    }
 
     
-    In the project directory, the pom.xml file contains the instructions to build the bundle. The bundle uses the _maven-bundle-plugin_ (see here for more information on this plug-in).
-    {div:class=pom}
-    <project>
-    &nbsp;&nbsp;&nbsp; <modelVersion>4.0.0</modelVersion>
-    &nbsp;&nbsp;&nbsp; <packaging>bundle</packaging>
-    &nbsp;&nbsp;&nbsp; {color:#ff0000}<groupId>ipojo.example</groupId>{color}
-    {color:#ff0000}&nbsp;&nbsp;&nbsp; <artifactId>hello.service</artifactId>{color}
-    {color:#ff0000}&nbsp;&nbsp;&nbsp; <version>1.0.0</version>{color}
-    {color:#ff0000}&nbsp;&nbsp;&nbsp; <name>Hello Service</name>{color}
-    
-    <build>
-    &nbsp;&nbsp;&nbsp; <plugins>
-    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <plugin>
-    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <groupId>org.apache.felix</groupId>
-    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <artifactId>maven-bundle-plugin</artifactId>
-    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <version>2.0.1</version>
-    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <extensions>true</extensions>
-    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <configuration>
-    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <instructions>
-    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <Bundle-SymbolicName>
-    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $\{pom.artifactId}
-    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </Bundle-SymbolicName>
-    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {color:#ff0000}<Export-Package>{color}
-    {color:#ff0000}&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ipojo.example.hello{color}
-    {color:#ff0000}&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </Export-Package>{color}
-    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </instructions>
-    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </configuration>
-    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </plugin>
-    &nbsp;&nbsp;&nbsp; </plugins>
-    </build>
-    
-    </project>
-    {div}
-    Then, the project is ready to be built issuing the following Maven command inside the project directory:
+In the project directory, the pom.xml file contains the instructions to build the bundle. The bundle uses the _maven-bundle-plugin_ (see here for more information on this plug-in).
+
+<div class="pom"><p>&lt;project&gt;<br>
+&nbsp;&nbsp;&nbsp; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;<br>
+&nbsp;&nbsp;&nbsp; &lt;packaging&gt;bundle&lt;/packaging&gt;<br>
+&nbsp;&nbsp;&nbsp; <font color="#ff0000">&lt;groupId&gt;ipojo.example&lt;/groupId&gt;</font><br>
+<font color="#ff0000">&nbsp;&nbsp;&nbsp; &lt;artifactId&gt;hello.service&lt;/artifactId&gt;</font><br>
+<font color="#ff0000">&nbsp;&nbsp;&nbsp; &lt;version&gt;1.0.0&lt;/version&gt;</font><br>
+<font color="#ff0000">&nbsp;&nbsp;&nbsp; &lt;name&gt;Hello Service&lt;/name&gt;</font></p>
+
+<p>&lt;build&gt;<br>
+&nbsp;&nbsp;&nbsp; &lt;plugins&gt;<br>
+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;plugin&gt;<br>
+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;<br>
+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;<br>
+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;version&gt;2.0.1&lt;/version&gt;<br>
+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;extensions&gt;true&lt;/extensions&gt;<br>
+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;configuration&gt;<br>
+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;instructions&gt;<br>
+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Bundle-SymbolicName&gt;<br>
+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ${pom.artifactId}<br>
+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Bundle-SymbolicName&gt;<br>
+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <font color="#ff0000">&lt;Export-Package&gt;</font><br>
+<font color="#ff0000">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ipojo.example.hello</font><br>
+<font color="#ff0000">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Export-Package&gt;</font><br>
+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/instructions&gt;<br>
+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/configuration&gt;<br>
+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/plugin&gt;<br>
+&nbsp;&nbsp;&nbsp; &lt;/plugins&gt;<br>
+&lt;/build&gt;</p>
 
-mvn clean install
+<p>&lt;/project&gt;</p></div>
+
+Then, the project is ready to be built issuing the following Maven command inside the project directory:
 
-    Maven should report that the build was a success; if an error was reported then verify the previous steps. Upon success the _Hello_ service component JAR file is installed into the local Maven repository. A copy of the bundle JAR file will also be present in the "target" directory inside the project directory.
+    :::sh
+    mvn clean install
+
+Maven should report that the build was a success; if an error was reported then verify the previous steps. Upon success the _Hello_ service component JAR file is installed into the local Maven repository. A copy of the bundle JAR file will also be present in the "target" directory inside the project directory.
     
-    h3. Hello Service Provider
+### Hello Service Provider
     
-    The component implementation of the service is a simple Java class implementing the _Hello_ service interface. The implementation is in the _hello.impl_ project. The file {{src/main/java/ipojo/example/hello/impl/HelloImpl.java}} contains the following service implementation:
-    {code:java}
+The component implementation of the service is a simple Java class implementing the _Hello_ service interface. The implementation is in the _hello.impl_ project. The file `src/main/java/ipojo/example/hello/impl/HelloImpl.java` contains the following service implementation:
+
+    :::java
     /**
      * Component implementing the Hello service.
      * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
@@ -112,6 +115,7 @@ mvn clean install
 
 To manage the component, iPOJO needs some metadata to understand that the component provides the *Hello* service. iPOJO metadata file is at the root of the *hello.impl* project ("metadata.xml"). It contains the following metadata (Note: iPOJO also supports a JAR manifest-based syntax):
 
+    :::xml
     <?xml version="1.0" encoding="UTF-8"?>
     <ipojo 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -128,60 +132,61 @@ To manage the component, iPOJO needs som
 
 In the above XML-based metadata, the *component* element has a mandatory '*classname'*attribute. This attribute tells iPOJO the implementation class of the component. Since the component in this example provides a service, the component element also specifies a child '*provides*' element. The '*provides*' element informs iPOJO that it must manage the publishing of a service. When the '*provides*' element does not contain an interface attribute, as is the case in this example, iPOJO will expose all implemented interfaces of the component as a service; it is also possible to specify the precise service interface. The '*instance*' element asks iPOJO to create an instance of your component when the bundle is started.
 
-Finally, the "pom.xml" file contains instructions to build the bundle:
-{div:class=pom}
-<project>
-&nbsp;&nbsp;<modelVersion>4.0.0</modelVersion>
-&nbsp; <packaging>bundle</packaging>
-&nbsp;&nbsp;{color:red}<groupId>ipojo.example</groupId>{color}
-{color:red}&nbsp;&nbsp;<artifactId>hello.impl</artifactId>{color}
-{color:red}&nbsp;&nbsp;<version>1.0.0</version>{color}
-
-&nbsp;&nbsp;{color:red}<name>Hello Service Provider</name>{color}
-
-{color:red}&nbsp; <dependencies>{color}
-{color:red}&nbsp;&nbsp; &nbsp;<dependency> <!--Compilation (i.e. class) dependency on the service interface -->{color}
-{color:red}&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<groupId>ipojo.example</groupId>{color}
-{color:red}&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<artifactId>hello.service</artifactId>{color}
-{color:red}&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<version>{color}{color:#ff0000}1.0.0{color}{color:red}</version>{color}
-{color:red}&nbsp;&nbsp; &nbsp;</dependency>{color}
-{color:red}&nbsp; </dependencies>{color}
-
-
-&nbsp;&nbsp;<build>
-&nbsp;&nbsp; <plugins>
-&nbsp;&nbsp;&nbsp;&nbsp; <plugin>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <groupId>org.apache.felix</groupId>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <artifactId>maven-bundle-plugin</artifactId>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <version>2.0.1</version>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <extensions>true</extensions>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <configuration>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <instructions>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <Bundle-SymbolicName>$\{pom.artifactId}</Bundle-SymbolicName>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {color:red}<Private-Package>ipojo.example.hello.impl</Private-Package>{color}
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </instructions>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </configuration>
-&nbsp;&nbsp;&nbsp;&nbsp; </plugin>
-&nbsp;&nbsp;&nbsp;&nbsp; <plugin>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <groupId>org.apache.felix</groupId>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <artifactId>maven-ipojo-plugin</artifactId>
-&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; <version>1.6.0</version>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<executions>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <execution>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <goals>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <goal>ipojo-bundle</goal>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </goals>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;</execution>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </executions>
-&nbsp;&nbsp;&nbsp;&nbsp; </plugin>
-&nbsp;&nbsp; </plugins>
-&nbsp;</build>
-</project>
-{div}
-The text highlighted in {color:red}{*}red{*}{color} above indicates the important information related to the project. The first part of the POM file indicates that the packaging format is an iPOJO bundle and also includes some information about the project (name, groupId, and artifactId). This information is not used by iPOJO, but is used by Maven. The rest of the POM file contains the bundle configuration. In the *instructions* element, you need to enter the bundle name, the bundle description, and the exported packages. The service provider bundle exports the package of *Hello* interface.
+Finally, the `pom.xml` file contains instructions to build the bundle:
+
+<div class="pom"><p>&lt;project&gt;<br>
+&nbsp;&nbsp;&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;<br>
+&nbsp; &lt;packaging&gt;bundle&lt;/packaging&gt;<br>
+&nbsp;&nbsp;<font color="red">&lt;groupId&gt;ipojo.example&lt;/groupId&gt;</font><br>
+<font color="red">&nbsp;&nbsp;&lt;artifactId&gt;hello.impl&lt;/artifactId&gt;</font><br>
+<font color="red">&nbsp;&nbsp;&lt;version&gt;1.0.0&lt;/version&gt;</font></p>
+
+<p>&nbsp;&nbsp;<font color="red">&lt;name&gt;Hello Service Provider&lt;/name&gt;</font></p>
+
+<p><font color="red">&nbsp; &lt;dependencies&gt;</font><br>
+<font color="red">&nbsp;&nbsp; &nbsp;&lt;dependency&gt; &lt;!--Compilation (i.e. class) dependency on the service interface --&gt;</font><br>
+<font color="red">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&lt;groupId&gt;ipojo.example&lt;/groupId&gt;</font><br>
+<font color="red">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&lt;artifactId&gt;hello.service&lt;/artifactId&gt;</font><br>
+<font color="red">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&lt;version&gt;</font><font color="#ff0000">1.0.0</font><font color="red">&lt;/version&gt;</font><br>
+<font color="red">&nbsp;&nbsp; &nbsp;&lt;/dependency&gt;</font><br>
+<font color="red">&nbsp; &lt;/dependencies&gt;</font></p>
+
+
+<p>&nbsp;&nbsp;&lt;build&gt;<br>
+&nbsp;&nbsp; &lt;plugins&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp; &lt;plugin&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;version&gt;2.0.1&lt;/version&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;extensions&gt;true&lt;/extensions&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;configuration&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;instructions&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Bundle-SymbolicName&gt;${pom.artifactId}&lt;/Bundle-SymbolicName&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="red">&lt;Private-Package&gt;ipojo.example.hello.impl&lt;/Private-Package&gt;</font><br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/instructions&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/configuration&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp; &lt;/plugin&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp; &lt;plugin&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;artifactId&gt;maven-ipojo-plugin&lt;/artifactId&gt;<br>
+&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &lt;version&gt;1.6.0&lt;/version&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;executions&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;execution&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;goals&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;goal&gt;ipojo-bundle&lt;/goal&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/goals&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;/execution&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/executions&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp; &lt;/plugin&gt;<br>
+&nbsp;&nbsp; &lt;/plugins&gt;<br>
+&nbsp;&lt;/build&gt;<br>
+&lt;/project&gt;</p></div>
+
+The text highlighted in <span style="color:red">red</span> above indicates the important information related to the project. The first part of the POM file indicates that the packaging format is an iPOJO bundle and also includes some information about the project (name, groupId, and artifactId). This information is not used by iPOJO, but is used by Maven. The rest of the POM file contains the bundle configuration. In the *instructions* element, you need to enter the bundle name, the bundle description, and the exported packages. The service provider bundle exports the package of *Hello* interface.
 
 Then, the project is ready to be built issuing the following Maven command inside the project directory:
 
+    :::sh
     mvn clean install
 
 Maven should report that the build was a success; if an error was reported then verify the previous steps. Upon success the *Hello* service component JAR file is installed into the local Maven repository. A copy of the bundle JAR file will also be present in the "target" directory inside the project directory.
@@ -189,83 +194,85 @@ Maven should report that the build was a
 ### Hello Service Client
 
 The Hello service consumer is inside the *hello.client* project. The file `src/main/java/ipojo/example/hello/client/HelloClient.java` contains the following *Hello* service client:
-{code:java}
-package ipojo.example.hello.client;
 
-import ipojo.example.hello.Hello;
+    :::java
+    package ipojo.example.hello.client;
 
-/**
- * Hello Service simple client.
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class HelloClient implements Runnable {
+    import ipojo.example.hello.Hello;
 
     /**
-     *  Delay between two invocations.
+     * Hello Service simple client.
+     * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
      */
-    private static final int DELAY = 10000;
+    public class HelloClient implements Runnable {
 
-    /**
-     * Hello services.
-     * Injected by the container.
-     * */
-    private Hello[]({{ refs..path }}) m_hello;
+        /**
+         *  Delay between two invocations.
+         */
+        private static final int DELAY = 10000;
 
-    /**
-     * End flag.
-     *  */
-    private boolean m_end;
+        /**
+         * Hello services.
+         * Injected by the container.
+         * */
+        private Hello[]({{ refs..path }}) m_hello;
 
-    /**
-     * Run method.
-     * @see java.lang.Runnable#run()
-     */
-    public void run() {
-        while (!m_end) {
-            try {
-                invokeHelloServices();
-                Thread.sleep(DELAY);
-            } catch (InterruptedException ie) {
-                /* will recheck end */
+        /**
+         * End flag.
+         *  */
+        private boolean m_end;
+
+        /**
+         * Run method.
+         * @see java.lang.Runnable#run()
+         */
+        public void run() {
+            while (!m_end) {
+                try {
+                    invokeHelloServices();
+                    Thread.sleep(DELAY);
+                } catch (InterruptedException ie) {
+                    /* will recheck end */
+                }
             }
         }
-    }
 
-    /**
-     * Invoke hello services.
-     */
-    public void invokeHelloServices() {
-        for (int i = 0; i < m_hello.length; i++) {
-            // Update with your name.
-            System.out.println(m_hello[i]({{ refs.i.path }}).sayHello("world"));
+        /**
+         * Invoke hello services.
+         */
+        public void invokeHelloServices() {
+            for (int i = 0; i < m_hello.length; i++) {
+                // Update with your name.
+                System.out.println(m_hello[i]({{ refs.i.path }}).sayHello("world"));
+            }
         }
-    }
 
-    /**
-     * Starting.
-     */
-    public void starting() {
-        Thread thread = new Thread(this);
-        m_end = false;
-        thread.start();
-    }
+        /**
+         * Starting.
+         */
+        public void starting() {
+            Thread thread = new Thread(this);
+            m_end = false;
+            thread.start();
+        }
 
-    /**
-     * Stopping.
-     */
-    public void stopping() {
-        m_end = true;
+        /**
+         * Stopping.
+         */
+        public void stopping() {
+            m_end = true;
+        }
     }
-}
 
-    The _Hello_ service client creates a thread that periodically invokes the available _Hello_ services. The thread starts when at least one _Hello_ service provider is present using iPOJO's call back mechanism. In the client code, to use the _hello_ the component implementation simply declares a field of the type of the service and then simply uses it directly in its code. In this example, it is the m_hello field is declared as the service field; notice that the field is an array of _Hello_. In iPOJO an array of services represents an aggregate or multiple cardinality dependency, whereas if a scalar value represents a singular or unary cardinality dependency. In other words, for a singular dependency simply remove the array brackets from the example (e.g., HelloService m_hello\[\]. After declaring a field for the service, the rest of the component code can simply assume that the service field will be initialized, e.g., m_hello\[i\].sayHello("world").
+The _Hello_ service client creates a thread that periodically invokes the available _Hello_ services. The thread starts when at least one _Hello_ service provider is present using iPOJO's call back mechanism. In the client code, to use the _hello_ the component implementation simply declares a field of the type of the service and then simply uses it directly in its code. In this example, it is the m_hello field is declared as the service field; notice that the field is an array of _Hello_. In iPOJO an array of services represents an aggregate or multiple cardinality dependency, whereas if a scalar value represents a singular or unary cardinality dependency. In other words, for a singular dependency simply remove the array brackets from the example (e.g., HelloService m_hello[]. After declaring a field for the service, the rest of the component code can simply assume that the service field will be initialized, e.g., m_hello[i].sayHello("world").
     
-    Notice that iPOJO manages service synchronization too. So, the service invocations do not require synchronization blocks. This synchronization is maintained on a per thread basis, where each method that accesses a service is instrumented to attach the given service instance to the thread so that the thread will continue to see the same service instances even across nested method invocations. The thread will not see different service instances until it completely exits from the first method it entered which used a services. Thus, you would not want to access services in the {{run()}} method above, because the thread would always see the same service instance.
+Notice that iPOJO manages service synchronization too. So, the service invocations do not require synchronization blocks. This synchronization is maintained on a per thread basis, where each method that accesses a service is instrumented to attach the given service instance to the thread so that the thread will continue to see the same service instances even across nested method invocations. The thread will not see different service instances until it completely exits from the first method it entered which used a services. Thus, you would not want to access services in the {{run()}} method above, because the thread would always see the same service instance.
     
-    The component provides two callback methods for its activation and deactivation, starting() and stopping(), respectively. Callbacks are used when the component needs to be informed about a component state change. In iPOJO, the component state is either *INVALID* (i.e., not all of the component's constraints are satisfied) or *VALID* (i.e., all of the component's constraints are satisfied). In this example, the starting callback method creates and starts a thread; the stopping callback method stops the thread. The component metadata will instruct iPOJO to invoke these methods when the component's state changes to *VALID* or *INVALID* respectively.
+The component provides two callback methods for its activation and deactivation, starting() and stopping(), respectively. Callbacks are used when the component needs to be informed about a component state change. In iPOJO, the component state is either *INVALID* (i.e., not all of the component's constraints are satisfied) or *VALID* (i.e., all of the component's constraints are satisfied). In this example, the starting callback method creates and starts a thread; the stopping callback method stops the thread. The component metadata will instruct iPOJO to invoke these methods when the component's state changes to *VALID* or *INVALID* respectively.
     
-    The iPOJO metadata file describing the component is "metadata.xml" and contains the following metadata:
-    {code:xml}
+The iPOJO metadata file describing the component is "metadata.xml" and contains the following metadata:
+
+    :::xml
     <?xml version="1.0" encoding="UTF-8"?>
     <ipojo 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -288,67 +295,72 @@ public class HelloClient implements Runn
 
 The component element again has the '*classname'* attribute that refers to the component implementation class. The '*requires*' element describes the *Hello* service dependency by simply specifying its associated component field. The '*callback'*elements describe which method to invoke when the component's state changes. Then the '*instance*' element asks iPOJO to create an instance of the component (notice that no instance name is provided here, iPOJO will give an instance name to the instance automatically).
 
-Finally, the "pom.xml" file contains instructions to build the bundle:
-{div:class=pom}
-<project>
-&nbsp;&nbsp;<modelVersion>4.0.0</modelVersion>
-&nbsp;&nbsp;<packaging>bundle</packaging>
-&nbsp;&nbsp;{color:red}<groupId>ipojo.example</groupId>{color}
-{color:red}&nbsp;&nbsp;<artifactId>hello.client</artifactId>{color}
-{color:red}&nbsp;&nbsp;<version>1.0.0</version>{color}
-{color:red}&nbsp;&nbsp;<name>Hello Client</name>{color}
-
-{color:red}&nbsp;&nbsp;<dependencies>{color}
-{color:red}&nbsp;&nbsp; &nbsp;<dependency> <\!-\-{color} {color:red}Compilation (i.e. class) dependency on the service interface \-\-{color}{color:red}>{color}
-{color:red}&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<groupId>ipojo.example</groupId>{color}
-{color:red}&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<artifactId>hello.service</artifactId>{color}
-{color:red}&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<version>{color}{color:#ff0000}1.0.0{color}{color:red}</version>{color}
-{color:red}&nbsp;&nbsp; &nbsp;</dependency>{color}
-{color:red}&nbsp; </dependencies>{color}
-
-&nbsp; <build>
-&nbsp;&nbsp;&nbsp;&nbsp; <plugins>
-&nbsp;&nbsp;&nbsp;&nbsp; <plugin>
-&nbsp;&nbsp;&nbsp;&nbsp; <groupId>org.apache.felix</groupId>
-&nbsp;&nbsp;&nbsp;&nbsp; <artifactId>maven-bundle-plugin</artifactId>
-&nbsp;&nbsp;&nbsp;&nbsp; <version>2.0.1</version>
-&nbsp;&nbsp;&nbsp;&nbsp; <extensions>true</extensions>
-&nbsp;&nbsp;&nbsp;&nbsp; <configuration>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <instructions>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <Bundle-SymbolicName>$\{pom.artifactId}</Bundle-SymbolicName>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {color:red}<Private-Package>ipojo.example.hello.client</Private-Package>{color}
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </instructions>
-&nbsp;&nbsp;&nbsp;&nbsp; </configuration>
-&nbsp;&nbsp; </plugin>
-&nbsp;&nbsp; <plugin>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <groupId>org.apache.felix</groupId>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <artifactId>maven-ipojo-plugin</artifactId>
-&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; <version>1.6.0</version>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <executions>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <execution>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <goals>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <goal>ipojo-bundle</goal>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </goals>
-&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </execution>
-&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; </executions>
-&nbsp;&nbsp; </plugin>
-&nbsp;</plugins>
-&nbsp; </build>
-</project>
-{div}
-The text highlighted in {color:red}{*}red{*}{color} above indicates the information related to the project. The *dependencies* element tells Maven that the client bundle has a compilation dependency on the service provider bundle. In this case, the client bundle needs the *Hello* service interface to compile. After building the service provider bundle JAR file, Maven installs it into a local repository on your machine. To resolve compilation dependencies, Maven looks in the local repository to find required JAR files.
+Finally, the `pom.xml` file contains instructions to build the bundle:
+
+<div class="pom"><p>&lt;project&gt;<br>
+&nbsp;&nbsp;&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;<br>
+&nbsp;&nbsp;&lt;packaging&gt;bundle&lt;/packaging&gt;<br>
+&nbsp;&nbsp;<font color="red">&lt;groupId&gt;ipojo.example&lt;/groupId&gt;</font><br>
+<font color="red">&nbsp;&nbsp;&lt;artifactId&gt;hello.client&lt;/artifactId&gt;</font><br>
+<font color="red">&nbsp;&nbsp;&lt;version&gt;1.0.0&lt;/version&gt;</font><br>
+<font color="red">&nbsp;&nbsp;&lt;name&gt;Hello Client&lt;/name&gt;</font></p>
+
+<p><font color="red">&nbsp;&nbsp;&lt;dependencies&gt;</font><br>
+<font color="red">&nbsp;&nbsp; &nbsp;&lt;dependency&gt; &lt;!--</font> <font color="red">Compilation (i.e. class) dependency on the service interface --</font><font color="red">&gt;</font><br>
+<font color="red">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&lt;groupId&gt;ipojo.example&lt;/groupId&gt;</font><br>
+<font color="red">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&lt;artifactId&gt;hello.service&lt;/artifactId&gt;</font><br>
+<font color="red">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&lt;version&gt;</font><font color="#ff0000">1.0.0</font><font color="red">&lt;/version&gt;</font><br>
+<font color="red">&nbsp;&nbsp; &nbsp;&lt;/dependency&gt;</font><br>
+<font color="red">&nbsp; &lt;/dependencies&gt;</font></p>
+
+<p>&nbsp; &lt;build&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp; &lt;plugins&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp; &lt;plugin&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp; &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp; &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp; &lt;version&gt;2.0.1&lt;/version&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp; &lt;extensions&gt;true&lt;/extensions&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp; &lt;configuration&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;instructions&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Bundle-SymbolicName&gt;${pom.artifactId}&lt;/Bundle-SymbolicName&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="red">&lt;Private-Package&gt;ipojo.example.hello.client&lt;/Private-Package&gt;</font><br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/instructions&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp; &lt;/configuration&gt;<br>
+&nbsp;&nbsp; &lt;/plugin&gt;<br>
+&nbsp;&nbsp; &lt;plugin&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;artifactId&gt;maven-ipojo-plugin&lt;/artifactId&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &lt;version&gt;1.6.0&lt;/version&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;executions&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;execution&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;goals&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;goal&gt;ipojo-bundle&lt;/goal&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/goals&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/execution&gt;<br>
+&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &lt;/executions&gt;<br>
+&nbsp;&nbsp; &lt;/plugin&gt;<br>
+&nbsp;&lt;/plugins&gt;<br>
+&nbsp; &lt;/build&gt;<br>
+&lt;/project&gt;</p></div>
+
+The text highlighted in <span style="color:red">red</code> above indicates the information related to the project. The *dependencies* element tells Maven that the client bundle has a compilation dependency on the service provider bundle. In this case, the client bundle needs the *Hello* service interface to compile. After building the service provider bundle JAR file, Maven installs it into a local repository on your machine. To resolve compilation dependencies, Maven looks in the local repository to find required JAR files.
 After the skeleton "pom.xml" file is modified, the project is ready to be built issuing the following Maven command inside the project directory:
-mvn clean install
+    
+    :::sh
+    mvn clean install
+
 Maven should report that the build was a success; if an error was reported then verify the previous steps. Upon success the *Hello* service component JAR file is installed into the local Maven repository. A copy of the bundle JAR file will also be present in the "target" directory inside the project directory.
 
 ## Running the example
 
 To run the example, start Felix. A distribution of Felix is provided in the felix-1.0.3 directory. This version is configured to launch iPOJO automatically. From the Felix directory, launch the following command to start the framework
-
+    
+    :::sh
     java -jar bin/felix.jar
 
 You can check installed bundles by using the '*ps'* command:
-
+    
+    :::sh
     -> ps
     START LEVEL 1
        ID   State         Level  Name
@@ -363,53 +375,54 @@ You can check installed bundles by using
 iPOJO runtime is the bundle 4. The bundle 5 is a Felix shell command allowing the introspection of iPOJO component instances (see herefor further information).
 
 Install the Hello service bundle, the *Hello* service provider and the client that were created above:
-{div:class=shell}
-start file:../hello.service/target/hello.service-1.0.0.jar
-start file:../hello.impl/target/hello.impl-1.0.0.jar
-start file:../hello.client/target/hello.client-1.0.0.jar
-{div}
+
+    :::sh
+    start file:../hello.service/target/hello.service-1.0.0.jar
+    start file:../hello.impl/target/hello.impl-1.0.0.jar
+    start file:../hello.client/target/hello.client-1.0.0.jar
+
 By starting the *Hello* service provider bundle, the client component will automatically be activated. So, the *'hello world'* messages are displayed.
-{div:class=shell}
-\-> hello world
-hello world
-{div}
+
+    :::sh
+    -> hello world
+    hello world
+
 Stop the provider (with the '*stop 7*' command) and the client will automatically be deactivated since its dependency is no longer valid. If multiple Hello services are deployed, the client will connect to all of them. If you restart the bundle (with the *start 7* command), the client becomes valid.
 
 During these operations, you can use the arch command to check the state of instances.
-{div:class=shell}
-\-> stop 7
-\-> arch
-Instance ArchCommand \-> valid
-{color:red}Instance ipojo.example.hello.client.HelloClient-0 \-> invalid{color}
-\-> arch \-instance ipojo.example.hello.client.HelloClient-0
-instance name="ipojo.example.hello.client.HelloClient-0" 
-&nbsp;component.type="ipojo.example.hello.client.HelloClient" 
-&nbsp;state="{color:red}invalid{color}" bundle="8"
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; object name="ipojo.example.hello.client.HelloClient@137c60d"
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {color:red}handler name="org.apache.felix.ipojo.handlers.dependency.DependencyHandler" state="invalid"{color}
-{color:red}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{color}{color:red}requires aggregate="true" optional="false" state="resolved" specification="ipojo.example.hello.Hello"{color}
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handler name="org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler" state="valid"
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handler name="org.apache.felix.ipojo.handlers.architecture.ArchitectureHandler" state="valid"
-\-> start 7
-hello world
-\-> arch
-Instance ArchCommand \-> valid
-{color:red}Instance ipojo.example.hello.client.HelloClient-0 \-> valid{color}
-Instance HelloService \-> valid
-\-> arch \-instance ipojo.example.hello.client.HelloClient-0
-instance name="ipojo.example.hello.client.HelloClient-0" 
-&nbsp;component.type="ipojo.example.hello.client.HelloClient"
-&nbsp; state="valid" bundle="8"
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; object name="ipojo.example.hello.client.HelloClient@137c60d"
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {color:red}handler name="org.apache.felix.ipojo.handlers.dependency.DependencyHandler" state="valid"{color}
-{color:red}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{color}{color:red}requires aggregate="true" optional="false" state="resolved" specification="ipojo.example.hello.Hello"{color}
-{color:red}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{color} {color:red}uses service.id="38" instance.name="HelloService"{color}
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handler name="org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler" state="valid"
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handler name="org.apache.felix.ipojo.handlers.architecture.ArchitectureHandler" state="valid"
-{div}
+    
+<div class="shell"><p>-&gt; stop 7<br>
+-&gt; arch<br>
+Instance ArchCommand -&gt; valid<br>
+<font color="red">Instance ipojo.example.hello.client.HelloClient-0 -&gt; invalid</font><br>
+-&gt; arch -instance ipojo.example.hello.client.HelloClient-0<br>
+instance name="ipojo.example.hello.client.HelloClient-0" <br>
+&nbsp;component.type="ipojo.example.hello.client.HelloClient" <br>
+&nbsp;state="<font color="red">invalid</font>" bundle="8"<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; object name="ipojo.example.hello.client.HelloClient@137c60d"<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="red">handler name="org.apache.felix.ipojo.handlers.dependency.DependencyHandler" state="invalid"</font><br>
+<font color="red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="red">requires aggregate="true" optional="false" state="resolved" specification="ipojo.example.hello.Hello"</font><br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handler name="org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler" state="valid"<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handler name="org.apache.felix.ipojo.handlers.architecture.ArchitectureHandler" state="valid"<br>
+-&gt; start 7<br>
+hello world<br>
+-&gt; arch<br>
+Instance ArchCommand -&gt; valid<br>
+<font color="red">Instance ipojo.example.hello.client.HelloClient-0 -&gt; valid</font><br>
+Instance HelloService -&gt; valid<br>
+-&gt; arch -instance ipojo.example.hello.client.HelloClient-0<br>
+instance name="ipojo.example.hello.client.HelloClient-0" <br>
+&nbsp;component.type="ipojo.example.hello.client.HelloClient"<br>
+&nbsp; state="valid" bundle="8"<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; object name="ipojo.example.hello.client.HelloClient@137c60d"<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="red">handler name="org.apache.felix.ipojo.handlers.dependency.DependencyHandler" state="valid"</font><br>
+<font color="red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="red">requires aggregate="true" optional="false" state="resolved" specification="ipojo.example.hello.Hello"</font><br>
+<font color="red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font> <font color="red">uses service.id="38" instance.name="HelloService"</font><br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handler name="org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler" state="valid"<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handler name="org.apache.felix.ipojo.handlers.architecture.ArchitectureHandler" state="valid"</p></div>
 
 ## Conclusion
-We saw how to use easily iPOJO to build service-oriented components. Subscribe to the Felix users mailing list by sending a message to [mailto:users-subscribe@felix.apache.org]({{ refs.mailto-users-subscribe-felix-apache-org.path }}); after subscribing, email questions or feedback to [mailto:users@felix.apache.org].
+We saw how to use easily iPOJO to build service-oriented components. Subscribe to the Felix users mailing list by sending a message to [users-subscribe@felix.apache.org](mailto:users-subscribe@felix.apache.org); after subscribing, email questions or feedback to [users@felix.apache.org](mailto:users@felix.apache.org).
   
   
   

Modified: felix/site/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-in-10-minutes.mdtext
URL: http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-in-10-minutes.mdtext?rev=1443044&r1=1443043&r2=1443044&view=diff
==============================================================================
--- felix/site/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-in-10-minutes.mdtext (original)
+++ felix/site/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-in-10-minutes.mdtext Wed Feb  6 16:25:48 2013
@@ -6,7 +6,9 @@ Title: iPOJO in 10 minutes
 
 # iPOJO in 10 minutes
 
-*This page presents how to use the iPOJO runtime and its associated service component model. The concepts of the service component model are introduced, followed by a simple example that demonstrates the features of iPOJO. This tutorial uses XML to describe components.  However, iPOJO also supports* *[annotations]({{ refs.how-to-use-ipojo-annotations.path }})* *and a Java* *[API|apache-felix-ipojo-api]* *for this purpose.*
+This page presents how to use the iPOJO runtime and its associated service component model. The concepts of the service component model are introduced, followed by a simple example that demonstrates the features of iPOJO. This tutorial uses XML to describe components.  However, iPOJO also supports
+    * [annotations]({{ refs.how-to-use-ipojo-annotations.path }})
+    * A Java [API|apache-felix-ipojo-api]
 
 ## Introduction
 
@@ -36,11 +38,11 @@ To illustrate iPOJO features, we will im
 * A component requiring the dictionary service and providing a spellchecker service
 * A component requiring the spellchecker and providing an user interface
 
-!spell.png!
+<img src="spell.png">
 
 ### Preparing the tutorial
 
-This tutorial is based on Ant. So, you need to have the Ant program accessible in your path (see [here](http://ant.apache.org/) to download and install Ant). Download the tutorial archive available [here|http://people.apache.org/~clement/ipojo/tutorials/10min/tutorial.zip] and then unzip it. The archive contains seven directories:
+This tutorial is based on Ant. So, you need to have the Ant program accessible in your path (see [here](http://ant.apache.org/) to download and install Ant). Download the tutorial archive available [here](http://people.apache.org/~clement/ipojo/tutorials/10min/tutorial.zip) and then unzip it. The archive contains seven directories:
 * spell.services contains service interfaces used by the applications
 * spell.english contains an implementation of the Dictionary service (containing English words)
 * spell.checker contains an implementation of a Spell Checker. The spell checker requires a dictionary service and check if an input passage is correct (according to the words contained in the dictionary).
@@ -54,24 +56,26 @@ This tutorial is based on Ant. So, you n
 The spell.services project contains only service interfaces. It is not an iPOJO powered bundle.
 
 Go inside the Spell.services directory and create the file "src/spell/services/DictionaryService.java" for the following *Dictionary* service interface:
-{code:java}
-package spell.services;
-/**
- * A simple service interface that defines a dictionary service.
- * A dictionary service simply verifies the existence of a word.
-**/
-public interface DictionaryService {
+
+    :::java
+    package spell.services;
     /**
-     * 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);
-}
+     * A simple service interface that defines a dictionary service.
+     * A dictionary service simply verifies the existence of a word.
+    **/
+    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);
+    }
 
-    Then, create the file {{src/spell/services/SpellChecker.java}} for the following _Spell Checker_ service interface:
-    {code:java}
+Then, create the file `src/spell/services/SpellChecker.java` for the following _Spell Checker_ service interface:
+    
+    :::java
     package spell.services;
     /**
      * A simple service interface that defines a spell checker service.
@@ -94,30 +98,34 @@ public interface DictionaryService {
     }
 
 Once created, you can build the project by launching Ant from the project directory.
-{code:none}
-$ ant
-Buildfile: build.xml
-clean:
-compile:
-    [mkdir]({{ refs.mkdir.path }}) Created dir: d:\clement\workspaces\sandbox\ipojo\examples\tutorial-ant\
-            spell.services\output
-    [mkdir]({{ refs.mkdir.path }}) Created dir: d:\clement\workspaces\sandbox\ipojo\examples\tutorial-ant\
-            spell.services\output\classes
-    [javac]({{ refs.javac.path }}) Compiling 2 source files to d:\clement\workspaces\sandbox\ipojo\examples\
-            tutorial-ant\spell.services\output\classes
-package:
-      [bnd]({{ refs.bnd.path }}) spell.services 2
-BUILD SUCCESSFUL
-Total time: 0 seconds
 
-    The created bundle is inside the output directory (spell.services.jar). The build process use [BND|http://www.aqute.biz/Code/Bnd]. The bundle manifest is described in the spell.services.bnd file.
-    Once this project is done, we are able to implement a Dictionary service.
+    :::sh
+    $ ant
+    Buildfile: build.xml
+    clean:
+    compile:
+        [mkdir]({{ refs.mkdir.path }}) Created dir: d:\clement\workspaces\sandbox\ipojo\examples\tutorial-ant\
+                spell.services\output
+        [mkdir]({{ refs.mkdir.path }}) Created dir: d:\clement\workspaces\sandbox\ipojo\examples\tutorial-ant\
+                spell.services\output\classes
+        [javac]({{ refs.javac.path }}) Compiling 2 source files to d:\clement\workspaces\sandbox\ipojo\examples\
+                tutorial-ant\spell.services\output\classes
+    package:
+          [bnd]({{ refs.bnd.path }}) spell.services 2
+    BUILD SUCCESSFUL
+    Total time: 0 seconds
+
+The created bundle is inside the output directory (spell.services.jar). The build process use [BND](http://www.aqute.biz/Code/Bnd). The bundle manifest is described in the spell.services.bnd file.
+
+Once this project is done, we are able to implement a Dictionary service.
     
-    h3. The spell.english project: Providing an OSGi service
+### The spell.english project: Providing an OSGi service
     
-    The spell.english project is a simple dictionary implementation of the Dictionary service. It contains few English words. This implementation is an iPOJO component.
-    The first step is to implement the service. Create the "src/spell/english/EnglishDictionary.java" file for the following _Dictionary service_ implementation:
-    {code:java}
+The spell.english project is a simple dictionary implementation of the Dictionary service. It contains few English words. This implementation is an iPOJO component.
+
+The first step is to implement the service. Create the "src/spell/english/EnglishDictionary.java" file for the following _Dictionary service_ implementation:
+
+    :::java
     package spell.english;
     import spell.services.DictionaryService;
     /**
@@ -147,8 +155,9 @@ Total time: 0 seconds
     }
 
 Notice that this class does not contains neither OSGi nor iPOJO specific code. It is just an implementation of the Dictionary Service interface.
-Once created, we need to describe this component to ask iPOJO to manage it. To achieve this, create the "metadata.xml" file in the spell.english directory:
+Once created, we need to describe this component to ask iPOJO to manage it. To achieve this, create the `metadata.xml` file in the spell.english directory:
 
+    :::xml
     <ipojo>
     <component classname="spell.english.EnglishDictionary">
     	<provides/>
@@ -159,43 +168,45 @@ Once created, we need to describe this c
 This file describes the Dictionary service implementation. First it creates a *component*. This component has a *classname* attribute containing the implementation class name. The *'provides'* element indicates that the component provide a service. Provided service interfaces are computed by iPOJO, so it is not necessary to indicate them. The *instance* element asks iPOJO to create an instance of the described component when the bundle starts. The relation between components and instances is the same than between classes and objects in the object oriented programming. The *component* attribute indicates which component needs to be instantiated. By default, component type name is the implementation class (i.e. the classname attribute).
 
 Then, we are able to create the bundle. In the spell.english directory launch the ant command:
-{code:none}
-$ ant
-Buildfile: build.xml
-clean:
-   [delete]({{ refs.delete.path }}) Deleting directory d:\clement\workspaces\sandbox\ipojo\examples\
-            tutorial-ant\spell.english\output\classes
-   [delete]({{ refs.delete.path }}) Deleting directory d:\clement\workspaces\sandbox\ipojo\examples\
-            tutorial-ant\spell.english\output
-buildclasspath:
-compile:
-    [mkdir]({{ refs.mkdir.path }}) Created dir: d:\clement\workspaces\sandbox\ipojo\examples\
-            tutorial-ant\spell.english\output
-    [mkdir]({{ refs.mkdir.path }}) Created dir: d:\clement\workspaces\sandbox\ipojo\examples\
-            tutorial-ant\spell.english\output\classes
-    [javac]({{ refs.javac.path }}) Compiling 1 source file to d:\clement\workspaces\sandbox\ipojo\examples\
-            tutorial-ant\spell.english\output\classes
-package:
-      [bnd]({{ refs.bnd.path }}) spell.english 1
-    [ipojo]({{ refs.ipojo.path }}) Input Bundle File : d:\clement\workspaces\sandbox\ipojo\examples\
-            tutorial-ant\spell.english\output\spell.english.jar
-    [ipojo]({{ refs.ipojo.path }}) Metadata File : d:\clement\workspaces\sandbox\ipojo\examples\
-            tutorial-ant\spell.english\metadata.xml
-    [ipojo]({{ refs.ipojo.path }}) Start bundle manipulation
-    [ipojo]({{ refs.ipojo.path }}) Bundle manipulation - SUCCESS
-    [ipojo]({{ refs.ipojo.path }}) Output File : d:\clement\workspaces\sandbox\ipojo\examples\
-            tutorial-ant\spell.english\output\spell.english.jar
-BUILD SUCCESSFUL
-Total time: 1 second
 
-    The created bundle is inside the output directory (spell.english.jar). The build process is based on BND and on the iPOJO Ant task. The manifest of the bundle is described in the {{spell.english.bnd}} file.
+    :::xml
+    $ ant
+    Buildfile: build.xml
+    clean:
+       [delete]({{ refs.delete.path }}) Deleting directory d:\clement\workspaces\sandbox\ipojo\examples\
+                tutorial-ant\spell.english\output\classes
+       [delete]({{ refs.delete.path }}) Deleting directory d:\clement\workspaces\sandbox\ipojo\examples\
+                tutorial-ant\spell.english\output
+    buildclasspath:
+    compile:
+        [mkdir]({{ refs.mkdir.path }}) Created dir: d:\clement\workspaces\sandbox\ipojo\examples\
+                tutorial-ant\spell.english\output
+        [mkdir]({{ refs.mkdir.path }}) Created dir: d:\clement\workspaces\sandbox\ipojo\examples\
+                tutorial-ant\spell.english\output\classes
+        [javac]({{ refs.javac.path }}) Compiling 1 source file to d:\clement\workspaces\sandbox\ipojo\examples\
+                tutorial-ant\spell.english\output\classes
+    package:
+          [bnd]({{ refs.bnd.path }}) spell.english 1
+        [ipojo]({{ refs.ipojo.path }}) Input Bundle File : d:\clement\workspaces\sandbox\ipojo\examples\
+                tutorial-ant\spell.english\output\spell.english.jar
+        [ipojo]({{ refs.ipojo.path }}) Metadata File : d:\clement\workspaces\sandbox\ipojo\examples\
+                tutorial-ant\spell.english\metadata.xml
+        [ipojo]({{ refs.ipojo.path }}) Start bundle manipulation
+        [ipojo]({{ refs.ipojo.path }}) Bundle manipulation - SUCCESS
+        [ipojo]({{ refs.ipojo.path }}) Output File : d:\clement\workspaces\sandbox\ipojo\examples\
+                tutorial-ant\spell.english\output\spell.english.jar
+    BUILD SUCCESSFUL
+    Total time: 1 second
+
+The created bundle is inside the output directory (spell.english.jar). The build process is based on BND and on the iPOJO Ant task. The manifest of the bundle is described in the `spell.english.bnd` file.
     
-    h3. The spell.checker project: Requiring an OSGi service
+### The spell.checker project: Requiring an OSGi service
     
-    The spell.checker project aims to provide a _spell checker_ service. However, to serve this service, this implementation requires a _dictionary_ service. During this step, we will create an iPOJO component requiring a Dictionary service and providing the Spell Checker service.
+The spell.checker project aims to provide a _spell checker_ service. However, to serve this service, this implementation requires a _dictionary_ service. During this step, we will create an iPOJO component requiring a Dictionary service and providing the Spell Checker service.
     
-    First create the file "src/spell/checker/SpellCheck.java" in the spell.checker directory for the following _Check Speller service_ implementation:
-    {code:java}
+First create the file `src/spell/checker/SpellCheck.java` in the spell.checker directory for the following _Check Speller service_ implementation:
+
+    :::java
     package spell.checker;
     import java.util.ArrayList;
     import java.util.List;
@@ -232,10 +243,11 @@ Total time: 1 second
         }
     }
 
-This class implements the SpellChecker service interface as it will provide it. Moreover, it has a *special* field "*m*dictionary_". This field represents the required service. iPOJO will inject a Dictionary service when needed. So, the class can use it directly. Notice that this class as no OSGi specific code, both the service providing and the requiring are managed by iPOJO. If the used dictionary service leaves, iPOJO will try to find another provider. If no more providers are available, the instance is invalidated, and the provided service is withdrawn from the service registry.
+This class implements the SpellChecker service interface as it will provide it. Moreover, it has a *special* field `m_dictionary`. This field represents the required service. iPOJO will inject a Dictionary service when needed. So, the class can use it directly. Notice that this class as no OSGi specific code, both the service providing and the requiring are managed by iPOJO. If the used dictionary service leaves, iPOJO will try to find another provider. If no more providers are available, the instance is invalidated, and the provided service is withdrawn from the service registry.
 
-Once implemented, we need to describe this component. Create the "metadata.xml" file in the spell.checker directory for the following component descriptor:
+Once implemented, we need to describe this component. Create the `metadata.xml` file in the spell.checker directory for the following component descriptor:
 
+    :::xml
     <ipojo>
     <component classname="spell.checker.SpellCheck">
     	<requires field="m_dictionary"/>
@@ -252,117 +264,119 @@ Finally, we are able to build the bundle
 
 The spell.check.gui project contains a very simple user interface (in Swing) allowing a user to interact with a *spell checker* service.
 
-Create the "src\spell\gui\SpellCheckerGui.java" for the following implementation:
-{code:java}
-package spell.gui;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JTextField;
-import spell.services.SpellChecker;
-/**
- * A very simple Gui interacting with the CheckSpeller service
- */
-public class SpellCheckerGui extends JFrame {
-    /**
-     * Swing component where the user write the passage to check.
-     */
-    private JTextField m_passage = null;
+Create the `src\spell\gui\SpellCheckerGui.java` for the following implementation:
 
+    :::java
+    package spell.gui;
+    import javax.swing.JButton;
+    import javax.swing.JFrame;
+    import javax.swing.JLabel;
+    import javax.swing.JTextField;
+    import spell.services.SpellChecker;
     /**
-     * Check button
+     * A very simple Gui interacting with the CheckSpeller service
      */
-    private JButton m_checkButton = null;
+    public class SpellCheckerGui extends JFrame {
+        /**
+         * Swing component where the user write the passage to check.
+         */
+        private JTextField m_passage = null;
 
-    /**
-     * Area where the result is displayed.
-     */
-    private JLabel m_result = null;
-    /**
-     * Service dependency on the SpellChecker.
-     */
-    private SpellChecker m_checker;
+        /**
+         * Check button
+         */
+        private JButton m_checkButton = null;
 
-    /**
-     * Constructor.
-     * Initialize the GUI.
-     */
-    public SpellCheckerGui() {
-        super();
-        initComponents();
-        this.setTitle("Spellchecker Gui");
-    }
-    /**
-     * Initialize the Swing Gui.
-     */
-    private void initComponents() {
-        java.awt.GridBagConstraints gridBagConstraints;
-        m_checkButton = new javax.swing.JButton();
-        m_result = new javax.swing.JLabel();
-        m_passage = new javax.swing.JTextField();
-        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT*ON*CLOSE); //Stop Felix
-        getContentPane().setLayout(new java.awt.GridBagLayout());
-        m_checkButton.setText("Check");
-        m_checkButton.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent e) {
-                check();
+        /**
+         * Area where the result is displayed.
+         */
+        private JLabel m_result = null;
+        /**
+         * Service dependency on the SpellChecker.
+         */
+        private SpellChecker m_checker;
+
+        /**
+         * Constructor.
+         * Initialize the GUI.
+         */
+        public SpellCheckerGui() {
+            super();
+            initComponents();
+            this.setTitle("Spellchecker Gui");
+        }
+        /**
+         * Initialize the Swing Gui.
+         */
+        private void initComponents() {
+            java.awt.GridBagConstraints gridBagConstraints;
+            m_checkButton = new javax.swing.JButton();
+            m_result = new javax.swing.JLabel();
+            m_passage = new javax.swing.JTextField();
+            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT*ON*CLOSE); //Stop Felix
+            getContentPane().setLayout(new java.awt.GridBagLayout());
+            m_checkButton.setText("Check");
+            m_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(m_checkButton, gridBagConstraints);
+            m_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(m_result, gridBagConstraints);
+            m_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(m_passage, gridBagConstraints);
+            pack();
+        }
+        /**
+         * Check Button action.
+         * Collects the user input and checks it.
+         */
+        private void check() {
+            String[]({{ refs..path }}) result = m*checker.check(m*passage.getText());
+            if (result != null) {
+                m_result.setText(result.length + " word(s) are mispelled");
+            } else {
+                m_result.setText("All words are correct");
             }
-        });
-        gridBagConstraints = new java.awt.GridBagConstraints();
-        gridBagConstraints.gridx = 0;
-        gridBagConstraints.gridy = 1;
-        gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
-        getContentPane().add(m_checkButton, gridBagConstraints);
-        m_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(m_result, gridBagConstraints);
-        m_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(m_passage, gridBagConstraints);
-        pack();
-    }
-    /**
-     * Check Button action.
-     * Collects the user input and checks it.
-     */
-    private void check() {
-        String[]({{ refs..path }}) result = m*checker.check(m*passage.getText());
-        if (result != null) {
-            m_result.setText(result.length + " word(s) are mispelled");
-        } else {
-            m_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.
+         */
+        public void start() {
+            this.setVisible(true);
+        }
+        /**
+         * Stop callback.
+         *  This method will be called when the instance becomes invalid or stops.
+         *  It deletes the Gui.
+         */
+        public void stop() {
+            this.dispose();
         }
     }
-    /**
-     * Start callback.
-     * This method will be called when the instance becomes valid.
-     * It set the Gui visibility to true.
-     */
-    public void start() {
-        this.setVisible(true);
-    }
-    /**
-     * Stop callback.
-     *  This method will be called when the instance becomes invalid or stops.
-     *  It deletes the Gui.
-     */
-    public void stop() {
-        this.dispose();
-    }
-}
 
-    Look at the three last methods. The _check_ methods collect the user input and use a _Check speller_ service to check this input. This method is called when the button is pressed by the user. The _start_ and _stop_ methods are lifecycle callbacks. As we need to display the user interface when the instance is created and to delete it when the instance stops, we need a way to be notified when we need to execute these actions. iPOJO provide an easy way to do this. The component provides two callback methods for its activation and deactivation, start and stop, respectively. Callbacks are used when the component needs to be informed about a component state change. In iPOJO, the component state is either *INVALID* (i.e., not all of the component's constraints are satisfied) or *VALID* (i.e., all of the component's constraints are satisfied). In this example, the start callback method set the GUI visibility to true; the stop callback method deletes the GUI. The component metada
 ta will instruct iPOJO to invoke these methods when the component's state changes to *VALID* or *INVALID* respectively.
+Look at the three last methods. The _check_ methods collect the user input and use a _Check speller_ service to check this input. This method is called when the button is pressed by the user. The _start_ and _stop_ methods are lifecycle callbacks. As we need to display the user interface when the instance is created and to delete it when the instance stops, we need a way to be notified when we need to execute these actions. iPOJO provide an easy way to do this. The component provides two callback methods for its activation and deactivation, start and stop, respectively. Callbacks are used when the component needs to be informed about a component state change. In iPOJO, the component state is either *INVALID* (i.e., not all of the component's constraints are satisfied) or *VALID* (i.e., all of the component's constraints are satisfied). In this example, the start callback method set the GUI visibility to true; the stop callback method deletes the GUI. The component metadata w
 ill instruct iPOJO to invoke these methods when the component's state changes to *VALID* or *INVALID* respectively.
     
-    Create the _metadata.xml_ file in the spell.chercker.gui directory with the following content:
-    {code:xml}
+Create the _metadata.xml_ file in the spell.chercker.gui directory with the following content:
+
+    :::xml
     <ipojo>
     <component classname="spell.gui.SpellCheckerGui">
     	<requires field="m_checker"/>
@@ -379,11 +393,13 @@ Once this file is created, you can compi
 ## Running the application
 
 To run the example, start Felix. A distribution of Felix is provided in the felix directory. This version is configured to launch iPOJO automatically. From the Felix directory, launch the following command to start the framework. Then enter a profile name.
-{code:none}
-java -jar bin/felix.jar
 
-    You can check installed bundles by using the '_ps_' command:
-    {code:none}
+    :::sh
+    java -jar bin/felix.jar
+
+You can check installed bundles by using the '_ps_' command:
+
+    :::sh
     -> ps
     START LEVEL 1
        ID   State        Level  Name
@@ -396,40 +412,50 @@ java -jar bin/felix.jar
     ->
 
 iPOJO runtime is the bundle 4. Once started, install the four created bundles as above:
-{code:none}
-start file:../spell.services/output/spell.services.jar
-start file:../spell.english/output/spell.english.jar
-start file:../spell.checker/output/spell.checker.jar
-start file:../spell.checker.gui/output/spell.checker.gui.jar
-
-    When starting the GUI bundle, the user interface appears. Indeed, the _Check Speller_ service is provided. You can interact with this service by entering a passage and clicking on the check button:
-    !ss.png!
-    Then, stop the _Dictionary_ service provider (with the _stop 7_) command. The GUI disappears. Indeed, Spell Checker service cannot be provided as it depends on the Dictionary service.
-    !spell2.png!
-    Then, restart the Dictionary service provider with the _start 7_ command. The GUI reappears immediately. You can try to stop the _check speller_ service provider without stopping the _dictionary_ service provider with the _stop 8_ command. As for the last manipulation, the GUI disappears.
-    !spell3.png!
-    To go further in the exploration, modify the spell.checker implementation. For example, add a simple trace, printing wrong words:
-    {code:java}
-            // ...
-            // Return null if no words are incorrect.
-            if (errorList.size() == 0) { return null; }
+
+    :::sh
+    start file:../spell.services/output/spell.services.jar
+    start file:../spell.english/output/spell.english.jar
+    start file:../spell.checker/output/spell.checker.jar
+    start file:../spell.checker.gui/output/spell.checker.gui.jar
+
+When starting the GUI bundle, the user interface appears. Indeed, the _Check Speller_ service is provided. You can interact with this service by entering a passage and clicking on the check button:
+
+<img src="ss.png">
+
+Then, stop the _Dictionary_ service provider (with the _stop 7_) command. The GUI disappears. Indeed, Spell Checker service cannot be provided as it depends on the Dictionary service.
+
+<img src="spell2.png">
+
+Then, restart the Dictionary service provider with the _start 7_ command. The GUI reappears immediately. You can try to stop the _check speller_ service provider without stopping the _dictionary_ service provider with the _stop 8_ command. As for the last manipulation, the GUI disappears.
+
+<img src="spell3.png">
+
+To go further in the exploration, modify the spell.checker implementation. For example, add a simple trace, printing wrong words:
     
-            // Return the array of incorrect words.
-            System.out.println("Wrong words:" + errorList); // <-- Add this line
-            return (String[]) errorList.toArray(new String[errorList.size()]);
+    :::java
+    // ...
+    // 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); // <-- Add this line
+    return (String[]) errorList.toArray(new String[errorList.size()]);
 
 
 Then rebuild the spell.checker bundle and update it (with the 'update 8' command). You will see the gui "blinking". In fact, the gui was stopped as the required spell checker service was no more available. As soon as it was back, the gui restarts. The gui didn't lose its state. The other services weren't stopped during the update.
+
 You can uninstall the check service bundle and then re-install a new one (or the same one), you will see the same behavior.
 
 ## Conclusion
 
 We saw how to use easily iPOJO to build service-oriented component. In this tutorial, we have demonstrated how to:
+
 * Publish OSGi services
 * Require OSGi services
 * Use lifecycle callbacks to activate and deactivate components
 
-iPOJO provides a lot of others features that you can try in the others available tutorials. Subscribe to the Felix users mailing list by sending a message to [mailto:users-subscribe@felix.apache.org]({{ refs.mailto-users-subscribe-felix-apache-org.path }}); after subscribing, email questions or feedback to [mailto:users@felix.apache.org].
+iPOJO provides a lot of others features that you can try in the others available tutorials. Subscribe to the Felix users mailing list by sending a message to [users-subscribe@felix.apache.org](mailto:users-subscribe@felix.apache.org); after subscribing, email questions or feedback to [users@felix.apache.org](mailto:users@felix.apache.org).
   
   
   



Mime
View raw message