felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r849204 [8/33] - in /websites/staging/felix/trunk/content: ./ documentation/subprojects/ documentation/subprojects/apache-felix-ipojo/ documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-devguide/ documentation/subprojects/apach...
Date Sun, 03 Feb 2013 06:45:22 GMT
Modified: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-in-10-minutes.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-in-10-minutes.html (original)
+++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-in-10-minutes.html Sun Feb  3 06:45:21 2013
@@ -20,9 +20,45 @@
   <head>
     <title>Apache Felix - iPOJO in 10 minutes</title>
     <link rel="icon" href="/res/favicon.ico">
-    <link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
-    <link rel="stylesheet" href="/res/codehilite.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/site/media.data/site.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/ipojo/site/superfish.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/ipojo/site/style.css" type="text/css" media="all">
     <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    
+    <!--
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shCore.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushCSharp.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushPhp.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushJScript.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushVb.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushSql.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushXml.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushShell.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushDelphi.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushPython.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushJava.js"></script>
+    -->
+    
+    <script type="text/javascript" src="/ipojo/site/jquery-1.js"></script>
+    <script type="text/javascript" src="/ipojo/site/hoverIntent.js"></script>
+    <script type="text/javascript" src="/ipojo/site/superfish.js"></script> 
+    <script type="text/javascript" src="/ipojo/site/supersubs.js"></script> 
+    
+    <script type="text/javascript"> 
+     
+        $(document).ready(function(){ 
+            $("ul.sf-menu").supersubs({ 
+                minWidth:    14,   // minimum width of sub-menus in em units 
+                maxWidth:    30,   // maximum width of sub-menus in em units 
+                extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
+                                   // due to slight rounding differences and font-family 
+            }).superfish();  // call supersubs first, then superfish, so that subs are 
+                             // not display:none when measuring. Call before initialising 
+                             // containing tabs for same reason. 
+        }); 
+     
+    </script>
+    
   </head>
   <body>
     <div class="title">
@@ -37,295 +73,373 @@
         </a>
       </div>
     </div>
+  
+    <div class="main">
+    <div class="main">
+    <div class="page-header">
+    <img src="/ipojo/site/header.png" class="header">
+    <a href="http://ipojo.org"><img src="/ipojo/site/ipojo.png" width="225" class="header-logo"></a>
+    <ul class="sf-menu sf-js-enabled sf-shadow" id="ipojo-menu">
+    <li class="current">
+    <!-- Menu Overview -->
+    <a href="#" class="sf-with-ul">Overview<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+    <ul>
+        <li>
+        <a href="">Home</a>                          
+        </li>
+        <li>
+        <a href="">Why choose iPOJO</a>
+        </li>
+        <li>
+        <a href="">Success stories</a>
+        </li>
+        <li>
+        <a href="">Features</a>
+        </li>
+    </ul>
+    </li>   
     
-    <div class="menu"> 
-      <p><a href="/news.html">news</a>  <br />
-<a href="/license.html">license</a>  <br />
-<a href="/downloads.cgi">downloads</a>  <br />
-<a href="/documentation.html">documentation</a>  <br />
-<a href="/mailinglists.html">mailing lists</a>  <br />
-<a href="/documentation/community/contributing.html">contributing</a>  <br />
-<a href="/sitemap.html">site map</a>  <br />
-<a href="http://www.apache.org/">asf</a>  <br />
-<a href="http://www.apache.org/security/">security</a>  <br />
-<a href="http://www.apache.org/foundation/sponsorship.html">sponsorship</a>  <br />
-<a href="http://www.apache.org/foundation/thanks.html">sponsors</a>  <br />
-</p>
-<iframe
-    src="http://www.apache.org/ads/button.html"
-    style="border-width:0; float: left"
-    frameborder="0"
-    scrolling="no"
-    width="135"
-    height="135">
-</iframe>
-    </div>
+    <li class="">           
+    <!-- Menu download -->
+    <li>
+    <a href="/downloads.cgi">Download </a>
+    </li>
     
-    <div class="main">
-      <div class="breadcrump" style="font-size: 80%;">
-        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects.html">Apache Felix Subproject Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-ipojo.html">Apache Felix iPOJO</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted.html">apache-felix-ipojo-gettingstarted</a>
-      </div>
-
+    <li class="">                   
+    <!-- Menu Documentation -->
+    <a href="#" class="sf-with-ul">Documentation<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+    <ul>
+        <!-- sub-menu : getting started -->
+        <li class="">
+        <a href="#" class="sf-with-ul">Getting Started<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+        <ul>
+         <li><a href="">iPOJO in 10 minutes</a></li>
+         <li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/how-to-use-ipojo-annotations.html">Using Annotations</a></li>
+         <li><a href="">Maven tutorial</a></li>
+         <li><a href="">Advanced tutorial</a></li>
+         <li><a href="">Using Distributed OSGi</a></li>
+         <li><a href="">Application Composition</a></li>
+        </ul>
+        </li> <!-- end of getting started -->
+        <!-- sub menu : Describing Components -->
+         <li class="">
+            <a href="" class="sf-with-ul">Describing components<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+            <ul>
+            <li><a href="">Requiring a service</a></li>
+            <li><a href="">Providing a service</a></li>
+            <li><a href="">Lifecycle management</a></li>
+            <li><a href="">Configuration</a></li>
+            <li><a href="">Introspection</a></li>
+            <li><a href="">Impacting the lifecycle</a></li>
+            <li><a href="">Asynchronous communication</a></li>
+            <li><a href="">JMX management</a></li>
+            <li><a href="">Extender pattern</a></li>
+            <li><a href="">Whiteboard pattern</a></li>
+            <li><a href="">Temporal dependencies</a></li>
+            </ul>
+         </li> <!-- End of describing components -->
+        <!-- sub-menu : User Guide -->
+        <li class="">
+        <a href="" class="sf-with-ul">User Guide<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+            <ul>
+            <li><a href="">iPOJO and config admin</a></li>
+            <li><a href="">Factories and Instances</a></li>
+            <li><a href="">XML Schemas</a></li>
+            <li><a href="">API</a></li>
+            <li><a href="">Testing components</a></li>
+            <li><a href="">Eclipse Integration</a></li>
+            <li><a href="">FAQ</a></li>
+            <li><a href="">Reference Card</a></li>
+            </ul>
+        </li> <!-- end of user guide -->
+        <!-- sub-menu : Dev Guide -->
+        <li> 
+        <a href="#" class="sf-with-ul">Advanced Topics<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+           <ul>
+            <li><a href="http://felix.apache.org/ipojo/api/1.6.0">Javadoc</a></li>
+            <li><a href="">Handler development</a></li>
+            <li><a href="">Manipulation Metadata </a></li>
+            <li><a href="">Dive into the iPOJO Manipulation depths</a></li>
+           </ul>
+        </li> <!-- End of Dev guide -->
+    </ul> 
+    </li> <!-- End of doc -->
+    <!-- Menu 4 : Tools -->
+    <li class="">
+    <a href="#" class="sf-with-ul">Tools<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+    <ul>
+       <li><a href="">Ant Task</a></li>
+       <li><a href="">Eclipse Plugin</a></li>
+       <li><a href="">Maven Plugin</a></li>
+       <li><a href="">`arch` shell command</a></li>
+       <li><a href="">Online Manipulator</a></li>
+       <li><a href="">Webconsole plugin</a></li>
+       <li><a href="">Junit4OSGi</a></li>
+    </ul>   
+    </li><!-- End of tools -->  
+    <!-- Menu 5 : Support -->
+    <li>
+    <a href="">Support </a>
+    </li>
+    <!-- End of the menu 5 -->          
+    <!-- Menu 6 : Misc -->
+    <li class="">
+    <a href="#" class="sf-with-ul">Misc<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+    <ul>
+       <li><a href="">Supported JVMs</a></li>
+       <li><a href="">Supported OSGi Implementations</a></li>
+       <li><a href="http://ipojo-dark-side.blogspot.com">iPOJO's Dark Side Blog</a></li>
+       <li><a href="">Article & Presentations</a></li>
+       <li><a href="http://www.apache.org/">ASF</a></li>
+       <li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
+       <li><a href="http://www.apache.org/foundation/thanks.html">Sponsors</a></li>
+    </ul>
+    </li><!-- End of misc -->
+    </ul> <!-- End of the menu -->
+    </div> <!-- Page header -->
+  
+      <!-- 
       
       <div class="tip">
            This page is a translated version of <a href="/site/ipojo-in-10-minutes.html" target="felix_cwiki">/site/ipojo-in-10-minutes.html</a>. In case of
            doubt you might want to refer to the old page.
       </div>
       
