felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Felix > iPOJO in 10 minutes
Date Wed, 28 Apr 2010 06:18:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/1/1/_/styles/combined.css?spaceKey=FELIX&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="http://cwiki.apache.org/confluence/display/FELIX/iPOJO+in+10+minutes">iPOJO in 10 minutes</a></h2>
    <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~clement.escoffier">Clement Escoffier</a>
    </h4>
        <br/>
                         <h4>Changes (7)</h4>
                                 
    
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >} <br>{code} <br></td></tr>
            <tr><td class="diff-changed-lines" >Then, create the file <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">&quot;src/spell/services/SpellChecker.java&quot;</span> <span class="diff-added-words"style="background-color: #dfd;">{{src/spell/services/SpellChecker.java}}</span> for the following _Spell Checker_ service interface: <br></td></tr>
            <tr><td class="diff-unchanged" >{code:java} <br>package spell.services; <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >START LEVEL 1 <br>   ID   State        Level  Name <br></td></tr>
            <tr><td class="diff-changed-lines" >[   0] [Active     ] [   <span class="diff-added-words"style="background-color: #dfd;"> </span> 0] System Bundle <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">(1.4.1)</span> <span class="diff-added-words"style="background-color: #dfd;">(2.0.5)</span> <br></td></tr>
            <tr><td class="diff-changed-lines" >[   1] [Active     ] [   <span class="diff-added-words"style="background-color: #dfd;"> </span> 1] Apache Felix <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">Shell Service (1.0.2)</span> <span class="diff-added-words"style="background-color: #dfd;">Bundle Repository (1.4.3)</span> <br></td></tr>
            <tr><td class="diff-changed-lines" >[   2] [Active     ] [   <span class="diff-added-words"style="background-color: #dfd;"> </span> 1] Apache Felix <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">Shell TUI (1.0.2)</span> <span class="diff-added-words"style="background-color: #dfd;">iPOJO (1.6.0)</span> <br></td></tr>
            <tr><td class="diff-changed-lines" >[   3] [Active     ] [   <span class="diff-added-words"style="background-color: #dfd;"> </span> 1] Apache Felix <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">Bundle Repository (1.2.1)</span> <span class="diff-added-words"style="background-color: #dfd;">iPOJO Arch Command (1.6.0)</span> <br></td></tr>
            <tr><td class="diff-changed-lines" >[   4] [Active     ] [   <span class="diff-added-words"style="background-color: #dfd;"> </span> 1] Apache Felix <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">iPOJO (1.4.0)</span> <span class="diff-added-words"style="background-color: #dfd;">Shell Service (1.4.2)</span> <br></td></tr>
            <tr><td class="diff-changed-lines" >[   5] [Active     ] [   <span class="diff-added-words"style="background-color: #dfd;"> </span> 1] Apache Felix <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">iPOJO Arch Command (1.4.0)</span> <span class="diff-added-words"style="background-color: #dfd;">Shell TUI (1.4.1)</span> <br></td></tr>
            <tr><td class="diff-unchanged" >-&gt; <br>{code} <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <style type="text/css">
 @import url(http://felix.apache.org/ipojo/site/superfish.css); 
</style>

<style type="text/css">
 @import url(http://felix.apache.org/ipojo/site/style.css); 
</style>

<p>
<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="http://felix.apache.org/ipojo/site/jquery-1.js"></script>
<script type="text/javascript" src="http://felix.apache.org/ipojo/site/hoverIntent.js"></script>
<script type="text/javascript" src="http://felix.apache.org/ipojo/site/superfish.js"></script> 
<script type="text/javascript" src="http://felix.apache.org/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>
<div class="main">
<div class="page-header"/>
<img src="http://felix.apache.org/ipojo/site/header.png" class="header">
<a href="http://ipojo.org"><img src="http://felix.apache.org/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="/confluence/display/FELIX/Apache+Felix+iPOJO" title="Apache Felix iPOJO">Home</a>							
	</li>
	<li>
	<a href="/confluence/display/FELIX/apache-felix-ipojo-why-choose-ipojo" title="apache-felix-ipojo-why-choose-ipojo">Why choose iPOJO</a>
	</li>
	<li>
	<a href="/confluence/display/FELIX/apache-felix-ipojo-successstories" title="apache-felix-ipojo-successstories">Success stories</a>
	</li>
	<li>
	<a href="/confluence/display/FELIX/Apache+Felix+iPOJO+Feature+Overview" title="Apache Felix iPOJO Feature Overview">Features</a>
	</li>
</ul>
</li>	

<li class="">			
<!-- Menu download -->
<li>
<a href="/confluence/display/FELIX/Download" title="Download">Download </a>
</li>

<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="/confluence/display/FELIX/iPOJO+in+10+minutes" title="iPOJO in 10 minutes">iPOJO in 10 minutes</a></li>
     <li><a href="/confluence/display/FELIX/How+to+use+iPOJO+Annotations" title="How to use iPOJO Annotations">Using Annotations</a></li>
     <li><a href="/confluence/display/FELIX/iPOJO+Hello+Word+%28Maven-Based%29+tutorial" title="iPOJO Hello Word (Maven-Based) tutorial">Maven tutorial</a></li>
     <li><a href="/confluence/display/FELIX/iPOJO+Advanced+Tutorial" title="iPOJO Advanced Tutorial">Advanced tutorial</a></li>
     <li><a href="/confluence/display/FELIX/apache-felix-ipojo-dosgi" title="apache-felix-ipojo-dosgi">Using Distributed OSGi</a></li>
     <li><a href="/confluence/display/FELIX/iPOJO+Composition+Tutorial" title="iPOJO Composition Tutorial">Application Composition</a></li>
    </ul>
    </li> <!-- end of getting started -->
    <!-- sub menu : Describing Components -->
     <li class="">
        <a href="http://felix.apache.org/site/describing-components.html" class="sf-with-ul">Describing components<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
        <ul>
        <li><a href="/confluence/display/FELIX/Service+Requirement+Handler" title="Service Requirement Handler">Requiring a service</a></li>
        <li><a href="/confluence/display/FELIX/Providing+OSGi+services" title="Providing OSGi services">Providing a service</a></li>
        <li><a href="/confluence/display/FELIX/Lifecycle+Callback+Handler" title="Lifecycle Callback Handler">Lifecycle management</a></li>
        <li><a href="/confluence/display/FELIX/Configuration+Handler" title="Configuration Handler">Configuration</a></li>
        <li><a href="/confluence/display/FELIX/Architecture+Handler" title="Architecture Handler">Introspection</a></li>
        <li><a href="/confluence/display/FELIX/Controller+Lifecycle+Handler" title="Controller Lifecycle Handler">Impacting the lifecycle</a></li>
        <li><a href="/confluence/display/FELIX/Event+Admin+Handlers" title="Event Admin Handlers">Asynchronous communication</a></li>
        <li><a href="/confluence/display/FELIX/iPOJO+JMX+Handler" title="iPOJO JMX Handler">JMX management</a></li>
        <li><a href="/confluence/display/FELIX/Extender+Pattern+Handler" title="Extender Pattern Handler">Extender pattern</a></li>
        <li><a href="/confluence/display/FELIX/White+Board+Pattern+Handler" title="White Board Pattern Handler">Whiteboard pattern</a></li>
        <li><a href="/confluence/display/FELIX/Temporal+Service+Dependency" title="Temporal Service Dependency">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="/confluence/display/FELIX/Combining+iPOJO+and+Configuration+Admin" title="Combining iPOJO and Configuration Admin">iPOJO and config admin</a></li>
        <li><a href="/confluence/display/FELIX/How-to+use+iPOJO+factories" title="How-to use iPOJO factories">Factories and Instances</a></li>
        <li><a href="/confluence/display/FELIX/Using+XML+Schemas" title="Using XML Schemas">XML Schemas</a></li>
        <li><a href="/confluence/display/FELIX/apache-felix-ipojo-api" title="apache-felix-ipojo-api">API</a></li>
        <li><a href="/confluence/display/FELIX/apache-felix-ipojo-testing-components" title="apache-felix-ipojo-testing-components">Testing components</a></li>
        <li><a href="/confluence/display/FELIX/apache-felix-ipojo-eclipse-integration" title="apache-felix-ipojo-eclipse-integration">Eclipse Integration</a></li>
        <li><a href="/confluence/display/FELIX/iPOJO+FAQ" title="iPOJO FAQ">FAQ</a></li>
        <li><a href="/confluence/display/FELIX/iPOJO-Reference-Card" title="iPOJO-Reference-Card">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" class="external-link" rel="nofollow">Javadoc</a></li>
        <li><a href="/confluence/display/FELIX/How+to+write+your+own+handler" title="How to write your own handler">Handler development</a></li>
        <li><a href="/confluence/display/FELIX/How+to+use+iPOJO+Manipulation+Metadata" title="How to use iPOJO Manipulation Metadata">Manipulation Metadata </a></li>
        <li><a href="/confluence/display/FELIX/Dive+into+the+iPOJO+Manipulation+depths" title="Dive into the iPOJO Manipulation depths">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="/confluence/display/FELIX/iPOJO+Ant+Task" title="iPOJO Ant Task">Ant Task</a></li>
   <li><a href="/confluence/display/FELIX/iPOJO+Eclipse+Plug-in" title="iPOJO Eclipse Plug-in">Eclipse Plugin</a></li>
   <li><a href="/confluence/display/FELIX/iPOJO+Maven+Plug-in" title="iPOJO Maven Plug-in">Maven Plugin</a></li>
   <li><a href="/confluence/display/FELIX/iPOJO-Arch-Command" title="iPOJO-Arch-Command"><tt>arch</tt> shell command</a></li>
   <li><a href="/confluence/display/FELIX/apache-felix-ipojo-online-manipulator" title="apache-felix-ipojo-online-manipulator">Online Manipulator</a></li>
   <li><a href="/confluence/display/FELIX/iPOJO+Webconsole+Plugin" title="iPOJO Webconsole Plugin">Webconsole plugin</a></li>
   <li><a href="/confluence/display/FELIX/apache-felix-ipojo-junit4osgi" title="apache-felix-ipojo-junit4osgi">Junit4OSGi</a></li>
</ul>   
</li><!-- End of tools -->	
<!-- Menu 5 : Support -->
<li>
<a href="/confluence/display/FELIX/ipojo-support" title="ipojo-support">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="/confluence/display/FELIX/apache-felix-ipojo-supportedVMs" title="apache-felix-ipojo-supportedVMs">Supported JVMs</a></li>
   <li><a href="/confluence/display/FELIX/apache-felix-ipojo-supportedOSGi" title="apache-felix-ipojo-supportedOSGi">Supported OSGi Implementations</a></li>
   <li><a href="http://ipojo-dark-side.blogspot.com" class="external-link" rel="nofollow">iPOJO's Dark Side Blog</a></li>
   <li><a href="/confluence/pages/viewpage.action?pageId=54954" title="Article &amp; Presentations">Article &amp; 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 -->
</p>

<div class="content">

<h1><a name="iPOJOin10minutes-iPOJOin10minutes"></a>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 <a href="/confluence/display/FELIX/How+to+use+iPOJO+Annotations" title="How to use iPOJO Annotations">annotations</a> and provides an <a href="/confluence/display/FELIX/apache-felix-ipojo-api" title="apache-felix-ipojo-api">API</a> for this purpose.</em></p>

<h2><a name="iPOJOin10minutes-Introduction"></a>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 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>

<h2><a name="iPOJOin10minutes-ThePOJOconcept"></a>The POJO concept</h2>

<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: "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 the developer's perspective, the iPOJO framework strives to only require POJOs in as much as it is possible.</p>

<h2><a name="iPOJOin10minutes-iPOJOservicecomponentoverview"></a>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 service interface embodied as a Java interface. In addition, iPOJO introduces a callback concept to notify a component about various state changes.</p>

<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>

<h2><a name="iPOJOin10minutes-Asimpleexample"></a>A simple example</h2>

<p>In this tutorial we will present how to:</p>
<ul>
	<li>Publish an OSGi service</li>
	<li>Require an OSGi service</li>
	<li>Use lifecycle callbacks to activate and deactivate components</li>
</ul>


<h3><a name="iPOJOin10minutes-PresentationoftheSpellapplication"></a>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:</p>
<ul>
	<li>A component implementing a dictionary service</li>
	<li>A component requiring the dictionary service and providing a spellchecker service</li>
	<li>A component requiring the spellchecker and providing an user interface</li>
</ul>


<p><span class="image-wrap" style=""><img src="/confluence/download/attachments/81324/spell.png?version=1&amp;modificationDate=1206970616000" style="border: 0px solid black" /></span></p>

<h3><a name="iPOJOin10minutes-Preparingthetutorial"></a>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/" class="external-link" rel="nofollow">here</a> to download and install Ant). Download the tutorial archive available <a href="http://people.apache.org/~clement/ipojo/tutorials/10min/tutorial.zip" class="external-link" rel="nofollow">here</a> and then unzip it. The archive contains seven directories:</p>
<ul>
	<li>spell.services contains service interfaces used by the applications</li>
	<li>spell.english contains an implementation of the Dictionary service (containing English words)</li>
	<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>
	<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>
	<li>The task directory contains Ant tasks used to build the project</li>
	<li>The solution directory contains an already developed version of the application.</li>
	<li>Finally, the felix folder contains a configured version of the Felix runtime</li>
</ul>


<h3><a name="iPOJOin10minutes-Thespell.servicesproject"></a>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:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
<span class="code-keyword">package</span> spell.services;
/**
 * A simple service <span class="code-keyword">interface</span> that defines a dictionary service.
 * A dictionary service simply verifies the existence of a word.
**/
<span class="code-keyword">public</span> <span class="code-keyword">interface</span> DictionaryService {
    /**
     * Check <span class="code-keyword">for</span> the existence of a word.
     * @param word the word to be checked.
     * @<span class="code-keyword">return</span> <span class="code-keyword">true</span> <span class="code-keyword">if</span> the word is in the dictionary,
     *         <span class="code-keyword">false</span> otherwise.
     **/
    <span class="code-keyword">public</span> <span class="code-object">boolean</span> checkWord(<span class="code-object">String</span> word);
}
</pre>
</div></div>
<p>Then, create the file <tt>src/spell/services/SpellChecker.java</tt> for the following <em>Spell Checker</em> service interface:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
<span class="code-keyword">package</span> spell.services;
/**
 * A simple service <span class="code-keyword">interface</span> 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.
**/
<span class="code-keyword">public</span> <span class="code-keyword">interface</span> SpellChecker {
    /**
     * Checks a given passage <span class="code-keyword">for</span> 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.
     * @<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.
    **/
    <span class="code-keyword">public</span> <span class="code-object">String</span>[] check(<span class="code-object">String</span> passage);
}
</pre>
</div></div>
<p>Once created, you can build the project by launching Ant from the project directory.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div class="error"><span class="error">Unable to find source-code formatter for language: shell.</span> Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml</div><pre class="code-shell">
$ ant
Buildfile: build.xml
clean:
compile:
    [mkdir] Created dir: d:\clement\workspaces\sandbox\ipojo\examples\tutorial-ant\
            spell.services\output
    [mkdir] 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\
            tutorial-ant\spell.services\output\classes
<span class="code-keyword">package</span>:
      [bnd] spell.services 2
BUILD SUCCESSFUL
Total time: 0 seconds
</pre>
</div></div>
<p>The created bundle is inside the output directory (spell.services.jar). The build process use <a href="http://www.aqute.biz/Code/Bnd" class="external-link" rel="nofollow">BND</a>. The bundle manifest is described in the spell.services.bnd file.<br/>
Once this project is done, we are able to implement a Dictionary service.</p>

<h3><a name="iPOJOin10minutes-Thespell.englishproject%3AProvidinganOSGiservice"></a>The spell.english project: Providing an OSGi service</h3>

<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/>
The first step is to implement the service. Create the "src/spell/english/EnglishDictionary.java" file for the following <em>Dictionary service</em> implementation:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
<span class="code-keyword">package</span> spell.english;
<span class="code-keyword">import</span> spell.services.DictionaryService;
/**
 * An implementation of the Dictionary service containing English words
 * see DictionaryService <span class="code-keyword">for</span> details of the service.
 **/
<span class="code-keyword">public</span> class EnglishDictionary <span class="code-keyword">implements</span> DictionaryService {
    <span class="code-comment">// The set of words contained in the dictionary.
</span>    <span class="code-object">String</span>[] m_dictionary = { <span class="code-quote">"welcome"</span>, <span class="code-quote">"to"</span>, <span class="code-quote">"the"</span>, <span class="code-quote">"ipojo"</span>, <span class="code-quote">"tutorial"</span> };
    /**
     * Implements DictionaryService.checkWord(). Determines
     * <span class="code-keyword">if</span> the passed in word is contained in the dictionary.
     * @param word the word to be checked.
     * @<span class="code-keyword">return</span> <span class="code-keyword">true</span> <span class="code-keyword">if</span> the word is in the dictionary,
     *         <span class="code-keyword">false</span> otherwise.
     **/
    <span class="code-keyword">public</span> <span class="code-object">boolean</span> checkWord(<span class="code-object">String</span> word) {
        word = word.toLowerCase();
        <span class="code-comment">// This is very inefficient
</span>        <span class="code-keyword">for</span> (<span class="code-object">int</span> i = 0; i &lt; m_dictionary.length; i++) {
            <span class="code-keyword">if</span> (m_dictionary[i].equals(word)) {
                <span class="code-keyword">return</span> <span class="code-keyword">true</span>;
            }
        }
        <span class="code-keyword">return</span> <span class="code-keyword">false</span>;
    }
}
</pre>
</div></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.<br/>
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="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;ipojo&gt;</span>
<span class="code-tag">&lt;component classname=<span class="code-quote">"spell.english.EnglishDictionary"</span>&gt;</span>
	<span class="code-tag">&lt;provides/&gt;</span>
<span class="code-tag">&lt;/component&gt;</span>
<span class="code-tag">&lt;instance component=<span class="code-quote">"spell.english.EnglishDictionary"</span>/&gt;</span>
<span class="code-tag">&lt;/ipojo&gt;</span>
</pre>
</div></div>
<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:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div class="error"><span class="error">Unable to find source-code formatter for language: shell.</span> Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml</div><pre class="code-shell">
$ ant
Buildfile: build.xml
clean:
   [delete] Deleting directory d:\clement\workspaces\sandbox\ipojo\examples\
            tutorial-ant\spell.english\output\classes
   [delete] Deleting directory d:\clement\workspaces\sandbox\ipojo\examples\
            tutorial-ant\spell.english\output
buildclasspath:
compile:
    [mkdir] Created dir: d:\clement\workspaces\sandbox\ipojo\examples\
            tutorial-ant\spell.english\output
    [mkdir] 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\
            tutorial-ant\spell.english\output\classes
<span class="code-keyword">package</span>:
      [bnd] spell.english 1
    [ipojo] 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\
            tutorial-ant\spell.english\metadata.xml
    [ipojo] Start bundle manipulation
    [ipojo] Bundle manipulation - SUCCESS
    [ipojo] Output File : d:\clement\workspaces\sandbox\ipojo\examples\
            tutorial-ant\spell.english\output\spell.english.jar
BUILD SUCCESSFUL
Total time: 1 second
</pre>
</div></div>
<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 <tt>spell.english.bnd</tt> file.</p>

<h3><a name="iPOJOin10minutes-Thespell.checkerproject%3ARequiringanOSGiservice"></a>The spell.checker project: Requiring an OSGi service</h3>

<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>

<p>First create the file "src/spell/checker/SpellCheck.java" in the spell.checker directory for the following <em>Check Speller service</em> implementation:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
<span class="code-keyword">package</span> spell.checker;
<span class="code-keyword">import</span> java.util.ArrayList;
<span class="code-keyword">import</span> java.util.List;
<span class="code-keyword">import</span> java.util.StringTokenizer;
<span class="code-keyword">import</span> spell.services.DictionaryService;
<span class="code-keyword">import</span> spell.services.SpellChecker;
<span class="code-keyword">public</span> class SpellCheck <span class="code-keyword">implements</span> SpellChecker {
    <span class="code-keyword">private</span> DictionaryService m_dictionary;
    /**
     * Implements SpellChecker.check(). Checks the given passage <span class="code-keyword">for</span> misspelled words.
     * @param passage the passage to spell check.
     * @<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.
     */
    <span class="code-keyword">public</span> <span class="code-object">String</span>[] check(<span class="code-object">String</span> passage) {
        <span class="code-comment">// No misspelled words <span class="code-keyword">for</span> an empty string.
</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>; }
        List errorList = <span class="code-keyword">new</span> ArrayList();
        <span class="code-comment">// Tokenize the passage using spaces and punctuation.
</span>        StringTokenizer st = <span class="code-keyword">new</span> StringTokenizer(passage, <span class="code-quote">" ,.!?;:"</span>);
        <span class="code-comment">// Loop through each word in the passage.
</span>        <span class="code-keyword">while</span> (st.hasMoreTokens()) {
            <span class="code-object">String</span> word = st.nextToken();
            <span class="code-comment">// Check the current word.
</span>            <span class="code-keyword">if</span> (! m_dictionary.checkWord(word)) {
                <span class="code-comment">// If the word is not correct, then add it
</span>                <span class="code-comment">// to the incorrect word list.
</span>                errorList.add(word);
            }
        }
        <span class="code-comment">// Return <span class="code-keyword">null</span> <span class="code-keyword">if</span> no words are incorrect.
</span>        <span class="code-keyword">if</span> (errorList.size() == 0) { <span class="code-keyword">return</span> <span class="code-keyword">null</span>; }
        <span class="code-comment">// Return the array of incorrect words.
</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>
</div></div>
<p>This class implements the SpellChecker service interface as it will provide it. Moreover, it has a <em>special</em> 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.</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="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;ipojo&gt;</span>
<span class="code-tag">&lt;component classname=<span class="code-quote">"spell.checker.SpellCheck"</span>&gt;</span>
	<span class="code-tag">&lt;requires field=<span class="code-quote">"m_dictionary"</span>/&gt;</span>
	<span class="code-tag">&lt;provides/&gt;</span>
<span class="code-tag">&lt;/component&gt;</span>
<span class="code-tag">&lt;instance component=<span class="code-quote">"spell.checker.SpellCheck"</span>/&gt;</span>
<span class="code-tag">&lt;/ipojo&gt;</span>
</pre>
</div></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><a name="iPOJOin10minutes-Thespell.checker.guiproject"></a>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:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
<span class="code-keyword">package</span> spell.gui;
<span class="code-keyword">import</span> javax.swing.JButton;
<span class="code-keyword">import</span> javax.swing.JFrame;
<span class="code-keyword">import</span> javax.swing.JLabel;
<span class="code-keyword">import</span> javax.swing.JTextField;
<span class="code-keyword">import</span> spell.services.SpellChecker;
/**
 * A very simple Gui interacting with the CheckSpeller service
 */
<span class="code-keyword">public</span> class SpellCheckerGui <span class="code-keyword">extends</span> JFrame {
    /**
     * Swing component where the user write the passage to check.
     */
    <span class="code-keyword">private</span> JTextField m_passage = <span class="code-keyword">null</span>;

    /**
     * Check button
     */
    <span class="code-keyword">private</span> JButton m_checkButton = <span class="code-keyword">null</span>;

    /**
     * Area where the result is displayed.
     */
    <span class="code-keyword">private</span> JLabel m_result = <span class="code-keyword">null</span>;
    /**
     * Service dependency on the SpellChecker.
     */
    <span class="code-keyword">private</span> SpellChecker m_checker;

    /**
     * Constructor.
     * Initialize the GUI.
     */
    <span class="code-keyword">public</span> SpellCheckerGui() {
        <span class="code-keyword">super</span>();
        initComponents();
        <span class="code-keyword">this</span>.setTitle(<span class="code-quote">"Spellchecker Gui"</span>);
    }
    /**
     * Initialize the Swing Gui.
     */
    <span class="code-keyword">private</span> void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;
        m_checkButton = <span class="code-keyword">new</span> javax.swing.JButton();
        m_result = <span class="code-keyword">new</span> javax.swing.JLabel();
        m_passage = <span class="code-keyword">new</span> javax.swing.JTextField();
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); <span class="code-comment">//Stop Felix
</span>        getContentPane().setLayout(<span class="code-keyword">new</span> java.awt.GridBagLayout());
        m_checkButton.setText(<span class="code-quote">"Check"</span>);
        m_checkButton.addActionListener(<span class="code-keyword">new</span> java.awt.event.ActionListener() {
            <span class="code-keyword">public</span> void actionPerformed(java.awt.event.ActionEvent e) {
                check();
            }
        });
        gridBagConstraints = <span class="code-keyword">new</span> java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = <span class="code-keyword">new</span> java.awt.Insets(2, 2, 2, 2);
        getContentPane().add(m_checkButton, gridBagConstraints);
        m_result.setPreferredSize(<span class="code-keyword">new</span> java.awt.Dimension(175, 20));
        gridBagConstraints = <span class="code-keyword">new</span> java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = <span class="code-keyword">new</span> java.awt.Insets(2, 2, 2, 2);
        getContentPane().add(m_result, gridBagConstraints);
        m_passage.setPreferredSize(<span class="code-keyword">new</span> java.awt.Dimension(175, 20));
        gridBagConstraints = <span class="code-keyword">new</span> java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = <span class="code-keyword">new</span> java.awt.Insets(2, 2, 2, 2);
        getContentPane().add(m_passage, gridBagConstraints);
        pack();
    }
    /**
     * Check Button action.
     * Collects the user input and checks it.
     */
    <span class="code-keyword">private</span> void check() {
        <span class="code-object">String</span>[] result = m_checker.check(m_passage.getText());
        <span class="code-keyword">if</span> (result != <span class="code-keyword">null</span>) {
            m_result.setText(result.length + <span class="code-quote">" word(s) are mispelled"</span>);
        } <span class="code-keyword">else</span> {
            m_result.setText(<span class="code-quote">"All words are correct"</span>);
        }
    }
    /**
     * Start callback.
     * This method will be called when the instance becomes valid.
     * It set the Gui visibility to <span class="code-keyword">true</span>.
     */
    <span class="code-keyword">public</span> void start() {
        <span class="code-keyword">this</span>.setVisible(<span class="code-keyword">true</span>);
    }
    /**
     * Stop callback.
     *  This method will be called when the instance becomes invalid or stops.
     *  It deletes the Gui.
     */
    <span class="code-keyword">public</span> void stop() {
        <span class="code-keyword">this</span>.dispose();
    }
}
</pre>
</div></div>
<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>

<p>Create the <em>metadata.xml</em> file in the spell.chercker.gui directory with the following content:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;ipojo&gt;</span>
<span class="code-tag">&lt;component classname=<span class="code-quote">"spell.gui.SpellCheckerGui"</span>&gt;</span>
	<span class="code-tag">&lt;requires field=<span class="code-quote">"m_checker"</span>/&gt;</span>
	<span class="code-tag">&lt;callback transition=<span class="code-quote">"validate"</span> method=<span class="code-quote">"start"</span>/&gt;</span>
	<span class="code-tag">&lt;callback transition=<span class="code-quote">"invalidate"</span> method=<span class="code-quote">"stop"</span>/&gt;</span>
<span class="code-tag">&lt;/component&gt;</span>
<span class="code-tag">&lt;instance component=<span class="code-quote">"spell.gui.SpellCheckerGui"</span>/&gt;</span>
<span class="code-tag">&lt;/ipojo&gt;</span>
</pre>
</div></div>
<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>

<p>Once this file is created, you can compile the project by launching <em>ant</em> in the spell.checker.gui directory.</p>

<h2><a name="iPOJOin10minutes-Runningtheapplication"></a>Running the application</h2>

<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>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div class="error"><span class="error">Unable to find source-code formatter for language: shell.</span> Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml</div><pre class="code-shell">
java -jar bin/felix.jar
</pre>
</div></div>
<p>You can check installed bundles by using the '<em>ps</em>' command:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div class="error"><span class="error">Unable to find source-code formatter for language: shell.</span> Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml</div><pre class="code-shell">
-&gt; ps
START LEVEL 1
   ID   State        Level  Name
[   0] [Active     ] [    0] <span class="code-object">System</span> Bundle (2.0.5)
[   1] [Active     ] [    1] Apache Felix Bundle Repository (1.4.3)
[   2] [Active     ] [    1] Apache Felix iPOJO (1.6.0)
[   3] [Active     ] [    1] Apache Felix iPOJO Arch Command (1.6.0)
[   4] [Active     ] [    1] Apache Felix Shell Service (1.4.2)
[   5] [Active     ] [    1] Apache Felix Shell TUI (1.4.1)
-&gt;
</pre>
</div></div>
<p>iPOJO runtime is the bundle 4. Once started, install the four created bundles as above:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div class="error"><span class="error">Unable to find source-code formatter for language: shell.</span> Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml</div><pre class="code-shell">
start file:../spell.services/output/spell.services.jar
start file:../spell.english/output/spell.english.jar
start file:../spell.checker/output/spell.checker.jar
start file:../spell.checker.gui/output/spell.checker.gui.jar
</pre>
</div></div>
<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/>
<span class="image-wrap" style=""><img src="/confluence/download/attachments/81324/ss.png?version=1&amp;modificationDate=1206969418000" style="border: 0px solid black" /></span><br/>
Then, stop the <em>Dictionary</em> service provider (with the <em>stop 7</em>) command. The GUI disappears. Indeed, Spell Checker service cannot be provided as it depends on the Dictionary service.<br/>
<span class="image-wrap" style=""><img src="/confluence/download/attachments/81324/spell2.png?version=1&amp;modificationDate=1206970616000" style="border: 0px solid black" /></span><br/>
Then, restart the Dictionary service provider with the <em>start 7</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 8</em> command. As for the last manipulation, the GUI disappears.<br/>
<span class="image-wrap" style=""><img src="/confluence/download/attachments/81324/spell3.png?version=1&amp;modificationDate=1206970616000" style="border: 0px solid black" /></span><br/>
To go further in the exploration, modify the spell.checker implementation. For example, add a simple trace, printing wrong words:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
        <span class="code-comment">// ...
</span>        <span class="code-comment">// Return <span class="code-keyword">null</span> <span class="code-keyword">if</span> no words are incorrect.
</span>        <span class="code-keyword">if</span> (errorList.size() == 0) { <span class="code-keyword">return</span> <span class="code-keyword">null</span>; }

        <span class="code-comment">// Return the array of incorrect words.
</span>        <span class="code-object">System</span>.out.println(<span class="code-quote">"Wrong words:"</span> + errorList); <span class="code-comment">// &lt;-- Add <span class="code-keyword">this</span> line
</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>
</div></div>

<p>Then rebuild the spell.checker bundle and update it (with the 'update 8' command). You will see the gui "blinking". In fact, the gui was stopped as the required spell checker service was no more available. As soon as it was back, the gui restarts. The gui didn't lose its state. The other services weren't stopped during the update.<br/>
You can uninstall the check service bundle and then re-install a new one (or the same one), you will see the same behavior. </p>

<h2><a name="iPOJOin10minutes-Conclusion"></a>Conclusion</h2>
<p>We saw how to use easily iPOJO to build service-oriented component. In this tutorial, we have demonstrated how to:</p>
<ul>
	<li>Publish OSGi services</li>
	<li>Require OSGi services</li>
	<li>Use lifecycle callbacks to activate and deactivate components</li>
</ul>


<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 <a href="mailto:users-subscribe@felix.apache.org" class="external-link" rel="nofollow">users-subscribe@felix.apache.org</a>; after subscribing, email questions or feedback to <a href="mailto:users@felix.apache.org" class="external-link" rel="nofollow">users@felix.apache.org</a>.
<br class="atl-forced-newline" />
<br class="atl-forced-newline" /></p>

 </div>
        <img src="http://felix.apache.org/ipojo/site/footer.png" class="footer">
</div>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-1518442-4");
pageTracker._trackPageview();
} catch(err) {}
</script>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action" class="grey">Change Notification Preferences</a>
        </div>
        <a href="http://cwiki.apache.org/confluence/display/FELIX/iPOJO+in+10+minutes">View Online</a>
        |
        <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=81324&revisedVersion=34&originalVersion=33">View Changes</a>
                |
        <a href="http://cwiki.apache.org/confluence/display/FELIX/iPOJO+in+10+minutes?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message