blob: a7566f0b7f1806c34e296506328f7aea485f933b [file] [log] [blame]
Clement Escoffier6b928e92008-05-16 20:33:54 +00001
2<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<HTML>
4
Clement Escoffier83507512008-10-13 07:33:03 +00005<!-- Mirrored Site: felix.apache.org. File: /site/ipojo-in-10-minutes.html. Date: Mon, 13 Oct 2008 06:52:41 GMT -->
Clement Escoffier6b928e92008-05-16 20:33:54 +00006<HEAD>
7 <TITLE>Apache Felix - iPOJO in 10 minutes</TITLE>
Clement Escoffier83507512008-10-13 07:33:03 +00008 <LINK rel="stylesheet" href="media.data/site.css" type="text/css" media="all">
Clement Escoffier6b928e92008-05-16 20:33:54 +00009 <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
10 </HEAD>
11 <BODY>
Clement Escoffier83507512008-10-13 07:33:03 +000012 <DIV class="title"><DIV class="logo"><A href="index.html"><IMG border="0" alt="Apache Felix" src="media.data/logo.png"></A></DIV><DIV class="header"><A href="http://www.apache.org/"><IMG border="0" alt="Apache" src="media.data/apache.png"></A></DIV></DIV>
Clement Escoffier6b928e92008-05-16 20:33:54 +000013 <DIV class="menu">
14 <UL>
Clement Escoffier83507512008-10-13 07:33:03 +000015 <LI><A href="news.html" title="news">news</A></LI>
16 <LI><A href="license.html" title="license">license</A></LI>
17 <LI><SPAN class="nobr"><A href="downloads.html" title="Visit page outside Confluence" rel="nofollow">downloads<SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
18 <LI><A href="documentation.html" title="documentation">documentation</A></LI>
19 <LI><A href="mailinglists.html" title="mailinglists">mailing lists</A></LI>
20 <LI><A href="contributing.html" title="Contributing">contributing</A></LI>
21 <LI><SPAN class="nobr"><A href="http://www.apache.org/" title="Visit page outside Confluence" rel="nofollow">asf<SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
22 <LI><SPAN class="nobr"><A href="http://www.apache.org/foundation/sponsorship.html" title="Visit page outside Confluence" rel="nofollow">sponsorship<SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
23 <LI><SPAN class="nobr"><A href="http://www.apache.org/foundation/thanks.html" title="Visit page outside Confluence" rel="nofollow">sponsors<SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>
Clement Escoffier6b928e92008-05-16 20:33:54 +000024<!-- ApacheCon Ad -->
25<IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
26<P style="height: 100px">
27<!-- ApacheCon Ad --></LI>
28</UL>
Clement Escoffier83507512008-10-13 07:33:03 +000029 </DIV>
Clement Escoffier6b928e92008-05-16 20:33:54 +000030 <DIV class="main">
31<TABLE class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR>
32<TD class="confluenceTd" valign="top" width="80%">
33<H1><A name="iPOJOin10minutes-iPOJOin10minutes"></A>iPOJO in 10 minutes</H1>
34
35<P><EM>This page presents how to use the</EM> <EM>iPOJO</EM> <EM>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.</EM></P>
36
37<H2><A name="iPOJOin10minutes-Introduction"></A>Introduction</H2>
38
39<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 with the main goal being to simplify 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., the POJO) from the non-functional code (i.e., dependency management, service provision, configuration, etc.). iPOJO combines the functional and non-functional aspects at run time. To achieve this, iPOJO provides a simple and extensible service component model based on POJOs.</P>
40
41<H2><A name="iPOJOin10minutes-ThePOJOconcept"></A>The POJO concept</H2>
42
43<P>POJO is 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: &quot;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.&quot; From the developer's perspective, the iPOJO framework strives to only require POJOs in as much as it is possible.</P>
44
45<H2><A name="iPOJOin10minutes-iPOJOservicecomponentoverview"></A>iPOJO service component overview</H2>
46
47<P>A service component is able to provide and/or require services, where a service is an object that implements a given service interface embodied as a Java interface. In addition, iPOJO introduces a callback concept to notify a component about various state changes.</P>
48
49<P>The component is the 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. Then, the second important concept in iPOJO is component instances. A component instances is a special <EM>version</EM> of the component. By merging component metadata and instance configuration, the iPOJO runtime is able to manage the component, i.e., manage its life cycle, inject required services, publish provided services, discover needed services.</P>
50
51<H2><A name="iPOJOin10minutes-Asimpleexample"></A>A simple example</H2>
52
53<P>In this tutorial we will present how to:</P>
54<UL>
55 <LI>Publish an OSGi service</LI>
56 <LI>Require an OSGi service</LI>
57 <LI>Use lifecycle callbacks to activate and deactivate components</LI>
58</UL>
59
60
61<H3><A name="iPOJOin10minutes-PresentationoftheSpellapplication"></A>Presentation of the <EM>Spell</EM> application</H3>
62
63<P>To illustrate iPOJO features, we will implement a very simple application. This application is composed by three components:</P>
64<UL>
65 <LI>A component implementing a dictionary service</LI>
66 <LI>A component requiring the dictionary service and providing a spellchecker service</LI>
67 <LI>A component requiring the spellchecker and providing an user interface</LI>
68</UL>
69
70
Clement Escoffier83507512008-10-13 07:33:03 +000071<P><IMG src="ipojo-in-10-minutes.data/spell.png" align="absmiddle" border="0"></P>
Clement Escoffier6b928e92008-05-16 20:33:54 +000072
73<H3><A name="iPOJOin10minutes-Preparingthetutorial"></A>Preparing the tutorial</H3>
74
Clement Escoffier83507512008-10-13 07:33:03 +000075<P>This tutorial is based on Ant. So, you need to have the Ant program accessible in your path (see <SPAN class="nobr"><A href="http://ant.apache.org/" title="Visit page outside Confluence" rel="nofollow">here<SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN> to download and install Ant). Download the tutorial archive available <SPAN class="nobr"><A href="../../people.apache.org/_clement/ipojo/tutorials/10min/tutorial.zip" title="Visit page outside Confluence" rel="nofollow">here<SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN> and then unzip it. The archive is composed by seven directories:</P>
Clement Escoffier6b928e92008-05-16 20:33:54 +000076<UL>
77 <LI>spell.services contains service interfaces used by the applications</LI>
78 <LI>spell.english contains an implementation of the Dictionary service (containing English words)</LI>
79 <LI>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).</LI>
80 <LI>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.</LI>
81 <LI>The task directory contains Ant tasks used to build the project</LI>
82 <LI>The solution directory contains an already developed version of the application.</LI>
83 <LI>Finally, the felix folder contains a configured version of the Felix runtime</LI>
84</UL>
85
86
87<H3><A name="iPOJOin10minutes-Thespell.servicesproject"></A>The spell.services project</H3>
88
89<P>The spell.services project contains only service interfaces. It is not an iPOJO powered bundle.</P>
90
91<P>Go inside the Spell.services directory and create the file &quot;src/spell/services/DictionaryService.java&quot; for the following <EM>Dictionary</EM> service interface:</P>
92<DIV class="code"><DIV class="codeContent">
93<PRE class="code-java"><SPAN class="code-keyword">package</SPAN> spell.services;
94/**
95 * A simple service <SPAN class="code-keyword">interface</SPAN> that defines a dictionary service.
96 * A dictionary service simply verifies the existence of a word.
97**/
98<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">interface</SPAN> DictionaryService {
99 /**
100 * Check <SPAN class="code-keyword">for</SPAN> the existence of a word.
101 * @param word the word to be checked.
102 * @<SPAN class="code-keyword">return</SPAN> <SPAN class="code-keyword">true</SPAN> <SPAN class="code-keyword">if</SPAN> the word is in the dictionary,
103 * <SPAN class="code-keyword">false</SPAN> otherwise.
104 **/
105 <SPAN class="code-keyword">public</SPAN> <SPAN class="code-object">boolean</SPAN> checkWord(<SPAN class="code-object">String</SPAN> word);
106}</PRE>
107</DIV></DIV>
108<P>Then, create the file &quot;src/spell/services/SpellChecker.java&quot; for the following <EM>Spell Checker</EM> service interface:</P>
109<DIV class="code"><DIV class="codeContent">
110<PRE class="code-java"><SPAN class="code-keyword">package</SPAN> spell.services;
111/**
112 * A simple service <SPAN class="code-keyword">interface</SPAN> that defines a spell checker service.
113 * A spell checker service checks the spelling of all words in a
114 * given passage. A passage is any number of words separated by
115 * a space character and the following punctuation marks: comma,
116 * period, exclamation mark, question mark, semi-colon, and colon.
117**/
118<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">interface</SPAN> SpellChecker {
119 /**
120 * Checks a given passage <SPAN class="code-keyword">for</SPAN> spelling errors. A passage is any
121 * number of words separated by a space and any of the following
122 * punctuation marks: comma (,), period (.), exclamation mark (!),
123 * question mark (?), semi-colon (;), and colon(:).
124 * @param passage the passage to spell check.
125 * @<SPAN class="code-keyword">return</SPAN> An array of misspelled words or <SPAN class="code-keyword">null</SPAN> <SPAN class="code-keyword">if</SPAN> no
126 * words are misspelled.
127 **/
128 <SPAN class="code-keyword">public</SPAN> <SPAN class="code-object">String</SPAN>[] check(<SPAN class="code-object">String</SPAN> passage);
129}</PRE>
130</DIV></DIV>
131<P>Once created, you can build the project by launching Ant from the project directory.</P>
132<DIV class="code"><DIV class="codeContent">
133<PRE class="code-java">$ ant
134Buildfile: build.xml
135clean:
136compile:
Clement Escoffier83507512008-10-13 07:33:03 +0000137 [mkdir] Created dir: d:\clement\workspaces\sandbox\ipojo\examples\tutorial-ant\
138 spell.services\output
139 [mkdir] Created dir: d:\clement\workspaces\sandbox\ipojo\examples\tutorial-ant\
140 spell.services\output\classes
141 [javac] Compiling 2 source files to d:\clement\workspaces\sandbox\ipojo\examples\
142 tutorial-ant\spell.services\output\classes
Clement Escoffier6b928e92008-05-16 20:33:54 +0000143<SPAN class="code-keyword">package</SPAN>:
144 [bnd] spell.services 2
145BUILD SUCCESSFUL
146Total time: 0 seconds</PRE>
147</DIV></DIV>
Clement Escoffier83507512008-10-13 07:33:03 +0000148<P>The created bundle is inside the output directory (spell.services.jar). The build process use <SPAN class="nobr"><A href="http://www.aqute.biz/Code/Bnd" title="Visit page outside Confluence" rel="nofollow">BND<SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>. The bundle manifest is described in the spell.services.bnd file.<BR>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000149Once this project is done, we are able to implement a Dictionary service.</P>
150
151<H3><A name="iPOJOin10minutes-Thespell.englishproject%3AProvidinganOSGiservice"></A>The spell.english project: Providing an OSGi service</H3>
152
153<P>The spell.english project is a simple dictionary implementation of the Dictionary service. It contains few English words. This implementation is an iPOJO component.<BR>
Clement Escoffier83507512008-10-13 07:33:03 +0000154The first step is to implement the service. Create the &quot;src/spell/english/EnglishDictionary.java&quot; file for the following <EM>Dictionary service</EM> implementation:</P>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000155<DIV class="code"><DIV class="codeContent">
156<PRE class="code-java"><SPAN class="code-keyword">package</SPAN> spell.english;
157<SPAN class="code-keyword">import</SPAN> spell.services.DictionaryService;
158/**
159 * An implementation of the Dictionary service containing English words
160 * see DictionaryService <SPAN class="code-keyword">for</SPAN> details of the service.
161 **/
162<SPAN class="code-keyword">public</SPAN> class EnglishDictionary <SPAN class="code-keyword">implements</SPAN> DictionaryService {
163 <SPAN class="code-comment">// The set of words contained in the dictionary.
164</SPAN> <SPAN class="code-object">String</SPAN>[] m_dictionary = { <SPAN class="code-quote">&quot;welcome&quot;</SPAN>, <SPAN class="code-quote">&quot;to&quot;</SPAN>, <SPAN class="code-quote">&quot;the&quot;</SPAN>, <SPAN class="code-quote">&quot;ipojo&quot;</SPAN>, <SPAN class="code-quote">&quot;tutorial&quot;</SPAN> };
165 /**
166 * Implements DictionaryService.checkWord(). Determines
167 * <SPAN class="code-keyword">if</SPAN> the passed in word is contained in the dictionary.
168 * @param word the word to be checked.
169 * @<SPAN class="code-keyword">return</SPAN> <SPAN class="code-keyword">true</SPAN> <SPAN class="code-keyword">if</SPAN> the word is in the dictionary,
170 * <SPAN class="code-keyword">false</SPAN> otherwise.
171 **/
172 <SPAN class="code-keyword">public</SPAN> <SPAN class="code-object">boolean</SPAN> checkWord(<SPAN class="code-object">String</SPAN> word) {
173 word = word.toLowerCase();
174 <SPAN class="code-comment">// This is very inefficient
175</SPAN> <SPAN class="code-keyword">for</SPAN> (<SPAN class="code-object">int</SPAN> i = 0; i &lt; m_dictionary.length; i++) {
176 <SPAN class="code-keyword">if</SPAN> (m_dictionary[i].equals(word)) {
177 <SPAN class="code-keyword">return</SPAN> <SPAN class="code-keyword">true</SPAN>;
178 }
179 }
180 <SPAN class="code-keyword">return</SPAN> <SPAN class="code-keyword">false</SPAN>;
181 }
182}</PRE>
183</DIV></DIV>
184<P>Notice that this class does not contains neither OSGi nor iPOJO specific code. It is just an implementation of the Dictionary Service interface.<BR>
185Once created, we need to describe this component to ask iPOJO to manage it. To achieve this, create the &quot;metadata.xml&quot; file in the spell.english directory:</P>
186<DIV class="code"><DIV class="codeContent">
187<PRE class="code-xml"><SPAN class="code-tag">&lt;ipojo&gt;</SPAN>
188<SPAN class="code-tag">&lt;component classname=<SPAN class="code-quote">&quot;spell.english.EnglishDictionary&quot;</SPAN>&gt;</SPAN>
189 <SPAN class="code-tag">&lt;provides/&gt;</SPAN>
190<SPAN class="code-tag">&lt;/component&gt;</SPAN>
191<SPAN class="code-tag">&lt;instance component=<SPAN class="code-quote">&quot;spell.english.EnglishDictionary&quot;</SPAN>/&gt;</SPAN>
192<SPAN class="code-tag">&lt;/ipojo&gt;</SPAN></PRE>
193</DIV></DIV>
Clement Escoffier83507512008-10-13 07:33:03 +0000194<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>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000195
196<P>Then, we are able to create the bundle. In the spell.english directory launch the ant command:</P>
197<DIV class="code"><DIV class="codeContent">
198<PRE class="code-java">$ ant
199Buildfile: build.xml
200clean:
Clement Escoffier83507512008-10-13 07:33:03 +0000201 [delete] Deleting directory d:\clement\workspaces\sandbox\ipojo\examples\
202 tutorial-ant\spell.english\output\classes
203 [delete] Deleting directory d:\clement\workspaces\sandbox\ipojo\examples\
204 tutorial-ant\spell.english\output
Clement Escoffier6b928e92008-05-16 20:33:54 +0000205buildclasspath:
206compile:
Clement Escoffier83507512008-10-13 07:33:03 +0000207 [mkdir] Created dir: d:\clement\workspaces\sandbox\ipojo\examples\
208 tutorial-ant\spell.english\output
209 [mkdir] Created dir: d:\clement\workspaces\sandbox\ipojo\examples\
210 tutorial-ant\spell.english\output\classes
211 [javac] Compiling 1 source file to d:\clement\workspaces\sandbox\ipojo\examples\
212 tutorial-ant\spell.english\output\classes
Clement Escoffier6b928e92008-05-16 20:33:54 +0000213<SPAN class="code-keyword">package</SPAN>:
214 [bnd] spell.english 1
Clement Escoffier83507512008-10-13 07:33:03 +0000215 [ipojo] Input Bundle File : d:\clement\workspaces\sandbox\ipojo\examples\
216 tutorial-ant\spell.english\output\spell.english.jar
217 [ipojo] Metadata File : d:\clement\workspaces\sandbox\ipojo\examples\
218 tutorial-ant\spell.english\metadata.xml
Clement Escoffier6b928e92008-05-16 20:33:54 +0000219 [ipojo] Start bundle manipulation
220 [ipojo] Bundle manipulation - SUCCESS
Clement Escoffier83507512008-10-13 07:33:03 +0000221 [ipojo] Output File : d:\clement\workspaces\sandbox\ipojo\examples\
222 tutorial-ant\spell.english\output\spell.english.jar
Clement Escoffier6b928e92008-05-16 20:33:54 +0000223BUILD SUCCESSFUL
224Total time: 1 second</PRE>
225</DIV></DIV>
226<P>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.</P>
227
228<H3><A name="iPOJOin10minutes-Thespell.checkerproject%3ARequiringanOSGiservice"></A>The spell.checker project: Requiring an OSGi service</H3>
229
Clement Escoffier83507512008-10-13 07:33:03 +0000230<P>The spell.checker project aims to provide a <EM>spell checker</EM> service. However, to serve this service, this implementation requires a <EM>dictionary</EM> service. During this step, we will create an iPOJO component requiring a Dictionary service and providing the Spell Checker service.</P>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000231
Clement Escoffier83507512008-10-13 07:33:03 +0000232<P>First create the file &quot;src/spell/checker/SpellCheck.java&quot; in the spell.checker directory for the following <EM>Check Speller service</EM> implementation:</P>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000233<DIV class="code"><DIV class="codeContent">
Clement Escoffier83507512008-10-13 07:33:03 +0000234<PRE class="code-java"><SPAN class="code-keyword">package</SPAN> spell.checker;
Clement Escoffier6b928e92008-05-16 20:33:54 +0000235<SPAN class="code-keyword">import</SPAN> java.util.ArrayList;
236<SPAN class="code-keyword">import</SPAN> java.util.List;
237<SPAN class="code-keyword">import</SPAN> java.util.StringTokenizer;
238<SPAN class="code-keyword">import</SPAN> spell.services.DictionaryService;
239<SPAN class="code-keyword">import</SPAN> spell.services.SpellChecker;
240<SPAN class="code-keyword">public</SPAN> class SpellCheck <SPAN class="code-keyword">implements</SPAN> SpellChecker {
241 <SPAN class="code-keyword">private</SPAN> DictionaryService m_dictionary;
242 /**
243 * Implements SpellChecker.check(). Checks the given passage <SPAN class="code-keyword">for</SPAN> misspelled words.
244 * @param passage the passage to spell check.
245 * @<SPAN class="code-keyword">return</SPAN> An array of misspelled words or <SPAN class="code-keyword">null</SPAN> <SPAN class="code-keyword">if</SPAN> no words are misspelled.
246 */
247 <SPAN class="code-keyword">public</SPAN> <SPAN class="code-object">String</SPAN>[] check(<SPAN class="code-object">String</SPAN> passage) {
248 <SPAN class="code-comment">// No misspelled words <SPAN class="code-keyword">for</SPAN> an empty string.
249</SPAN> <SPAN class="code-keyword">if</SPAN> ((passage == <SPAN class="code-keyword">null</SPAN>) || (passage.length() == 0)) { <SPAN class="code-keyword">return</SPAN> <SPAN class="code-keyword">null</SPAN>; }
250 List errorList = <SPAN class="code-keyword">new</SPAN> ArrayList();
251 <SPAN class="code-comment">// Tokenize the passage using spaces and punctuation.
252</SPAN> StringTokenizer st = <SPAN class="code-keyword">new</SPAN> StringTokenizer(passage, <SPAN class="code-quote">&quot; ,.!?;:&quot;</SPAN>);
253 <SPAN class="code-comment">// Loop through each word in the passage.
254</SPAN> <SPAN class="code-keyword">while</SPAN> (st.hasMoreTokens()) {
255 <SPAN class="code-object">String</SPAN> word = st.nextToken();
256 <SPAN class="code-comment">// Check the current word.
257</SPAN> <SPAN class="code-keyword">if</SPAN> (! m_dictionary.checkWord(word)) {
258 <SPAN class="code-comment">// If the word is not correct, then add it
259</SPAN> <SPAN class="code-comment">// to the incorrect word list.
260</SPAN> errorList.add(word);
261 }
262 }
263 <SPAN class="code-comment">// Return <SPAN class="code-keyword">null</SPAN> <SPAN class="code-keyword">if</SPAN> no words are incorrect.
264</SPAN> <SPAN class="code-keyword">if</SPAN> (errorList.size() == 0) { <SPAN class="code-keyword">return</SPAN> <SPAN class="code-keyword">null</SPAN>; }
265 <SPAN class="code-comment">// Return the array of incorrect words.
266</SPAN> <SPAN class="code-keyword">return</SPAN> (<SPAN class="code-object">String</SPAN>[]) errorList.toArray(<SPAN class="code-keyword">new</SPAN> <SPAN class="code-object">String</SPAN>[errorList.size()]);
267 }
268}</PRE>
269</DIV></DIV>
270<P>This class implements the SpellChecker service interface as it will provide it. Moreover, it has a <EM>special</EM> field &quot;_m_dictionary_&quot;. 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>
271
272<P>Once implemented, we need to describe this component. Create the &quot;metadata.xml&quot; file in the spell.checker directory for the following component descriptor:</P>
273<DIV class="code"><DIV class="codeContent">
274<PRE class="code-xml"><SPAN class="code-tag">&lt;ipojo&gt;</SPAN>
Clement Escoffier83507512008-10-13 07:33:03 +0000275<SPAN class="code-tag">&lt;component classname=<SPAN class="code-quote">&quot;spell.checker.SpellCheck&quot;</SPAN>&gt;</SPAN>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000276 <SPAN class="code-tag">&lt;requires field=<SPAN class="code-quote">&quot;m_dictionary&quot;</SPAN>/&gt;</SPAN>
277 <SPAN class="code-tag">&lt;provides/&gt;</SPAN>
278<SPAN class="code-tag">&lt;/component&gt;</SPAN>
Clement Escoffier83507512008-10-13 07:33:03 +0000279<SPAN class="code-tag">&lt;instance component=<SPAN class="code-quote">&quot;spell.checker.SpellCheck&quot;</SPAN>/&gt;</SPAN>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000280<SPAN class="code-tag">&lt;/ipojo&gt;</SPAN></PRE>
281</DIV></DIV>
282<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>
283
284<P>Finally, we are able to build the bundle. As for previous projects, launch Ant from the project directory.</P>
285
Clement Escoffier83507512008-10-13 07:33:03 +0000286<H3><A name="iPOJOin10minutes-Thespell.checker.guiproject"></A>The spell.checker.gui project</H3>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000287
288<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>
289
290<P>Create the &quot;src\spell\gui\SpellCheckerGui.java&quot; for the following implementation:</P>
291<DIV class="code"><DIV class="codeContent">
292<PRE class="code-java"><SPAN class="code-keyword">package</SPAN> spell.gui;
293<SPAN class="code-keyword">import</SPAN> javax.swing.JButton;
294<SPAN class="code-keyword">import</SPAN> javax.swing.JFrame;
295<SPAN class="code-keyword">import</SPAN> javax.swing.JLabel;
296<SPAN class="code-keyword">import</SPAN> javax.swing.JTextField;
297<SPAN class="code-keyword">import</SPAN> spell.services.SpellChecker;
298/**
299 * A very simple Gui interacting with the CheckSpeller service
300 */
301<SPAN class="code-keyword">public</SPAN> class SpellCheckerGui <SPAN class="code-keyword">extends</SPAN> JFrame {
302 /**
303 * Swing component where the user write the passage to check.
304 */
305 <SPAN class="code-keyword">private</SPAN> JTextField m_passage = <SPAN class="code-keyword">null</SPAN>;
306
307 /**
308 * Check button
309 */
310 <SPAN class="code-keyword">private</SPAN> JButton m_checkButton = <SPAN class="code-keyword">null</SPAN>;
311
312 /**
313 * Area where the result is displayed.
314 */
315 <SPAN class="code-keyword">private</SPAN> JLabel m_result = <SPAN class="code-keyword">null</SPAN>;
316 /**
317 * Service dependency on the SpellChecker.
318 */
319 <SPAN class="code-keyword">private</SPAN> SpellChecker m_checker;
320
321 /**
322 * Constructor.
323 * Initialize the GUI.
324 */
325 <SPAN class="code-keyword">public</SPAN> SpellCheckerGui() {
326 <SPAN class="code-keyword">super</SPAN>();
327 initComponents();
328 <SPAN class="code-keyword">this</SPAN>.setTitle(<SPAN class="code-quote">&quot;Spellchecker Gui&quot;</SPAN>);
329 }
330 /**
331 * Initialize the Swing Gui.
332 */
333 <SPAN class="code-keyword">private</SPAN> void initComponents() {
334 java.awt.GridBagConstraints gridBagConstraints;
335 m_checkButton = <SPAN class="code-keyword">new</SPAN> javax.swing.JButton();
336 m_result = <SPAN class="code-keyword">new</SPAN> javax.swing.JLabel();
337 m_passage = <SPAN class="code-keyword">new</SPAN> javax.swing.JTextField();
Clement Escoffier83507512008-10-13 07:33:03 +0000338 setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); <SPAN class="code-comment">//Stop Felix
339</SPAN> getContentPane().setLayout(<SPAN class="code-keyword">new</SPAN> java.awt.GridBagLayout());
Clement Escoffier6b928e92008-05-16 20:33:54 +0000340 m_checkButton.setText(<SPAN class="code-quote">&quot;Check&quot;</SPAN>);
341 m_checkButton.addActionListener(<SPAN class="code-keyword">new</SPAN> java.awt.event.ActionListener() {
342 <SPAN class="code-keyword">public</SPAN> void actionPerformed(java.awt.event.ActionEvent e) {
343 check();
344 }
345 });
346 gridBagConstraints = <SPAN class="code-keyword">new</SPAN> java.awt.GridBagConstraints();
347 gridBagConstraints.gridx = 0;
348 gridBagConstraints.gridy = 1;
349 gridBagConstraints.insets = <SPAN class="code-keyword">new</SPAN> java.awt.Insets(2, 2, 2, 2);
350 getContentPane().add(m_checkButton, gridBagConstraints);
351 m_result.setPreferredSize(<SPAN class="code-keyword">new</SPAN> java.awt.Dimension(175, 20));
352 gridBagConstraints = <SPAN class="code-keyword">new</SPAN> java.awt.GridBagConstraints();
353 gridBagConstraints.gridx = 0;
354 gridBagConstraints.gridy = 2;
355 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
356 gridBagConstraints.insets = <SPAN class="code-keyword">new</SPAN> java.awt.Insets(2, 2, 2, 2);
357 getContentPane().add(m_result, gridBagConstraints);
358 m_passage.setPreferredSize(<SPAN class="code-keyword">new</SPAN> java.awt.Dimension(175, 20));
359 gridBagConstraints = <SPAN class="code-keyword">new</SPAN> java.awt.GridBagConstraints();
360 gridBagConstraints.gridx = 0;
361 gridBagConstraints.gridy = 0;
362 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
363 gridBagConstraints.insets = <SPAN class="code-keyword">new</SPAN> java.awt.Insets(2, 2, 2, 2);
364 getContentPane().add(m_passage, gridBagConstraints);
365 pack();
366 }
367 /**
368 * Check Button action.
369 * Collects the user input and checks it.
370 */
371 <SPAN class="code-keyword">private</SPAN> void check() {
372 <SPAN class="code-object">String</SPAN>[] result = m_checker.check(m_passage.getText());
373 <SPAN class="code-keyword">if</SPAN> (result != <SPAN class="code-keyword">null</SPAN>) {
374 m_result.setText(result.length + <SPAN class="code-quote">&quot; word(s) are mispelled&quot;</SPAN>);
375 } <SPAN class="code-keyword">else</SPAN> {
376 m_result.setText(<SPAN class="code-quote">&quot;All words are correct&quot;</SPAN>);
377 }
378 }
379 /**
380 * Start callback.
381 * This method will be called when the instance becomes valid.
382 * It set the Gui visibility to <SPAN class="code-keyword">true</SPAN>.
383 */
384 <SPAN class="code-keyword">public</SPAN> void start() {
385 <SPAN class="code-keyword">this</SPAN>.setVisible(<SPAN class="code-keyword">true</SPAN>);
386 }
387 /**
388 * Stop callback.
389 * This method will be called when the instance becomes invalid or stops.
390 * It deletes the Gui.
391 */
392 <SPAN class="code-keyword">public</SPAN> void stop() {
393 <SPAN class="code-keyword">this</SPAN>.dispose();
394 }
395}</PRE>
396</DIV></DIV>
397<P>Look at the three last methods. The <EM>check</EM> methods collect the user input and use a <EM>Check speller</EM> service to check this input. This method is called when the button is pressed by the user. The <EM>start</EM> and <EM>stop</EM> 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 <B>INVALID</B> (i.e., not all of the component's constraints are satisfied) or <B>VALID</B> (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 will instruct iPOJO to invoke these methods when the component's state changes to <B>VALID</B> or <B>INVALID</B> respectively.</P>
398
399<P>Create the <EM>metadata.xml</EM> file in the spell.chercker.gui directory with the following content:</P>
400<DIV class="code"><DIV class="codeContent">
401<PRE class="code-xml"><SPAN class="code-tag">&lt;ipojo&gt;</SPAN>
402<SPAN class="code-tag">&lt;component classname=<SPAN class="code-quote">&quot;spell.gui.SpellCheckerGui&quot;</SPAN>&gt;</SPAN>
403 <SPAN class="code-tag">&lt;requires field=<SPAN class="code-quote">&quot;m_checker&quot;</SPAN>/&gt;</SPAN>
404 <SPAN class="code-tag">&lt;callback transition=<SPAN class="code-quote">&quot;validate&quot;</SPAN> method=<SPAN class="code-quote">&quot;start&quot;</SPAN>/&gt;</SPAN>
405 <SPAN class="code-tag">&lt;callback transition=<SPAN class="code-quote">&quot;invalidate&quot;</SPAN> method=<SPAN class="code-quote">&quot;stop&quot;</SPAN>/&gt;</SPAN>
406<SPAN class="code-tag">&lt;/component&gt;</SPAN>
407<SPAN class="code-tag">&lt;instance component=<SPAN class="code-quote">&quot;spell.gui.SpellCheckerGui&quot;</SPAN>/&gt;</SPAN>
408<SPAN class="code-tag">&lt;/ipojo&gt;</SPAN></PRE>
409</DIV></DIV>
410<P>The component element again has the '<EM>classname'</EM> attribute that refers to the component implementation class. The '<EM>requires</EM>' element describes the <EM>Check Speller</EM> service dependency by simply specifying its associated component field. The '<EM>callback'</EM> elements describe which method to invoke when the component's state changes. Then the <EM>'instance'</EM> element asks iPOJO to create an instance of the component.</P>
411
412<P>Once this file is created, you can compile the project by launching <EM>ant</EM> in the spell.checker.gui directory.</P>
413
414<H2><A name="iPOJOin10minutes-Runningtheapplication"></A>Running the application</H2>
415
416<P>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.</P>
417<DIV class="code"><DIV class="codeContent">
418<PRE class="code-java">java -jar bin/felix.jar</PRE>
419</DIV></DIV>
Clement Escoffier83507512008-10-13 07:33:03 +0000420<P>You can check installed bundles by using the '<EM>ps</EM>' command:</P>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000421<DIV class="code"><DIV class="codeContent">
422<PRE class="code-java">-&gt; ps
423START LEVEL 1
424 ID State Level Name
425[ 0] [Active ] [ 0] <SPAN class="code-object">System</SPAN> Bundle (1.0.3)
426[ 1] [Active ] [ 1] Apache Felix Shell Service (1.0.0)
427[ 2] [Active ] [ 1] Apache Felix Shell TUI (1.0.0)
428[ 3] [Active ] [ 1] Apache Felix Bundle Repository (1.0.2)
Clement Escoffier83507512008-10-13 07:33:03 +0000429[ 4] [Active ] [ 1] iPOJO (0.8.0)
Clement Escoffier6b928e92008-05-16 20:33:54 +0000430-&gt;</PRE>
431</DIV></DIV>
432<P>iPOJO runtime is the bundle 4. Once started, install the four created bundles as above:</P>
433<DIV class="code"><DIV class="codeContent">
434<PRE class="code-java">start file:../spell.services/output/spell.services.jar
435start file:../spell.english/output/spell.english.jar
436start file:../spell.checker/output/spell.checker.jar
437start file:../spell.checker.gui/output/spell.checker.gui.jar</PRE>
438</DIV></DIV>
439<P>When starting the GUI bundle, the user interface appears. Indeed, the <EM>Check Speller</EM> service is provided. You can interact with this service by entering a passage and clicking on the check button:<BR>
Clement Escoffier83507512008-10-13 07:33:03 +0000440<IMG src="ipojo-in-10-minutes.data/ss.png" align="absmiddle" border="0"><BR>
441Then, stop the <EM>Dictionary</EM> service provider (with the <EM>stop 6</EM>) command. The GUI disappears. Indeed, Spell Checker service cannot be provided as it depends on the Dictionary service.<BR>
442<IMG src="ipojo-in-10-minutes.data/spell2.png" align="absmiddle" border="0"><BR>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000443Then, restart the Dictionary service provider with the <EM>start 6</EM> command. The GUI reappears immediately. You can try to stop the <EM>check speller</EM> service provider without stopping the <EM>dictionary</EM> service provider with the <EM>stop 7</EM> command. As for the last manipulation, the GUI disappears.<BR>
Clement Escoffier83507512008-10-13 07:33:03 +0000444<IMG src="ipojo-in-10-minutes.data/spell3.png" align="absmiddle" border="0"><BR>
445To go further in the exploration, modify the spell.cheker implementation. For example, add a simple trace, printing wrong words:</P>
446<DIV class="code"><DIV class="codeContent">
447<PRE class="code-java"><SPAN class="code-comment">// ...
448</SPAN> <SPAN class="code-comment">// Return <SPAN class="code-keyword">null</SPAN> <SPAN class="code-keyword">if</SPAN> no words are incorrect.
449</SPAN> <SPAN class="code-keyword">if</SPAN> (errorList.size() == 0) { <SPAN class="code-keyword">return</SPAN> <SPAN class="code-keyword">null</SPAN>; }
450
451 <SPAN class="code-comment">// Return the array of incorrect words.
452</SPAN> <SPAN class="code-object">System</SPAN>.out.println(<SPAN class="code-quote">&quot;Wrong words:&quot;</SPAN> + errorList); <SPAN class="code-comment">// &lt;-- Add <SPAN class="code-keyword">this</SPAN> line
453</SPAN> <SPAN class="code-keyword">return</SPAN> (<SPAN class="code-object">String</SPAN>[]) errorList.toArray(<SPAN class="code-keyword">new</SPAN> <SPAN class="code-object">String</SPAN>[errorList.size()]);</PRE>
454</DIV></DIV>
455
456<P>Then rebuild the spell.checker bundle and update it (with the 'update 7' command). You will see the gui &quot;blinking&quot;. 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.<BR>
457You can uninstall the check service bundle and then re-install a new one (or the same one), you will see the same behavior. </P>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000458
459<H2><A name="iPOJOin10minutes-Conclusion"></A>Conclusion</H2>
460
461<P>We saw how to use easily iPOJO to build service-oriented component. In this tutorial, we have demonstrated how to:</P>
462<UL>
463 <LI>Publish OSGi services</LI>
464 <LI>Require OSGi services</LI>
465 <LI>Use lifecycle callbacks to activate and deactivate components</LI>
466</UL>
467
468
Clement Escoffier83507512008-10-13 07:33:03 +0000469<P>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 <SPAN class="nobr"><A href="mailto:users-subscribe@felix.apache.org" title="Send mail to users-subscribe@felix.apache.org" rel="nofollow">users-subscribe@felix.apache.org<SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/mail_small.gif" height="12" width="13" align="absmiddle" alt="" border="0"></SUP></A></SPAN>; after subscribing, email questions or feedback to <SPAN class="nobr"><A href="mailto:users@felix.apache.org" title="Send mail to users@felix.apache.org" rel="nofollow">users@felix.apache.org<SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/mail_small.gif" height="12" width="13" align="absmiddle" alt="" border="0"></SUP></A></SPAN>.</P>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000470</TD>
471<TD class="confluenceTd" valign="top" width="20%">
472<H6><A name="iPOJOin10minutes-Overview"></A><B>Overview</B></H6>
473<UL>
Clement Escoffier83507512008-10-13 07:33:03 +0000474 <LI><A href="apache-felix-ipojo.html" title="Apache Felix iPOJO">Home Page</A></LI>
475 <LI><A href="apache-felix-ipojo-feature-overview.html" title="Apache Felix iPOJO Feature Overview">iPOJO Feature Overview</A></LI>
476 <LI><A href="download.html" title="Download">Download &amp; Install </A></LI>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000477</UL>
478
479
480<H6><A name="iPOJOin10minutes-GettingStarted"></A><B>Getting Started</B></H6>
481<UL>
482 <LI><A href="#" title="iPOJO in 10 minutes">iPOJO in 10 minutes</A></LI>
Clement Escoffier83507512008-10-13 07:33:03 +0000483 <LI><A href="ipojo-hello-word-maven-based-tutorial.html" title="iPOJO Hello Word (Maven-Based) tutorial">iPOJO Hello Word &#40;Maven&#45;Based&#41; tutorial</A></LI>
484 <LI><A href="ipojo-advanced-tutorial.html" title="iPOJO Advanced Tutorial">iPOJO Advanced Tutorial</A></LI>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000485</UL>
486
487
488<H6><A name="iPOJOin10minutes-UserGuide"></A><B>User Guide</B></H6>
489<UL>
Clement Escoffier83507512008-10-13 07:33:03 +0000490 <LI><A href="describing-components.html" title="Describing components">Describing components (handler list) </A></LI>
491 <LI><A href="how-to-use-ipojo-annotations.html" title="How to use iPOJO Annotations">How to use iPOJO Annotations</A></LI>
492 <LI><A href="using-xml-schemas.html" title="Using XML Schemas">Using XML Schemas</A></LI>
493 <LI><A href="ipojo-advanced-topics.html" title="iPOJO Advanced Topics">Advanced Topics</A></LI>
494 <LI><A href="ipojo-faq.html" title="iPOJO FAQ">FAQ</A></LI>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000495</UL>
496
497
498<H6><A name="iPOJOin10minutes-Tools"></A><B>Tools</B></H6>
499<UL>
Clement Escoffier83507512008-10-13 07:33:03 +0000500 <LI><A href="ipojo-eclipse-plug-in.html" title="iPOJO Eclipse Plug-in">iPOJO Eclipse Plug&#45;in</A></LI>
501 <LI><A href="ipojo-ant-task.html" title="iPOJO Ant Task">iPOJO Ant Task</A></LI>
502 <LI><A href="ipojo-maven-plug-in.html" title="iPOJO Maven Plug-in">iPOJO Maven Plug&#45;in</A></LI>
503 <LI><A href="ipojo-concepts-overview.html" title="iPOJO Concepts Overview">iPOJO concepts overview</A></LI>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000504</UL>
505
506
507<H6><A name="iPOJOin10minutes-DeveloperGuide"></A><B>Developer Guide</B></H6>
508<UL>
Clement Escoffier83507512008-10-13 07:33:03 +0000509 <LI>API: <SPAN class="nobr"><A href="http://people.apache.org/~clement/ipojo/api/0.8/" title="Visit page outside Confluence" rel="nofollow">0.8<SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
510 <LI><A href="how-to-write-your-own-handler.html" title="How to write your own handler">How to write your own handler</A></LI>
511 <LI><A href="how-to-use-ipojo-manipulation-metadata.html" title="How to use iPOJO Manipulation Metadata">How to use iPOJO Manipulation Metadata</A></LI>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000512</UL>
513
514
515<H6><A name="iPOJOin10minutes-Misc%26Contact"></A><B>Misc &amp; Contact</B></H6>
516<UL>
Clement Escoffier83507512008-10-13 07:33:03 +0000517 <LI><A href="apache-felix-ipojo-issuestracker.html" title="apache-felix-ipojo-issuestracker">Issues Tracker</A></LI>
518 <LI><A href="apache-felix-ipojo-supportedvms.html" title="apache-felix-ipojo-supportedVMs">Supported JVMs</A></LI>
519 <LI><A href="apache-felix-ipojo-supportedosgi.html" title="apache-felix-ipojo-supportedOSGi">Supported OSGi Implementations</A></LI>
520 <LI><A href="future-ideas.html" title="Future Ideas">Future Ideas</A></LI>
521 <LI><A href="contact.html" title="Contact">Contact</A></LI>
522 <LI><A href="related-works.html" title="Related Works">Related Works</A></LI>
523 <LI><A href="article-presentations.html" title="Article & Presentations">Article &amp; Presentations</A></LI>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000524</UL>
525
526
527<HR>
528<DIV class="" align="center">
Clement Escoffier83507512008-10-13 07:33:03 +0000529<P><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/createrssfeed.action?types=blogpost&amp;statuses=created&amp;statuses=modified&amp;spaces=FELIX&amp;labelString=iPOJO&amp;rssType=atom&amp;maxResults=10&amp;timeSpan=5&amp;publicFeed=true&amp;title=iPOJO%20Atom%20Feed" title="Stay tuned!" rel="nofollow"><IMG src="../../cwiki.apache.org/confluence/images/icons/feed-icon-32x32.png" align="absmiddle" border="0"><SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></P></DIV></TD></TR></TBODY></TABLE>
Clement Escoffier6b928e92008-05-16 20:33:54 +0000530 </DIV>
531 </BODY>
532
Clement Escoffier83507512008-10-13 07:33:03 +0000533<!-- Mirrored Site: felix.apache.org. File: /site/ipojo-in-10-minutes.html. Date: Mon, 13 Oct 2008 06:52:41 GMT -->
Clement Escoffier6b928e92008-05-16 20:33:54 +0000534</HTML>