+      -->
       
       <h1>iPOJO in 10 minutes</h1>
-      <p>{include:apache-felix-ipojo-header}</p>
-<div class="content">
-
-# 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](/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/how-to-use-ipojo-annotations.html)* *and a Java* *[API|apache-felix-ipojo-api]* *for this purpose.*
-
-## Introduction
-
-iPOJO aims to simplify service-oriented programming on OSGi frameworks; the name iPOJO is an abbreviation for *injected POJO*. iPOJO provides a new way to develop OSGi service components, simplifying service component implementation by transparently managing the dynamics of the environment as well as other non-functional requirements. The iPOJO framework allows developers to more clearly separate functional code (i.e., POJOs) from the non-functional code (i.e., dependency management, service provision, configuration, etc.).  At run time, iPOJO combines the functional and non-functional aspects. To achieve this, iPOJO provides a simple and extensible service component model based on POJOs.
-
-## The POJO concept
-
-"POJO" is just an acronym for Plain Old Java Object, but it embodies a concept that the simpler and less intrusive the design of a given framework, the better. The name is used to emphasize that a given object is not somehow special, but is an ordinary Java Object. Martin Fowler, Rebecca Parsons and Josh Mackenzie coined the term POJO in September 2000: "We wondered why people were so against using regular objects in their systems and concluded that it was because simple objects lacked a fancy name. So we gave them one, and it's caught on very nicely." From a developer's perspective, the iPOJO framework strives as much as possible to only require POJOs.
-
-## iPOJO service component overview
-
-A service component is able to provide and/or require services, where a service is an object that implements a given Java interface. In addition, iPOJO introduces a callback concept to notify a component about various state changes.
-
-The component is a central concept in iPOJO. In the core iPOJO model, a component describes service dependencies, provided services, and callbacks; this information is recorded in the component's metadata. After components, the next most important concept in iPOJO is the component instance. A component instance is a special *version* of a component. By merging component metadata and instance configuration, the iPOJO runtime is able to discover and inject required services, publish provided services, and manage the component's life cycle.
-
-## A simple example
-
-In this tutorial we will present how to:
-* Publish an OSGi service
-* Require an OSGi service
-* Use lifecycle callbacks to activate and deactivate components
-
-### Presentation of the *Spell* application
-
-To illustrate iPOJO features, we will implement a very simple application. This application is composed by three components:
-* A component implementing a dictionary service
-* A component requiring the dictionary service and providing a spellchecker service
-* A component requiring the spellchecker and providing an user interface
-
-!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:
-* 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).
-* spell.gui contains a very simple user interface. This component uses a spell checker service. Then the user can interact with the spell checker with this user interface.
-* The task directory contains Ant tasks used to build the project
-* The solution directory contains an already developed version of the application.
-* Finally, the felix folder contains a configured version of the Felix runtime
-
-### The spell.services project
-
-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:
+      
+      <div class="content">
+        <h1 id="ipojo-in-10-minutes">iPOJO in 10 minutes</h1>
+<p><em>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</em> <em><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/how-to-use-ipojo-annotations.html">annotations</a></em> <em>and a Java</em> <em>[API|apache-felix-ipojo-api]</em> <em>for this purpose.</em></p>
+<h2 id="introduction">Introduction</h2>
+<p>iPOJO aims to simplify service-oriented programming on OSGi frameworks; the name iPOJO is an abbreviation for <em>injected POJO</em>. iPOJO provides a new way to develop OSGi service components, simplifying service component implementation by transparently managing the dynamics of the environment as well as other non-functional requirements. The iPOJO framework allows developers to more clearly separate functional code (i.e., POJOs) from the non-functional code (i.e., dependency management, service provision, configuration, etc.).  At run time, iPOJO combines the functional and non-functional aspects. To achieve this, iPOJO provides a simple and extensible service component model based on POJOs.</p>
+<h2 id="the-pojo-concept">The POJO concept</h2>
+<p>"POJO" is just an acronym for Plain Old Java Object, but it embodies a concept that the simpler and less intrusive the design of a given framework, the better. The name is used to emphasize that a given object is not somehow special, but is an ordinary Java Object. Martin Fowler, Rebecca Parsons and Josh Mackenzie coined the term POJO in September 2000: "We wondered why people were so against using regular objects in their systems and concluded that it was because simple objects lacked a fancy name. So we gave them one, and it's caught on very nicely." From a developer's perspective, the iPOJO framework strives as much as possible to only require POJOs.</p>
+<h2 id="ipojo-service-component-overview">iPOJO service component overview</h2>
+<p>A service component is able to provide and/or require services, where a service is an object that implements a given Java interface. In addition, iPOJO introduces a callback concept to notify a component about various state changes.</p>
+<p>The component is a central concept in iPOJO. In the core iPOJO model, a component describes service dependencies, provided services, and callbacks; this information is recorded in the component's metadata. After components, the next most important concept in iPOJO is the component instance. A component instance is a special <em>version</em> of a component. By merging component metadata and instance configuration, the iPOJO runtime is able to discover and inject required services, publish provided services, and manage the component's life cycle.</p>
+<h2 id="a-simple-example">A simple example</h2>
+<p>In this tutorial we will present how to:
+<em> Publish an OSGi service
+</em> Require an OSGi service
+* Use lifecycle callbacks to activate and deactivate components</p>
+<h3 id="presentation-of-the-spell-application">Presentation of the <em>Spell</em> application</h3>
+<p>To illustrate iPOJO features, we will implement a very simple application. This application is composed by three components:
+<em> A component implementing a dictionary service
+</em> A component requiring the dictionary service and providing a spellchecker service
+* A component requiring the spellchecker and providing an user interface</p>
+<p>!spell.png!</p>
+<h3 id="preparing-the-tutorial">Preparing the tutorial</h3>
+<p>This tutorial is based on Ant. So, you need to have the Ant program accessible in your path (see <a href="http://ant.apache.org/">here</a> 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:
+<em> spell.services contains service interfaces used by the applications
+</em> spell.english contains an implementation of the Dictionary service (containing English words)
+<em> 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).
+</em> spell.gui contains a very simple user interface. This component uses a spell checker service. Then the user can interact with the spell checker with this user interface.
+<em> The task directory contains Ant tasks used to build the project
+</em> The solution directory contains an already developed version of the application.
+* Finally, the felix folder contains a configured version of the Felix runtime</p>
+<h3 id="the-spellservices-project">The spell.services project</h3>
+<p>The spell.services project contains only service interfaces. It is not an iPOJO powered bundle.</p>
+<p>Go inside the Spell.services directory and create the file "src/spell/services/DictionaryService.java" for the following <em>Dictionary</em> service interface:
 {code:java}
 package spell.services;
-/**
+/<strong>
  * A simple service interface that defines a dictionary service.
  * A dictionary service simply verifies the existence of a word.
-**/
+</strong>/
 public interface DictionaryService {
-    /**
+    /<strong>
      * 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.
-     **/
+     </strong>/
     public boolean checkWord(String word);
-}
+}</p>
+<div class="codehilite"><pre><span class="n">Then</span><span class="p">,</span> <span class="n">create</span> <span class="n">the</span> <span class="n">file</span>  <span class="k">for</span> <span class="n">the</span> <span class="n">following</span> <span class="n">_Spell</span> <span class="n">Checker_</span> <span class="n">service</span> <span class="n">interface:</span>
+<span class="p">{</span><span class="n">code:java</span><span class="p">}</span>
+<span class="nb">package</span> <span class="n">spell</span><span class="o">.</span><span class="n">services</span><span class="p">;</span>
+<span class="o">/**</span>
+ <span class="o">*</span> <span class="n">A</span> <span class="n">simple</span> <span class="n">service</span> <span class="n">interface</span> <span class="n">that</span> <span class="n">defines</span> <span class="n">a</span> <span class="n">spell</span> <span class="n">checker</span> <span class="n">service</span><span class="o">.</span>
+ <span class="o">*</span> <span class="n">A</span> <span class="n">spell</span> <span class="n">checker</span> <span class="n">service</span> <span class="n">checks</span> <span class="n">the</span> <span class="n">spelling</span> <span class="n">of</span> <span class="n">all</span> <span class="n">words</span> <span class="n">in</span> <span class="n">a</span>
+ <span class="o">*</span> <span class="n">given</span> <span class="n">passage</span><span class="o">.</span> <span class="n">A</span> <span class="n">passage</span> <span class="n">is</span> <span class="n">any</span> <span class="n">number</span> <span class="n">of</span> <span class="n">words</span> <span class="n">separated</span> <span class="n">by</span>
+ <span class="o">*</span> <span class="n">a</span> <span class="n">space</span> <span class="n">character</span> <span class="ow">and</span> <span class="n">the</span> <span class="n">following</span> <span class="n">punctuation</span> <span class="n">marks:</span> <span class="n">comma</span><span class="p">,</span>
+ <span class="o">*</span> <span class="n">period</span><span class="p">,</span> <span class="n">exclamation</span> <span class="n">mark</span><span class="p">,</span> <span class="n">question</span> <span class="n">mark</span><span class="p">,</span> <span class="n">semi</span><span class="o">-</span><span class="n">colon</span><span class="p">,</span> <span class="ow">and</span> <span class="n">colon</span><span class="o">.</span>
+<span class="o">**/</span>
+<span class="n">public</span> <span class="n">interface</span> <span class="n">SpellChecker</span> <span class="p">{</span>
+    <span class="o">/**</span>
+     <span class="o">*</span> <span class="n">Checks</span> <span class="n">a</span> <span class="n">given</span> <span class="n">passage</span> <span class="k">for</span> <span class="n">spelling</span> <span class="n">errors</span><span class="o">.</span> <span class="n">A</span> <span class="n">passage</span> <span class="n">is</span> <span class="n">any</span>
+     <span class="o">*</span> <span class="n">number</span> <span class="n">of</span> <span class="n">words</span> <span class="n">separated</span> <span class="n">by</span> <span class="n">a</span> <span class="n">space</span> <span class="ow">and</span> <span class="n">any</span> <span class="n">of</span> <span class="n">the</span> <span class="n">following</span>
+     <span class="o">*</span> <span class="n">punctuation</span> <span class="n">marks:</span> <span class="n">comma</span> <span class="p">(,),</span> <span class="n">period</span> <span class="p">(</span><span class="o">.</span><span class="p">),</span> <span class="n">exclamation</span> <span class="n">mark</span> <span class="p">(</span><span class="o">!</span><span class="p">),</span>
+     <span class="o">*</span> <span class="n">question</span> <span class="n">mark</span> <span class="p">(?),</span> <span class="n">semi</span><span class="o">-</span><span class="n">colon</span> <span class="p">(;),</span> <span class="ow">and</span> <span class="n">colon</span><span class="p">(:)</span><span class="o">.</span>
+     <span class="o">*</span> <span class="nv">@param</span> <span class="n">passage</span> <span class="n">the</span> <span class="n">passage</span> <span class="n">to</span> <span class="n">spell</span> <span class="n">check</span><span class="o">.</span>
+     <span class="o">*</span> <span class="nv">@return</span> <span class="n">An</span> <span class="n">array</span> <span class="n">of</span> <span class="n">misspelled</span> <span class="n">words</span> <span class="ow">or</span> <span class="n">null</span> <span class="k">if</span> <span class="nb">no</span>
+     <span class="o">*</span>         <span class="n">words</span> <span class="n">are</span> <span class="n">misspelled</span><span class="o">.</span>
+    <span class="o">**/</span>
+    <span class="n">public</span> <span class="n">String</span><span class="o">[]</span> <span class="n">check</span><span class="p">(</span><span class="n">String</span> <span class="n">passage</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
 
-    Then, create the file  for the following _Spell Checker_ service interface:
-    {code:java}
-    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);
-    }
 
-Once created, you can build the project by launching Ant from the project directory.
+<p>Once created, you can build the project by launching Ant from the project directory.
 {code:none}
 $ ant
 Buildfile: build.xml
 clean:
 compile:
-    [mkdir]() Created dir: d:\clement\workspaces\sandbox\ipojo\examples\tutorial-ant\
+    <a href="">mkdir</a> Created dir: d:\clement\workspaces\sandbox\ipojo\examples\tutorial-ant\
             spell.services\output
-    [mkdir]() Created dir: d:\clement\workspaces\sandbox\ipojo\examples\tutorial-ant\
+    <a href="">mkdir</a> Created dir: d:\clement\workspaces\sandbox\ipojo\examples\tutorial-ant\
             spell.services\output\classes
-    [javac]() Compiling 2 source files to d:\clement\workspaces\sandbox\ipojo\examples\
+    <a href="">javac</a> Compiling 2 source files to d:\clement\workspaces\sandbox\ipojo\examples\
             tutorial-ant\spell.services\output\classes
 package:
-      [bnd]() spell.services 2
+      <a href="">bnd</a> spell.services 2
 BUILD SUCCESSFUL
-Total time: 0 seconds
+Total time: 0 seconds</p>
+<div class="codehilite"><pre><span class="n">The</span> <span class="n">created</span> <span class="n">bundle</span> <span class="n">is</span> <span class="n">inside</span> <span class="n">the</span> <span class="n">output</span> <span class="n">directory</span> <span class="p">(</span><span class="n">spell</span><span class="o">.</span><span class="n">services</span><span class="o">.</span><span class="n">jar</span><span class="p">)</span><span class="o">.</span> <span class="n">The</span> <span class="n">build</span> <span class="n">process</span> <span class="k">use</span> <span class="p">[</span><span class="n">BND</span><span class="o">|</span><span class="n">http:</span><span class="sr">//</span><span class="n">www</span><span class="o">.</span><span class="n">aqute</span><span class="o">.</span><span class="n">biz</span><span class="sr">/Code/</span><span class="n">Bnd</span><span class="p">]</span><span class="o">.</span> <span class="n">The</span> <span class="n">bu
 ndle</span> <span class="n">manifest</span> <span class="n">is</span> <span class="n">described</span> <span class="n">in</span> <span class="n">the</span> <span class="n">spell</span><span class="o">.</span><span class="n">services</span><span class="o">.</span><span class="n">bnd</span> <span class="n">file</span><span class="o">.</span>
+<span class="n">Once</span> <span class="n">this</span> <span class="n">project</span> <span class="n">is</span> <span class="n">done</span><span class="p">,</span> <span class="n">we</span> <span class="n">are</span> <span class="n">able</span> <span class="n">to</span> <span class="n">implement</span> <span class="n">a</span> <span class="n">Dictionary</span> <span class="n">service</span><span class="o">.</span>
+
+<span class="n">h3</span><span class="o">.</span> <span class="n">The</span> <span class="n">spell</span><span class="o">.</span><span class="n">english</span> <span class="n">project:</span> <span class="n">Providing</span> <span class="n">an</span> <span class="n">OSGi</span> <span class="n">service</span>
+
+<span class="n">The</span> <span class="n">spell</span><span class="o">.</span><span class="n">english</span> <span class="n">project</span> <span class="n">is</span> <span class="n">a</span> <span class="n">simple</span> <span class="n">dictionary</span> <span class="n">implementation</span> <span class="n">of</span> <span class="n">the</span> <span class="n">Dictionary</span> <span class="n">service</span><span class="o">.</span> <span class="n">It</span> <span class="n">contains</span> <span class="n">few</span> <span class="n">English</span> <span class="n">words</span><span class="o">.</span> <span class="n">This</span> <span class="n">implementation</span> <span class="n">is</span> <span class="n">an</span> <span class="n">iPOJO</span> <span class="n">component</span><span class="o">.</span>
+<span class="n">The</span> <span class="n">first</span> <span class="n">step</span> <span class="n">is</span> <span class="n">to</span> <span class="n">implement</span> <span class="n">the</span> <span class="n">service</span><span class="o">.</span> <span class="n">Create</span> <span class="n">the</span> <span class="s">&quot;src/spell/english/EnglishDictionary.java&quot;</span> <span class="n">file</span> <span class="k">for</span> <span class="n">the</span> <span class="n">following</span> <span class="n">_Dictionary</span> <span class="n">service_</span> <span class="n">implementation:</span>
+<span class="p">{</span><span class="n">code:java</span><span class="p">}</span>
+<span class="nb">package</span> <span class="n">spell</span><span class="o">.</span><span class="n">english</span><span class="p">;</span>
+<span class="nb">import</span> <span class="n">spell</span><span class="o">.</span><span class="n">services</span><span class="o">.</span><span class="n">DictionaryService</span><span class="p">;</span>
+<span class="o">/**</span>
+ <span class="o">*</span> <span class="n">An</span> <span class="n">implementation</span> <span class="n">of</span> <span class="n">the</span> <span class="n">Dictionary</span> <span class="n">service</span> <span class="n">containing</span> <span class="n">English</span> <span class="n">words</span>
+ <span class="o">*</span> <span class="n">see</span> <span class="n">DictionaryService</span> <span class="k">for</span> <span class="n">details</span> <span class="n">of</span> <span class="n">the</span> <span class="n">service</span><span class="o">.</span>
+ <span class="o">**/</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">EnglishDictionary</span> <span class="n">implements</span> <span class="n">DictionaryService</span> <span class="p">{</span>
+    <span class="sr">//</span> <span class="n">The</span> <span class="n">set</span> <span class="n">of</span> <span class="n">words</span> <span class="n">contained</span> <span class="n">in</span> <span class="n">the</span> <span class="n">dictionary</span><span class="o">.</span>
+    <span class="n">String</span><span class="o">[]</span> <span class="n">m_dictionary</span> <span class="o">=</span> <span class="p">{</span> <span class="s">&quot;welcome&quot;</span><span class="p">,</span> <span class="s">&quot;to&quot;</span><span class="p">,</span> <span class="s">&quot;the&quot;</span><span class="p">,</span> <span class="s">&quot;ipojo&quot;</span><span class="p">,</span> <span class="s">&quot;tutorial&quot;</span> <span class="p">};</span>
+    <span class="o">/**</span>
+     <span class="o">*</span> <span class="n">Implements</span> <span class="n">DictionaryService</span><span class="o">.</span><span class="n">checkWord</span><span class="p">()</span><span class="o">.</span> <span class="n">Determines</span>
+     <span class="o">*</span> <span class="k">if</span> <span class="n">the</span> <span class="n">passed</span> <span class="n">in</span> <span class="n">word</span> <span class="n">is</span> <span class="n">contained</span> <span class="n">in</span> <span class="n">the</span> <span class="n">dictionary</span><span class="o">.</span>
+     <span class="o">*</span> <span class="nv">@param</span> <span class="n">word</span> <span class="n">the</span> <span class="n">word</span> <span class="n">to</span> <span class="n">be</span> <span class="n">checked</span><span class="o">.</span>
+     <span class="o">*</span> <span class="nv">@return</span> <span class="n">true</span> <span class="k">if</span> <span class="n">the</span> <span class="n">word</span> <span class="n">is</span> <span class="n">in</span> <span class="n">the</span> <span class="n">dictionary</span><span class="p">,</span>
+     <span class="o">*</span>         <span class="n">false</span> <span class="n">otherwise</span><span class="o">.</span>
+     <span class="o">**/</span>
+    <span class="n">public</span> <span class="n">boolean</span> <span class="n">checkWord</span><span class="p">(</span><span class="n">String</span> <span class="n">word</span><span class="p">)</span> <span class="p">{</span>
+        <span class="n">word</span> <span class="o">=</span> <span class="n">word</span><span class="o">.</span><span class="n">toLowerCase</span><span class="p">();</span>
+        <span class="sr">//</span> <span class="n">This</span> <span class="n">is</span> <span class="n">very</span> <span class="n">inefficient</span>
+        <span class="k">for</span> <span class="p">(</span><span class="nb">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">m_dictionary</span><span class="o">.</span><span class="nb">length</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
+            <span class="k">if</span> <span class="p">(</span><span class="n">m_dictionary</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">equals</span><span class="p">(</span><span class="n">word</span><span class="p">))</span> <span class="p">{</span>
+                <span class="k">return</span> <span class="n">true</span><span class="p">;</span>
+            <span class="p">}</span>
+        <span class="p">}</span>
+        <span class="k">return</span> <span class="n">false</span><span class="p">;</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>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:</p>
+<div class="codehilite"><pre><span class="nt">&lt;ipojo&gt;</span>
+<span class="nt">&lt;component</span> <span class="na">classname=</span><span class="s">&quot;spell.english.EnglishDictionary&quot;</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;provides/&gt;</span>
+<span class="nt">&lt;/component&gt;</span>
+<span class="nt">&lt;instance</span> <span class="na">component=</span><span class="s">&quot;spell.english.EnglishDictionary&quot;</span><span class="nt">/&gt;</span>
+<span class="nt">&lt;/ipojo&gt;</span>
+</pre></div>
 
-    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 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}
-    package spell.english;
-    import spell.services.DictionaryService;
-    /**
-     * An implementation of the Dictionary service containing English words
-     * see DictionaryService for details of the service.
-     **/
-    public class EnglishDictionary implements DictionaryService {
-        // The set of words contained in the dictionary.
-        String[] m_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 (int i = 0; i < m_dictionary.length; i++) {
-                if (m_dictionary[i].equals(word)) {
-                    return true;
-                }
-            }
-            return false;
-        }
-    }
-
-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:
-
-    <ipojo>
-    <component classname="spell.english.EnglishDictionary">
-        <provides/>
-    </component>
-    <instance component="spell.english.EnglishDictionary"/>
-    </ipojo>
-
-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:
+<p>This file describes the Dictionary service implementation. First it creates a <em>component</em>. This component has a <em>classname</em> attribute containing the implementation class name. The <em>'provides'</em> element indicates that the component provide a service. Provided service interfaces are computed by iPOJO, so it is not necessary to indicate them. The <em>instance</em> 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 <em>component</em> attribute indicates which component needs to be instantiated. By default, component type name is the implementation class (i.e. the classname attribute).</p>
+<p>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]() Deleting directory d:\clement\workspaces\sandbox\ipojo\examples\
+   <a href="">delete</a> Deleting directory d:\clement\workspaces\sandbox\ipojo\examples\
             tutorial-ant\spell.english\output\classes
-   [delete]() Deleting directory d:\clement\workspaces\sandbox\ipojo\examples\
+   <a href="">delete</a> Deleting directory d:\clement\workspaces\sandbox\ipojo\examples\
             tutorial-ant\spell.english\output
 buildclasspath:
 compile:
-    [mkdir]() Created dir: d:\clement\workspaces\sandbox\ipojo\examples\
+    <a href="">mkdir</a> Created dir: d:\clement\workspaces\sandbox\ipojo\examples\
             tutorial-ant\spell.english\output
-    [mkdir]() Created dir: d:\clement\workspaces\sandbox\ipojo\examples\
+    <a href="">mkdir</a> Created dir: d:\clement\workspaces\sandbox\ipojo\examples\
             tutorial-ant\spell.english\output\classes
-    [javac]() Compiling 1 source file to d:\clement\workspaces\sandbox\ipojo\examples\
+    <a href="">javac</a> Compiling 1 source file to d:\clement\workspaces\sandbox\ipojo\examples\
             tutorial-ant\spell.english\output\classes
 package:
-      [bnd]() spell.english 1
-    [ipojo]() Input Bundle File : d:\clement\workspaces\sandbox\ipojo\examples\
+      <a href="">bnd</a> spell.english 1
+    <a href="">ipojo</a> Input Bundle File : d:\clement\workspaces\sandbox\ipojo\examples\
             tutorial-ant\spell.english\output\spell.english.jar
-    [ipojo]() Metadata File : d:\clement\workspaces\sandbox\ipojo\examples\
+    <a href="">ipojo</a> Metadata File : d:\clement\workspaces\sandbox\ipojo\examples\
             tutorial-ant\spell.english\metadata.xml
-    [ipojo]() Start bundle manipulation
-    [ipojo]() Bundle manipulation - SUCCESS
-    [ipojo]() Output File : d:\clement\workspaces\sandbox\ipojo\examples\
+    <a href="">ipojo</a> Start bundle manipulation
+    <a href="">ipojo</a> Bundle manipulation - SUCCESS
+    <a href="">ipojo</a> 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  file.
-
-    h3. 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.
-
-    First create the file "src/spell/checker/SpellCheck.java" in the spell.checker directory for the following _Check Speller service_ implementation:
-    {code:java}
-    package spell.checker;
-    import java.util.ArrayList;
-    import java.util.List;
-    import java.util.StringTokenizer;
-    import spell.services.DictionaryService;
-    import spell.services.SpellChecker;
-    public class SpellCheck implements SpellChecker {
-        private DictionaryService m_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 errorList = new ArrayList();
-            // 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 (! m_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.
-            return (String[]) errorList.toArray(new String[errorList.size()]);
-        }
-    }
-
-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:
-
-    <ipojo>
-    <component classname="spell.checker.SpellCheck">
-        <requires field="m_dictionary"/>
-        <provides/>
-    </component>
-    <instance component="spell.checker.SpellCheck"/>
-    </ipojo>
-
-This description contains a '*requires'* element. This element indicates to iPOJO to manage the service dependency. The *field* attributes describe in which member of the class the service need to be injected. It is not necessary to write the required service as it is computed by iPOJO. Notice that iPOJO can inject required service by invoking methods too.
-
-Finally, we are able to build the bundle. As for previous projects, launch Ant from the project directory.
+Total time: 1 second</p>
+<div class="codehilite"><pre><span class="n">The</span> <span class="n">created</span> <span class="n">bundle</span> <span class="n">is</span> <span class="n">inside</span> <span class="n">the</span> <span class="n">output</span> <span class="n">directory</span> <span class="p">(</span><span class="n">spell</span><span class="o">.</span><span class="n">english</span><span class="o">.</span><span class="n">jar</span><span class="p">)</span><span class="o">.</span> <span class="n">The</span> <span class="n">build</span> <span class="n">process</span> <span class="n">is</span> <span class="n">based</span> <span class="n">on</span> <span class="n">BND</span> <span class="ow">and</span> <span class="n">on</span> <span class="n">the</span> <span class="n">iPOJO</span> <span class="n">Ant</span> <span class="n">task</span><span class="o">.</span> <span class="n">The</span> <span class="n">manifest</span> <span class="n">of</span> <span class="n">the</span> <span class="n">bundle</s
 pan> <span class="n">is</span> <span class="n">described</span> <span class="n">in</span> <span class="n">the</span>  <span class="n">file</span><span class="o">.</span>
 
-### The spell.checker.gui project
+<span class="n">h3</span><span class="o">.</span> <span class="n">The</span> <span class="n">spell</span><span class="o">.</span><span class="n">checker</span> <span class="n">project:</span> <span class="n">Requiring</span> <span class="n">an</span> <span class="n">OSGi</span> <span class="n">service</span>
 
-The spell.check.gui project contains a very simple user interface (in Swing) allowing a user to interact with a *spell checker* service.
+<span class="n">The</span> <span class="n">spell</span><span class="o">.</span><span class="n">checker</span> <span class="n">project</span> <span class="n">aims</span> <span class="n">to</span> <span class="n">provide</span> <span class="n">a</span> <span class="n">_spell</span> <span class="n">checker_</span> <span class="n">service</span><span class="o">.</span> <span class="n">However</span><span class="p">,</span> <span class="n">to</span> <span class="n">serve</span> <span class="n">this</span> <span class="n">service</span><span class="p">,</span> <span class="n">this</span> <span class="n">implementation</span> <span class="n">requires</span> <span class="n">a</span> <span class="n">_dictionary_</span> <span class="n">service</span><span class="o">.</span> <span class="n">During</span> <span class="n">this</span> <span class="n">step</span><span class="p">,</span> <span class="n">we</span> <span class="n">will</span> <span class="n">create</span> <span class="n">an</
 span> <span class="n">iPOJO</span> <span class="n">component</span> <span class="n">requiring</span> <span class="n">a</span> <span class="n">Dictionary</span> <span class="n">service</span> <span class="ow">and</span> <span class="n">providing</span> <span class="n">the</span> <span class="n">Spell</span> <span class="n">Checker</span> <span class="n">service</span><span class="o">.</span>
 
-Create the "src\spell\gui\SpellCheckerGui.java" for the following implementation:
+<span class="n">First</span> <span class="n">create</span> <span class="n">the</span> <span class="n">file</span> <span class="s">&quot;src/spell/checker/SpellCheck.java&quot;</span> <span class="n">in</span> <span class="n">the</span> <span class="n">spell</span><span class="o">.</span><span class="n">checker</span> <span class="n">directory</span> <span class="k">for</span> <span class="n">the</span> <span class="n">following</span> <span class="n">_Check</span> <span class="n">Speller</span> <span class="n">service_</span> <span class="n">implementation:</span>
+<span class="p">{</span><span class="n">code:java</span><span class="p">}</span>
+<span class="nb">package</span> <span class="n">spell</span><span class="o">.</span><span class="n">checker</span><span class="p">;</span>
+<span class="nb">import</span> <span class="n">java</span><span class="o">.</span><span class="n">util</span><span class="o">.</span><span class="n">ArrayList</span><span class="p">;</span>
+<span class="nb">import</span> <span class="n">java</span><span class="o">.</span><span class="n">util</span><span class="o">.</span><span class="n">List</span><span class="p">;</span>
+<span class="nb">import</span> <span class="n">java</span><span class="o">.</span><span class="n">util</span><span class="o">.</span><span class="n">StringTokenizer</span><span class="p">;</span>
+<span class="nb">import</span> <span class="n">spell</span><span class="o">.</span><span class="n">services</span><span class="o">.</span><span class="n">DictionaryService</span><span class="p">;</span>
+<span class="nb">import</span> <span class="n">spell</span><span class="o">.</span><span class="n">services</span><span class="o">.</span><span class="n">SpellChecker</span><span class="p">;</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">SpellCheck</span> <span class="n">implements</span> <span class="n">SpellChecker</span> <span class="p">{</span>
+    <span class="n">private</span> <span class="n">DictionaryService</span> <span class="n">m_dictionary</span><span class="p">;</span>
+    <span class="o">/**</span>
+     <span class="o">*</span> <span class="n">Implements</span> <span class="n">SpellChecker</span><span class="o">.</span><span class="n">check</span><span class="p">()</span><span class="o">.</span> <span class="n">Checks</span> <span class="n">the</span> <span class="n">given</span> <span class="n">passage</span> <span class="k">for</span> <span class="n">misspelled</span> <span class="n">words</span><span class="o">.</span>
+     <span class="o">*</span> <span class="nv">@param</span> <span class="n">passage</span> <span class="n">the</span> <span class="n">passage</span> <span class="n">to</span> <span class="n">spell</span> <span class="n">check</span><span class="o">.</span>
+     <span class="o">*</span> <span class="nv">@return</span> <span class="n">An</span> <span class="n">array</span> <span class="n">of</span> <span class="n">misspelled</span> <span class="n">words</span> <span class="ow">or</span> <span class="n">null</span> <span class="k">if</span> <span class="nb">no</span> <span class="n">words</span> <span class="n">are</span> <span class="n">misspelled</span><span class="o">.</span>
+     <span class="o">*/</span>
+    <span class="n">public</span> <span class="n">String</span><span class="o">[]</span> <span class="n">check</span><span class="p">(</span><span class="n">String</span> <span class="n">passage</span><span class="p">)</span> <span class="p">{</span>
+        <span class="sr">//</span> <span class="n">No</span> <span class="n">misspelled</span> <span class="n">words</span> <span class="k">for</span> <span class="n">an</span> <span class="n">empty</span> <span class="n">string</span><span class="o">.</span>
+        <span class="k">if</span> <span class="p">((</span><span class="n">passage</span> <span class="o">==</span> <span class="n">null</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="n">passage</span><span class="o">.</span><span class="nb">length</span><span class="p">()</span> <span class="o">==</span> <span class="mi">0</span><span class="p">))</span> <span class="p">{</span> <span class="k">return</span> <span class="n">null</span><span class="p">;</span> <span class="p">}</span>
+        <span class="n">List</span> <span class="n">errorList</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ArrayList</span><span class="p">();</span>
+        <span class="sr">//</span> <span class="n">Tokenize</span> <span class="n">the</span> <span class="n">passage</span> <span class="n">using</span> <span class="n">spaces</span> <span class="ow">and</span> <span class="n">punctuation</span><span class="o">.</span>
+        <span class="n">StringTokenizer</span> <span class="n">st</span> <span class="o">=</span> <span class="k">new</span> <span class="n">StringTokenizer</span><span class="p">(</span><span class="n">passage</span><span class="p">,</span> <span class="s">&quot; ,.!?;:&quot;</span><span class="p">);</span>
+        <span class="sr">//</span> <span class="n">Loop</span> <span class="n">through</span> <span class="nb">each</span> <span class="n">word</span> <span class="n">in</span> <span class="n">the</span> <span class="n">passage</span><span class="o">.</span>
+        <span class="k">while</span> <span class="p">(</span><span class="n">st</span><span class="o">.</span><span class="n">hasMoreTokens</span><span class="p">())</span> <span class="p">{</span>
+            <span class="n">String</span> <span class="n">word</span> <span class="o">=</span> <span class="n">st</span><span class="o">.</span><span class="n">nextToken</span><span class="p">();</span>
+            <span class="sr">//</span> <span class="n">Check</span> <span class="n">the</span> <span class="n">current</span> <span class="n">word</span><span class="o">.</span>
+            <span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="n">m_dictionary</span><span class="o">.</span><span class="n">checkWord</span><span class="p">(</span><span class="n">word</span><span class="p">))</span> <span class="p">{</span>
+                <span class="sr">//</span> <span class="n">If</span> <span class="n">the</span> <span class="n">word</span> <span class="n">is</span> <span class="ow">not</span> <span class="n">correct</span><span class="p">,</span> <span class="k">then</span> <span class="n">add</span> <span class="n">it</span>
+                <span class="sr">//</span> <span class="n">to</span> <span class="n">the</span> <span class="n">incorrect</span> <span class="n">word</span> <span class="n">list</span><span class="o">.</span>
+                <span class="n">errorList</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">word</span><span class="p">);</span>
+            <span class="p">}</span>
+        <span class="p">}</span>
+        <span class="sr">//</span> <span class="n">Return</span> <span class="n">null</span> <span class="k">if</span> <span class="nb">no</span> <span class="n">words</span> <span class="n">are</span> <span class="n">incorrect</span><span class="o">.</span>
+        <span class="k">if</span> <span class="p">(</span><span class="n">errorList</span><span class="o">.</span><span class="n">size</span><span class="p">()</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="n">null</span><span class="p">;</span> <span class="p">}</span>
+        <span class="sr">//</span> <span class="n">Return</span> <span class="n">the</span> <span class="n">array</span> <span class="n">of</span> <span class="n">incorrect</span> <span class="n">words</span><span class="o">.</span>
+        <span class="k">return</span> <span class="p">(</span><span class="n">String</span><span class="o">[]</span><span class="p">)</span> <span class="n">errorList</span><span class="o">.</span><span class="n">toArray</span><span class="p">(</span><span class="k">new</span> <span class="n">String</span><span class="p">[</span><span class="n">errorList</span><span class="o">.</span><span class="n">size</span><span class="p">()]);</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>This class implements the SpellChecker service interface as it will provide it. Moreover, it has a <em>special</em> field "<em>m</em>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.</p>
+<p>Once implemented, we need to describe this component. Create the "metadata.xml" file in the spell.checker directory for the following component descriptor:</p>
+<div class="codehilite"><pre><span class="nt">&lt;ipojo&gt;</span>
+<span class="nt">&lt;component</span> <span class="na">classname=</span><span class="s">&quot;spell.checker.SpellCheck&quot;</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;requires</span> <span class="na">field=</span><span class="s">&quot;m_dictionary&quot;</span><span class="nt">/&gt;</span>
+    <span class="nt">&lt;provides/&gt;</span>
+<span class="nt">&lt;/component&gt;</span>
+<span class="nt">&lt;instance</span> <span class="na">component=</span><span class="s">&quot;spell.checker.SpellCheck&quot;</span><span class="nt">/&gt;</span>
+<span class="nt">&lt;/ipojo&gt;</span>
+</pre></div>
+
+
+<p>This description contains a '<em>requires'</em> element. This element indicates to iPOJO to manage the service dependency. The <em>field</em> attributes describe in which member of the class the service need to be injected. It is not necessary to write the required service as it is computed by iPOJO. Notice that iPOJO can inject required service by invoking methods too.</p>
+<p>Finally, we are able to build the bundle. As for previous projects, launch Ant from the project directory.</p>
+<h3 id="the-spellcheckergui-project">The spell.checker.gui project</h3>
+<p>The spell.check.gui project contains a very simple user interface (in Swing) allowing a user to interact with a <em>spell checker</em> service.</p>
+<p>Create the "src\spell\gui\SpellCheckerGui.java" for the following implementation:
 {code:java}
 package spell.gui;
 import javax.swing.JButton;
@@ -333,179 +447,180 @@ import javax.swing.JFrame;
 import javax.swing.JLabel;
 import javax.swing.JTextField;
 import spell.services.SpellChecker;
-/**
+/<strong>
  * A very simple Gui interacting with the CheckSpeller service
  */
 public class SpellCheckerGui extends JFrame {
-    /**
+    /</strong>
      * Swing component where the user write the passage to check.
      */
-    private JTextField m_passage = null;
-
-    /**
-     * Check button
-     */
-    private JButton m_checkButton = null;
-
-    /**
-     * 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[]() 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();
-    }
-}
-
-    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.
-
-    Create the _metadata.xml_ file in the spell.chercker.gui directory with the following content:
-    {code:xml}
-    <ipojo>
-    <component classname="spell.gui.SpellCheckerGui">
-        <requires field="m_checker"/>
-        <callback transition="validate" method="start"/>
-        <callback transition="invalidate" method="stop"/>
-    </component>
-    <instance component="spell.gui.SpellCheckerGui"/>
-    </ipojo>
-
-The component element again has the '*classname'* attribute that refers to the component implementation class. The '*requires*' element describes the *Check Speller* 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.
-
-Once this file is created, you can compile the project by launching *ant* in the spell.checker.gui directory.
-
-## 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.
+    private JTextField m_passage = null;</p>
+<div class="codehilite"><pre><span class="o">/**</span>
+ <span class="o">*</span> <span class="n">Check</span> <span class="n">button</span>
+ <span class="o">*/</span>
+<span class="n">private</span> <span class="n">JButton</span> <span class="n">m_checkButton</span> <span class="o">=</span> <span class="n">null</span><span class="p">;</span>
+
+<span class="o">/**</span>
+ <span class="o">*</span> <span class="n">Area</span> <span class="n">where</span> <span class="n">the</span> <span class="n">result</span> <span class="n">is</span> <span class="n">displayed</span><span class="o">.</span>
+ <span class="o">*/</span>
+<span class="n">private</span> <span class="n">JLabel</span> <span class="n">m_result</span> <span class="o">=</span> <span class="n">null</span><span class="p">;</span>
+<span class="o">/**</span>
+ <span class="o">*</span> <span class="n">Service</span> <span class="n">dependency</span> <span class="n">on</span> <span class="n">the</span> <span class="n">SpellChecker</span><span class="o">.</span>
+ <span class="o">*/</span>
+<span class="n">private</span> <span class="n">SpellChecker</span> <span class="n">m_checker</span><span class="p">;</span>
+
+<span class="o">/**</span>
+ <span class="o">*</span> <span class="n">Constructor</span><span class="o">.</span>
+ <span class="o">*</span> <span class="n">Initialize</span> <span class="n">the</span> <span class="n">GUI</span><span class="o">.</span>
+ <span class="o">*/</span>
+<span class="n">public</span> <span class="n">SpellCheckerGui</span><span class="p">()</span> <span class="p">{</span>
+    <span class="n">super</span><span class="p">();</span>
+    <span class="n">initComponents</span><span class="p">();</span>
+    <span class="n">this</span><span class="o">.</span><span class="n">setTitle</span><span class="p">(</span><span class="s">&quot;Spellchecker Gui&quot;</span><span class="p">);</span>
+<span class="p">}</span>
+<span class="o">/**</span>
+ <span class="o">*</span> <span class="n">Initialize</span> <span class="n">the</span> <span class="n">Swing</span> <span class="n">Gui</span><span class="o">.</span>
+ <span class="o">*/</span>
+<span class="n">private</span> <span class="n">void</span> <span class="n">initComponents</span><span class="p">()</span> <span class="p">{</span>
+    <span class="n">java</span><span class="o">.</span><span class="n">awt</span><span class="o">.</span><span class="n">GridBagConstraints</span> <span class="n">gridBagConstraints</span><span class="p">;</span>
+    <span class="n">m_checkButton</span> <span class="o">=</span> <span class="k">new</span> <span class="n">javax</span><span class="o">.</span><span class="n">swing</span><span class="o">.</span><span class="n">JButton</span><span class="p">();</span>
+    <span class="n">m_result</span> <span class="o">=</span> <span class="k">new</span> <span class="n">javax</span><span class="o">.</span><span class="n">swing</span><span class="o">.</span><span class="n">JLabel</span><span class="p">();</span>
+    <span class="n">m_passage</span> <span class="o">=</span> <span class="k">new</span> <span class="n">javax</span><span class="o">.</span><span class="n">swing</span><span class="o">.</span><span class="n">JTextField</span><span class="p">();</span>
+    <span class="n">setDefaultCloseOperation</span><span class="p">(</span><span class="n">javax</span><span class="o">.</span><span class="n">swing</span><span class="o">.</span><span class="n">WindowConstants</span><span class="o">.</span><span class="n">EXIT</span><span class="o">*</span><span class="n">ON</span><span class="o">*</span><span class="n">CLOSE</span><span class="p">);</span> <span class="sr">//</span><span class="n">Stop</span> <span class="n">Felix</span>
+    <span class="n">getContentPane</span><span class="p">()</span><span class="o">.</span><span class="n">setLayout</span><span class="p">(</span><span class="k">new</span> <span class="n">java</span><span class="o">.</span><span class="n">awt</span><span class="o">.</span><span class="n">GridBagLayout</span><span class="p">());</span>
+    <span class="n">m_checkButton</span><span class="o">.</span><span class="n">setText</span><span class="p">(</span><span class="s">&quot;Check&quot;</span><span class="p">);</span>
+    <span class="n">m_checkButton</span><span class="o">.</span><span class="n">addActionListener</span><span class="p">(</span><span class="k">new</span> <span class="n">java</span><span class="o">.</span><span class="n">awt</span><span class="o">.</span><span class="n">event</span><span class="o">.</span><span class="n">ActionListener</span><span class="p">()</span> <span class="p">{</span>
+        <span class="n">public</span> <span class="n">void</span> <span class="n">actionPerformed</span><span class="p">(</span><span class="n">java</span><span class="o">.</span><span class="n">awt</span><span class="o">.</span><span class="n">event</span><span class="o">.</span><span class="n">ActionEvent</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
+            <span class="n">check</span><span class="p">();</span>
+        <span class="p">}</span>
+    <span class="p">});</span>
+    <span class="n">gridBagConstraints</span> <span class="o">=</span> <span class="k">new</span> <span class="n">java</span><span class="o">.</span><span class="n">awt</span><span class="o">.</span><span class="n">GridBagConstraints</span><span class="p">();</span>
+    <span class="n">gridBagConstraints</span><span class="o">.</span><span class="n">gridx</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="n">gridBagConstraints</span><span class="o">.</span><span class="n">gridy</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
+    <span class="n">gridBagConstraints</span><span class="o">.</span><span class="n">insets</span> <span class="o">=</span> <span class="k">new</span> <span class="n">java</span><span class="o">.</span><span class="n">awt</span><span class="o">.</span><span class="n">Insets</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span>
+    <span class="n">getContentPane</span><span class="p">()</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">m_checkButton</span><span class="p">,</span> <span class="n">gridBagConstraints</span><span class="p">);</span>
+    <span class="n">m_result</span><span class="o">.</span><span class="n">setPreferredSize</span><span class="p">(</span><span class="k">new</span> <span class="n">java</span><span class="o">.</span><span class="n">awt</span><span class="o">.</span><span class="n">Dimension</span><span class="p">(</span><span class="mi">175</span><span class="p">,</span> <span class="mi">20</span><span class="p">));</span>
+    <span class="n">gridBagConstraints</span> <span class="o">=</span> <span class="k">new</span> <span class="n">java</span><span class="o">.</span><span class="n">awt</span><span class="o">.</span><span class="n">GridBagConstraints</span><span class="p">();</span>
+    <span class="n">gridBagConstraints</span><span class="o">.</span><span class="n">gridx</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="n">gridBagConstraints</span><span class="o">.</span><span class="n">gridy</span> <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
+    <span class="n">gridBagConstraints</span><span class="o">.</span><span class="n">fill</span> <span class="o">=</span> <span class="n">java</span><span class="o">.</span><span class="n">awt</span><span class="o">.</span><span class="n">GridBagConstraints</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">;</span>
+    <span class="n">gridBagConstraints</span><span class="o">.</span><span class="n">insets</span> <span class="o">=</span> <span class="k">new</span> <span class="n">java</span><span class="o">.</span><span class="n">awt</span><span class="o">.</span><span class="n">Insets</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span>
+    <span class="n">getContentPane</span><span class="p">()</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">m_result</span><span class="p">,</span> <span class="n">gridBagConstraints</span><span class="p">);</span>
+    <span class="n">m_passage</span><span class="o">.</span><span class="n">setPreferredSize</span><span class="p">(</span><span class="k">new</span> <span class="n">java</span><span class="o">.</span><span class="n">awt</span><span class="o">.</span><span class="n">Dimension</span><span class="p">(</span><span class="mi">175</span><span class="p">,</span> <span class="mi">20</span><span class="p">));</span>
+    <span class="n">gridBagConstraints</span> <span class="o">=</span> <span class="k">new</span> <span class="n">java</span><span class="o">.</span><span class="n">awt</span><span class="o">.</span><span class="n">GridBagConstraints</span><span class="p">();</span>
+    <span class="n">gridBagConstraints</span><span class="o">.</span><span class="n">gridx</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="n">gridBagConstraints</span><span class="o">.</span><span class="n">gridy</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="n">gridBagConstraints</span><span class="o">.</span><span class="n">fill</span> <span class="o">=</span> <span class="n">java</span><span class="o">.</span><span class="n">awt</span><span class="o">.</span><span class="n">GridBagConstraints</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">;</span>
+    <span class="n">gridBagConstraints</span><span class="o">.</span><span class="n">insets</span> <span class="o">=</span> <span class="k">new</span> <span class="n">java</span><span class="o">.</span><span class="n">awt</span><span class="o">.</span><span class="n">Insets</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span>
+    <span class="n">getContentPane</span><span class="p">()</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">m_passage</span><span class="p">,</span> <span class="n">gridBagConstraints</span><span class="p">);</span>
+    <span class="nb">pack</span><span class="p">();</span>
+<span class="p">}</span>
+<span class="o">/**</span>
+ <span class="o">*</span> <span class="n">Check</span> <span class="n">Button</span> <span class="n">action</span><span class="o">.</span>
+ <span class="o">*</span> <span class="n">Collects</span> <span class="n">the</span> <span class="n">user</span> <span class="n">input</span> <span class="ow">and</span> <span class="n">checks</span> <span class="n">it</span><span class="o">.</span>
+ <span class="o">*/</span>
+<span class="n">private</span> <span class="n">void</span> <span class="n">check</span><span class="p">()</span> <span class="p">{</span>
+    <span class="n">String</span><span class="o">[]</span><span class="p">()</span> <span class="n">result</span> <span class="o">=</span> <span class="n">m</span><span class="o">*</span><span class="n">checker</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">m</span><span class="o">*</span><span class="n">passage</span><span class="o">.</span><span class="n">getText</span><span class="p">());</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">result</span> <span class="o">!=</span> <span class="n">null</span><span class="p">)</span> <span class="p">{</span>
+        <span class="n">m_result</span><span class="o">.</span><span class="n">setText</span><span class="p">(</span><span class="n">result</span><span class="o">.</span><span class="nb">length</span> <span class="o">+</span> <span class="s">&quot; word(s) are mispelled&quot;</span><span class="p">);</span>
+    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+        <span class="n">m_result</span><span class="o">.</span><span class="n">setText</span><span class="p">(</span><span class="s">&quot;All words are correct&quot;</span><span class="p">);</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+<span class="o">/**</span>
+ <span class="o">*</span> <span class="n">Start</span> <span class="n">callback</span><span class="o">.</span>
+ <span class="o">*</span> <span class="n">This</span> <span class="n">method</span> <span class="n">will</span> <span class="n">be</span> <span class="n">called</span> <span class="n">when</span> <span class="n">the</span> <span class="n">instance</span> <span class="n">becomes</span> <span class="n">valid</span><span class="o">.</span>
+ <span class="o">*</span> <span class="n">It</span> <span class="n">set</span> <span class="n">the</span> <span class="n">Gui</span> <span class="n">visibility</span> <span class="n">to</span> <span class="n">true</span><span class="o">.</span>
+ <span class="o">*/</span>
+<span class="n">public</span> <span class="n">void</span> <span class="n">start</span><span class="p">()</span> <span class="p">{</span>
+    <span class="n">this</span><span class="o">.</span><span class="n">setVisible</span><span class="p">(</span><span class="n">true</span><span class="p">);</span>
+<span class="p">}</span>
+<span class="o">/**</span>
+ <span class="o">*</span> <span class="n">Stop</span> <span class="n">callback</span><span class="o">.</span>
+ <span class="o">*</span>  <span class="n">This</span> <span class="n">method</span> <span class="n">will</span> <span class="n">be</span> <span class="n">called</span> <span class="n">when</span> <span class="n">the</span> <span class="n">instance</span> <span class="n">becomes</span> <span class="n">invalid</span> <span class="ow">or</span> <span class="n">stops</span><span class="o">.</span>
+ <span class="o">*</span>  <span class="n">It</span> <span class="n">deletes</span> <span class="n">the</span> <span class="n">Gui</span><span class="o">.</span>
+ <span class="o">*/</span>
+<span class="n">public</span> <span class="n">void</span> <span class="n">stop</span><span class="p">()</span> <span class="p">{</span>
+    <span class="n">this</span><span class="o">.</span><span class="n">dispose</span><span class="p">();</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>}</p>
+<div class="codehilite"><pre><span class="n">Look</span> <span class="n">at</span> <span class="n">the</span> <span class="n">three</span> <span class="k">last</span> <span class="n">methods</span><span class="o">.</span> <span class="n">The</span> <span class="n">_check_</span> <span class="n">methods</span> <span class="n">collect</span> <span class="n">the</span> <span class="n">user</span> <span class="n">input</span> <span class="ow">and</span> <span class="k">use</span> <span class="n">a</span> <span class="n">_Check</span> <span class="n">speller_</span> <span class="n">service</span> <span class="n">to</span> <span class="n">check</span> <span class="n">this</span> <span class="n">input</span><span class="o">.</span> <span class="n">This</span> <span class="n">method</span> <span class="n">is</span> <span class="n">called</span> <span class="n">when</span> <span class="n">the</span> <span class="n">button</span> <span class="n">is</span> <span class="n">pressed</span
 > <span class="n">by</span> <span class="n">the</span> <span class="n">user</span><span class="o">.</span> <span class="n">The</span> <span class="n">_start_</span> <span class="ow">and</span> <span class="n">_stop_</span> <span class="n">methods</span> <span class="n">are</span> <span class="n">lifecycle</span> <span class="n">callbacks</span><span class="o">.</span> <span class="n">As</span> <span class="n">we</span> <span class="n">need</span> <span class="n">to</span> <span class="n">display</span> <span class="n">the</span> <span class="n">user</span> <span class="n">interface</span> <span class="n">when</span> <span class="n">the</span> <span class="n">instance</span> <span class="n">is</span> <span class="n">created</span> <span class="ow">and</span> <span class="n">to</span> <span class="nb">delete</span> <span class="n">it</span> <span class="n">when</span> <span class="n">the</span> <span class="n">instance</span> <span class="n">stops</span><span class="p">,</span
 > <span class="n">we</span> <span class="n">need</span> <span class="n">a</span> <span class="n">way</span> <span class="n">to</span> <span class="n">be</span> <span class="n">notified</span> <span class="n">when</span> <span class="n">we</span> <span class="n">need</span> <span class="n">to</span> <span class="n">execute</span> <span class="n">these</span> <span class="n">actions</span><span class="o">.</span> <span class="n">iPOJO</span> <span class="n">provide</span> <span class="n">an</span> <span class="n">easy</span> <span class="n">way</span> <span class="n">to</span> <span class="k">do</span> <span class="n">this</span><span class="o">.</span> <span class="n">The</span> <span class="n">component</span> <span class="n">provides</span> <span class="n">two</span> <span class="n">callback</span> <span class="n">methods</span> <span class="k">for</span> <span class="n">its</span> <span class="n">activation</span> <span class="ow">and</span> <span class="n">deactivation</s
 pan><span class="p">,</span> <span class="n">start</span> <span class="ow">and</span> <span class="n">stop</span><span class="p">,</span> <span class="n">respectively</span><span class="o">.</span> <span class="n">Callbacks</span> <span class="n">are</span> <span class="n">used</span> <span class="n">when</span> <span class="n">the</span> <span class="n">component</span> <span class="n">needs</span> <span class="n">to</span> <span class="n">be</span> <span class="n">informed</span> <span class="n">about</span> <span class="n">a</span> <span class="n">component</span> <span class="n">state</span> <span class="n">change</span><span class="o">.</span> <span class="n">In</span> <span class="n">iPOJO</span><span class="p">,</span> <span class="n">the</span> <span class="n">component</span> <span class="n">state</span> <span class="n">is</span> <span class="n">either</span> <span class="o">*</span><span class="n">INVALID</span><span class="o">*</span> <span class="p">(</span><span
  class="n">i</span><span class="o">.</span><span class="n">e</span><span class="o">.</span><span class="p">,</span> <span class="ow">not</span> <span class="n">all</span> <span class="n">of</span> <span class="n">the</span> <span class="n">component</span><span class="s">&#39;s constraints are satisfied) or *VALID* (i.e., all of the component&#39;</span><span class="n">s</span> <span class="n">constraints</span> <span class="n">are</span> <span class="n">satisfied</span><span class="p">)</span><span class="o">.</span> <span class="n">In</span> <span class="n">this</span> <span class="n">example</span><span class="p">,</span> <span class="n">the</span> <span class="n">start</span> <span class="n">callback</span> <span class="n">method</span> <span class="n">set</span> <span class="n">the</span> <span class="n">GUI</span> <span class="n">visibility</span> <span class="n">to</span> <span class="n">true</span><span class="p">;</span> <span class="n">the</span> <span class="n">st
 op</span> <span class="n">callback</span> <span class="n">method</span> <span class="n">deletes</span> <span class="n">the</span> <span class="n">GUI</span><span class="o">.</span> <span class="n">The</span> <span class="n">component</span> <span class="n">metadata</span> <span class="n">will</span> <span class="n">instruct</span> <span class="n">iPOJO</span> <span class="n">to</span> <span class="n">invoke</span> <span class="n">these</span> <span class="n">methods</span> <span class="n">when</span> <span class="n">the</span> <span class="n">component</span><span class="err">&#39;</span><span class="n">s</span> <span class="n">state</span> <span class="n">changes</span> <span class="n">to</span> <span class="o">*</span><span class="n">VALID</span><span class="o">*</span> <span class="ow">or</span> <span class="o">*</span><span class="n">INVALID</span><span class="o">*</span> <span class="n">respectively</span><span class="o">.</span>
+
+<span class="n">Create</span> <span class="n">the</span> <span class="n">_metadata</span><span class="o">.</span><span class="n">xml_</span> <span class="n">file</span> <span class="n">in</span> <span class="n">the</span> <span class="n">spell</span><span class="o">.</span><span class="n">chercker</span><span class="o">.</span><span class="n">gui</span> <span class="n">directory</span> <span class="n">with</span> <span class="n">the</span> <span class="n">following</span> <span class="n">content:</span>
+<span class="p">{</span><span class="n">code:xml</span><span class="p">}</span>
+<span class="sr">&lt;ipojo&gt;</span>

[... 137 lines stripped ...]


Mime
View raw message