Commit the documentation of core, ant task, maven plugin and arch
Change the NOTICE file format
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@657197 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/core/doc/apache-felix-ipojo-feature-overview.html b/ipojo/core/doc/apache-felix-ipojo-feature-overview.html
new file mode 100644
index 0000000..d8dd9b9
--- /dev/null
+++ b/ipojo/core/doc/apache-felix-ipojo-feature-overview.html
@@ -0,0 +1,193 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+
+
+<HEAD>
+ <TITLE>Apache Felix - Apache Felix iPOJO Feature Overview</TITLE>
+ <LINK rel="stylesheet" href="http://felix.apache.org/site/media.data/site.css" type="text/css" media="all">
+ <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ </HEAD>
+ <BODY>
+ <DIV class="title"><DIV class="logo"><A href="http://felix.apache.org/site/index.html"><IMG border="0" alt="Apache Felix" src="http://felix.apache.org/site/media.data/logo.png"></A></DIV><DIV class="header"><A href="http://www.apache.org/"><IMG border="0" alt="Apache" src="http://felix.apache.org/site/media.data/apache.png"></A></DIV></DIV>
+ <DIV class="menu">
+ <UL>
+ <LI><A href="http://felix.apache.org/site/news.html" title="news">news</A></LI>
+ <LI><A href="http://felix.apache.org/site/license.html" title="license">license</A></LI>
+ <LI><SPAN class="nobr"><A href="http://felix.apache.org/site/downloads.cgi" title="Visit page outside Confluence" rel="nofollow">downloads<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/documentation.html" title="documentation">documentation</A></LI>
+ <LI><A href="http://felix.apache.org/site/mailinglists.html" title="mailinglists">mailing lists</A></LI>
+ <LI><A href="http://felix.apache.org/site/contributing.html" title="Contributing">contributing</A></LI>
+ <LI><SPAN class="nobr"><A href="http://www.apache.org/" title="Visit page outside Confluence" rel="nofollow">asf<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>
+<!-- ApacheCon Ad -->
+<IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+<P style="height: 100px">
+<!-- ApacheCon Ad --></LI>
+</UL>
+ </DIV>
+ <DIV class="main">
+<TABLE class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR>
+<TD class="confluenceTd" valign="top" width="80%">
+<H1><A name="ApacheFelixiPOJOFeatureOverview-ApacheFelixiPOJOFeatureOverview"></A>Apache Felix iPOJO Feature Overview</H1>
+
+<P>This page is an attempt to put all of the features and benefits of iPOJO into a single high-level list so that it is easy to see why you will want to use iPOJO for your applications. This list is not exhaustive, but represents the set of features that are potentially most likely to be needed or are unique.</P>
+
+<H2><A name="ApacheFelixiPOJOFeatureOverview-CoreFeatures"></A>Core Features</H2>
+
+<UL>
+ <LI><B>POJO-based approach</B> - Most components can simply be POJOs and need not have iPOJO- or OSGi-specific API in them.</LI>
+ <LI><B>Simple service provisioning</B> - iPOJO manages all aspects of providing an OSGi service.
+ <UL>
+ <LI><B>Service property management</B>
+ <UL class="alternate" type="square">
+ <LI>Can be controlled by configuration properties.</LI>
+ <LI>Can be mapped to member fields and automatically updated by the component instance at run time by just changing the member field value.</LI>
+ </UL>
+ </LI>
+ <LI><B>Service life cycle participation</B> - The component instance can participate in the service life cycle by declaring a boolean member field that indicates when the service is actually valid (normally a service is assumed to be valid if the component instance's dependencies are satisfied).</LI>
+ </UL>
+ </LI>
+ <LI><B>Rich service dependency model</B> - Automatically manages a full spectrum of service dependencies.
+ <UL>
+ <LI><B>Optional/mandatory</B> service dependencies.</LI>
+ <LI><B>Singular/aggregate</B> service dependencies.</LI>
+ <LI><B>Default service implementations</B> - The component can provide default implementations of dependent services if no providers are available.</LI>
+ <LI><B>Member field or method injection</B> - Also supported in combination.
+ <UL class="alternate" type="square">
+ <LI>Member field injection does not require cluttering component code with bind/unbind methods.</LI>
+ <LI>Member method injection supports various method signatures
+ <UL class="alternate" type="square">
+ <LI>method() - Acts as a simple event-callback mechanism.</LI>
+ <LI>method(<service-interface> svc) - Receives the service object cast to the appropriate interface.</LI>
+ <LI>method(ServiceReference ref) - Receives the OSGi ServiceReference for the service object.</LI>
+ <LI>method(ServiceReference ref, <service-interface> svc) - Receives the OSGi ServiceReference and the service object cast to the appropriate interface.</LI>
+ </UL>
+ </LI>
+ </UL>
+ </LI>
+ <LI><B>Binding policies</B> - Allow components to control how/when their dependencies are bound.
+ <UL class="alternate" type="square">
+ <LI><B>Static</B> - Static dependencies <B>cannot</B> change without invalidating the component instance, so injected services typically do not change at run time and service departures typically result in the component instance being destroyed and potentially recreated.</LI>
+ <LI><B>Dynamic</B> - Dynamic dependencies <B>can</B> change without invalidating the component instance, so injected services can change at run time, but <B>do not</B> change with respect to service priority changes (i.e., they do not automatically switch if a higher priority service appears).</LI>
+ <LI><B>Dynamic priority</B> - Dynamic priority dependencies <B>can</B> change without invalidating the component instance and <B>do</B> dynamically update based on service priority rankings at run time.</LI>
+ </UL>
+ </LI>
+ </UL>
+ </LI>
+ <LI><B>Configuration property management</B> - Integrated with OSGi Configuration Admin service.
+ <UL>
+ <LI><B>Member field/member method injection</B> - Also supported in combination.</LI>
+ <LI><B>Service property propagation</B> - Configuration properties can be configured to update service properties if the component instance is providing a service.</LI>
+ </UL>
+ </LI>
+ <LI><B>Sophisticated concurrency handling</B> - Externalizes concurrency issues so that component code does not need to worry about services changing while they are in use (i.e., no locking protocol in component code).</LI>
+ <LI><B>Deferred instance creation</B> - POJO instances are not created until they are actually needed, thus reducing start-up overhead.</LI>
+ <LI><B>Introspection support</B> - Supports introspecting a component instance and the state of its dependencies.
+ <UL>
+ <LI>Interactive introspection is supported by an arch command for Felix' shell.</LI>
+ </UL>
+ </LI>
+ <LI><B>Extensible</B> - All iPOJO features are implemented via a set of handlers, which is an extensibility mechanism open to developers by which they can support custom functionality (e.g., exporting a provided service remotely, etc.).</LI>
+</UL>
+
+
+<H2><A name="ApacheFelixiPOJOFeatureOverview-Advanced%2FExperimentalFeatures"></A>Advanced/Experimental Features</H2>
+
+<UL>
+ <LI><B>Composite model</B> - iPOJO supports a flexible architectural-like model for composing services.
+ <UL>
+ <LI><B>Flexible composites</B> - A composite is an abstract component implementation.
+ <UL class="alternate" type="square">
+ <LI><B>Sub-services and sub-components</B> - Unlike traditional component composition, an iPOJO composite can be described in terms of services in addition to sub-components; thus sub-service implementation selection is deferred until run time.</LI>
+ <LI><B>Optional/mandatory</B> sub-services and/or sub-components.</LI>
+ <LI><B>Singular/aggregate</B> sub-services and/or sub-components.</LI>
+ </UL>
+ </LI>
+ <LI><B>Hierarchical</B> - A composite component may contain other composite components.
+ <UL class="alternate" type="square">
+ <LI><B>Composite scoping</B> - A composite acts as a scoping mechanism where sub-services/sub-components are not visible externally and external services are not visible internally.</LI>
+ </UL>
+ </LI>
+ <LI><B>Service dependencies</B> - A composite has the full expressive capabilities of primitive components when it comes to service dependencies (see above description of service dependencies in core features).
+ <UL class="alternate" type="square">
+ <LI>For a composite, a service dependency effectively imports an external service into the composite scope from its parent composite (which may be the OSGi service registry in the root case).</LI>
+ </UL>
+ </LI>
+ <LI><B>Composite is just a component</B> - Composites can be instantiated and automatically managed just like a primitive component.</LI>
+ </UL>
+ </LI>
+</UL>
+
+</TD>
+<TD class="confluenceTd" valign="top" width="20%">
+<FORM method="get" class="confluence-searchbox marginlessForm " action="http://felix.apache.org/confluence/dosearchsite.action">
+ <INPUT type="hidden" name="searchQuery.spaceKey" value="FELIX">
+ <INPUT type="text" name="searchQuery.queryString">
+ <INPUT type="submit" value="Search">
+</FORM>
+<HR>
+<H6><A name="ApacheFelixiPOJOFeatureOverview-Overview"></A><B>Overview</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-2.html" title="Apache Felix iPOJO-2">Home Page</A></LI>
+ <LI><A href="#" title="Apache Felix iPOJO Feature Overview">iPOJO Feature Overview</A></LI>
+ <LI><A href="http://felix.apache.org/site/download.html" title="Download">Download & Install </A></LI>
+</UL>
+
+
+<H6><A name="ApacheFelixiPOJOFeatureOverview-GettingStarted"></A><B>Getting Started</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-in-10-minutes.html" title="iPOJO in 10 minutes">iPOJO in 10 minutes</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-hello-word-maven-based-tutorial.html" title="iPOJO Hello Word (Maven-Based) tutorial">iPOJO Hello Word (Maven-Based) tutorial</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-tutorial.html" title="iPOJO Advanced Tutorial">iPOJO Advanced Tutorial</A></LI>
+</UL>
+
+
+<H6><A name="ApacheFelixiPOJOFeatureOverview-UserGuide"></A><B>User Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/describing-components.html" title="Describing components">Describing components</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-annotations.html" title="How to use iPOJO Annotations">How to use iPOJO Annotations</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-topics.html" title="iPOJO Advanced Topics">Advanced Topics</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-faq.html" title="iPOJO FAQ">FAQ</A></LI>
+</UL>
+
+
+<H6><A name="ApacheFelixiPOJOFeatureOverview-Tools"></A><B>Tools</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-eclipse-plug-in.html" title="iPOJO Eclipse Plug-in">iPOJO Eclipse Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-ant-task.html" title="iPOJO Ant Task">iPOJO Ant Task</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-maven-plug-in.html" title="iPOJO Maven Plug-in">iPOJO Maven Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-concepts-overview.html" title="iPOJO Concepts Overview">iPOJO concepts overview</A></LI>
+</UL>
+
+
+<H6><A name="ApacheFelixiPOJOFeatureOverview-DeveloperGuide"></A><B>Developer Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/how-to-write-your-own-handler.html" title="How to write your own handler">How to write your own handler</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-manipulation-metadata.html" title="How to use iPOJO Manipulation Metadata">How to use iPOJO Manipulation Metadata</A></LI>
+</UL>
+
+
+<H6><A name="ApacheFelixiPOJOFeatureOverview-Misc%26Contact"></A><B>Misc & Contact</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-issuestracker.html" title="apache-felix-ipojo-issuestracker">Issues Tracker</A></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Supported%20JVMs&linkCreation=true&fromPageId=82824" title="Create Page: Supported JVMs" class="createlink">Supported JVMs<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Supported%20OSGi%20Implementations&linkCreation=true&fromPageId=82824" title="Create Page: Supported OSGi Implementations" class="createlink">Supported OSGi Implementations<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/future-ideas.html" title="Future Ideas">Future Ideas</A></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Contact&linkCreation=true&fromPageId=82824" title="Create Page: Contact" class="createlink">Contact<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/related-works.html" title="Related Works">Related Works</A></LI>
+ <LI><A href="http://felix.apache.org/site/article-presentations.html" title="Article & Presentations">Article & Presentations</A></LI>
+</UL>
+
+
+<HR>
+<DIV class="" align="center">
+<P><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/createrssfeed.action?types=blogpost&statuses=created&statuses=modified&spaces=FELIX&labelString=iPOJO&rssType=atom&maxResults=10&timeSpan=5&publicFeed=true&title=iPOJO%20Atom%20Feed" title="Stay tuned!" rel="nofollow"><IMG src="http://cwiki.apache.org/confluence/images/icons/feed-icon-32x32.png" align="absmiddle" border="0"><SUP><IMG class="rendericon" src="http://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>
+
+
+ </DIV>
+ </BODY>
+
+
+</HTML>
diff --git a/ipojo/core/doc/apache-felix-ipojo.data/iPOJO.png b/ipojo/core/doc/apache-felix-ipojo.data/iPOJO.png
new file mode 100644
index 0000000..984bcc1
--- /dev/null
+++ b/ipojo/core/doc/apache-felix-ipojo.data/iPOJO.png
Binary files differ
diff --git a/ipojo/core/doc/apache-felix-ipojo.html b/ipojo/core/doc/apache-felix-ipojo.html
new file mode 100644
index 0000000..6d9ae47
--- /dev/null
+++ b/ipojo/core/doc/apache-felix-ipojo.html
@@ -0,0 +1,171 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+
+
+<HEAD>
+ <TITLE>Apache Felix - Apache Felix iPOJO</TITLE>
+ <LINK rel="stylesheet" href="http://felix.apache.org/site/media.data/site.css" type="text/css" media="all">
+ <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ </HEAD>
+ <BODY>
+ <DIV class="title"><DIV class="logo"><A href="http://felix.apache.org/site/index.html"><IMG border="0" alt="Apache Felix" src="http://felix.apache.org/site/media.data/logo.png"></A></DIV><DIV class="header"><A href="http://www.apache.org/"><IMG border="0" alt="Apache" src="http://felix.apache.org/site/media.data/apache.png"></A></DIV></DIV>
+ <DIV class="menu">
+ <UL>
+ <LI><A href="http://felix.apache.org/site/news.html" title="news">news</A></LI>
+ <LI><A href="http://felix.apache.org/site/license.html" title="license">license</A></LI>
+ <LI><SPAN class="nobr"><A href="http://felix.apache.org/site/downloads.cgi" title="Visit page outside Confluence" rel="nofollow">downloads<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/documentation.html" title="documentation">documentation</A></LI>
+ <LI><A href="http://felix.apache.org/site/mailinglists.html" title="mailinglists">mailing lists</A></LI>
+ <LI><A href="http://felix.apache.org/site/contributing.html" title="Contributing">contributing</A></LI>
+ <LI><SPAN class="nobr"><A href="http://www.apache.org/" title="Visit page outside Confluence" rel="nofollow">asf<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>
+<!-- ApacheCon Ad -->
+<IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+<P style="height: 100px">
+<!-- ApacheCon Ad --></LI>
+</UL>
+ </DIV>
+ <DIV class="main">
+<TABLE class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR>
+<TD class="confluenceTd" valign="top" width="80%">
+<H1><A name="ApacheFelixiPOJO-%21iPOJO.png%21"></A><IMG src="http://felix.apache.org/site/apache-felix-ipojo.data/iPOJO.png" align="absmiddle" border="0"></H1>
+
+<H2><A name="ApacheFelixiPOJO-Overview"></A>Overview</H2>
+
+<P>iPOJO is a service component runtime aiming to simplify OSGi application development. Based on the concept of POJO, application logic is developped easily. Non functional properties are <EM>injected</EM> in the component at runtime.</P>
+
+<P>iPOJO strength points are :</P>
+<UL>
+ <LI>components are developped as POJO</LI>
+ <LI>the component model is extensible</LI>
+ <LI>the standard component model manages service providing and service dependencies</LI>
+ <LI>iPOJO manages the component instance lifecycle and the environment dynamics</LI>
+ <LI>iPOJO provides a powerful composition system by merging component based and service based concepts</LI>
+</UL>
+
+
+<H2><A name="ApacheFelixiPOJO-Gettingstarted"></A>Getting started</H2>
+
+<P>The easiest way to get involved in iPOJO is to try it out. See the Quick Start Guide for how to get up and running with the iPOJO framework and the downloads page for more information on acquiring iPOJO & related tools.</P>
+
+<H2><A name="ApacheFelixiPOJO-What%27snews"></A>What's news</H2>
+
+
+ <DIV class="blogSurtitle">
+ <IMG src="http://cwiki.apache.org/confluence/images/icons/blogentry_16.gif" height="16" width="16" border="0" align="absmiddle">
+ <A class="blogDate" href="http://cwiki.apache.org/confluence/pages/viewblogposts.action?key=FELIX&postingDate=2008%2F4%2F27&period=5">Sunday, April 27, 2008</A>
+ </DIV>
+
+
+<DIV class="blogpost" style="margin-bottom: 30px">
+ <DIV class="blogHeading"><A href="http://felix.apache.org/site/2008/04/27/new-ipojo-eclipse-plug-in.html">New iPOJO Eclipse Plug-in</A></DIV>
+
+ <DIV class="pagesubheading">
+ Labels: <A href="http://cwiki.apache.org/confluence/label/ipojo">ipojo</A> </DIV>
+ <DIV class="wiki-content">
+ <P>The iPOJO Eclipse plug-in supporting the 0.7.6 version is out. Nothing changes except the used iPOJO manipulator and the embedded BND version.<BR>
+More information on <A href="http://felix.apache.org/site/ipojo-eclipse-plug-in.html" title="iPOJO Eclipse Plug-in">iPOJO Eclipse Plug-in</A></P>
+
+
+
+ </DIV>
+ <DIV class="endsection">
+ <B>Posted at 27 Apr @ 8:12 AM</B> by
+ <IMG src="http://cwiki.apache.org/confluence/images/icons/user_16.gif" height="16" width="16" border="0" align="absmiddle" title="User Profile: Clement Escoffier">
+ <A href="http://cwiki.apache.org/confluence/users/viewuserprofile.action?username=clement.escoffier">Clement Escoffier</A> |
+ <IMG src="http://cwiki.apache.org/confluence/images/icons/comment_16.gif" height="16" width="16" border="0" align="absmiddle">
+ <A href="http://felix.apache.org/site/2008/04/27/new-ipojo-eclipse-plug-in.html#comments">0 comments</A>
+
+
+ </DIV>
+</DIV>
+ <DIV class="blogSurtitle">
+ <IMG src="http://cwiki.apache.org/confluence/images/icons/blogentry_16.gif" height="16" width="16" border="0" align="absmiddle">
+ <A class="blogDate" href="http://cwiki.apache.org/confluence/pages/viewblogposts.action?key=FELIX&postingDate=2008%2F4%2F15&period=5">Tuesday, April 15, 2008</A>
+ </DIV>
+
+
+<DIV class="blogpost" style="margin-bottom: 30px">
+ <DIV class="blogHeading"><A href="http://felix.apache.org/site/2008/04/15/commit-of-the-ipojo-076.html">Commit of the iPOJO 0.7.6</A></DIV>
+
+ <DIV class="pagesubheading">
+ Labels: <A href="http://cwiki.apache.org/confluence/label/ipojo">ipojo</A> </DIV>
+ <DIV class="wiki-content">
+ <P>This new version has a lot of new features both for users and developers. For the user, new handlers managing white board pattern and extender pattern were added. This version supports Managed Service too, allowing dynamic reconfiguration of instances. For developer, this version generalizes method interception and so it is now possible to be notified of any entry, exit and error occurring in methods. Moreover, it improves greatly performances!<BR>
+Last interesting feature,...</P>
+ </DIV>
+ <DIV class="endsection">
+ <B>Posted at 15 Apr @ 4:32 PM</B> by
+ <IMG src="http://cwiki.apache.org/confluence/images/icons/user_16.gif" height="16" width="16" border="0" align="absmiddle" title="User Profile: Clement Escoffier">
+ <A href="http://cwiki.apache.org/confluence/users/viewuserprofile.action?username=clement.escoffier">Clement Escoffier</A> |
+ <IMG src="http://cwiki.apache.org/confluence/images/icons/comment_16.gif" height="16" width="16" border="0" align="absmiddle">
+ <A href="http://felix.apache.org/site/2008/04/15/commit-of-the-ipojo-076.html#comments">0 comments</A>
+
+
+ </DIV>
+</DIV>
+</TD>
+<TD class="confluenceTd" valign="top" width="20%">
+<H6><A name="ApacheFelixiPOJO-Overview"></A><B>Overview</B></H6>
+<UL>
+ <LI><A href="#" title="Apache Felix iPOJO">Home Page</A></LI>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-feature-overview.html" title="Apache Felix iPOJO Feature Overview">iPOJO Feature Overview</A></LI>
+ <LI><A href="http://felix.apache.org/site/download.html" title="Download">Download & Install </A></LI>
+</UL>
+
+
+<H6><A name="ApacheFelixiPOJO-GettingStarted"></A><B>Getting Started</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-in-10-minutes.html" title="iPOJO in 10 minutes">iPOJO in 10 minutes</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-hello-word-maven-based-tutorial.html" title="iPOJO Hello Word (Maven-Based) tutorial">iPOJO Hello Word (Maven-Based) tutorial</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-tutorial.html" title="iPOJO Advanced Tutorial">iPOJO Advanced Tutorial</A></LI>
+</UL>
+
+
+<H6><A name="ApacheFelixiPOJO-UserGuide"></A><B>User Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/describing-components.html" title="Describing components">Describing components</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-annotations.html" title="How to use iPOJO Annotations">How to use iPOJO Annotations</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-topics.html" title="iPOJO Advanced Topics">Advanced Topics</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-faq.html" title="iPOJO FAQ">FAQ</A></LI>
+</UL>
+
+
+<H6><A name="ApacheFelixiPOJO-Tools"></A><B>Tools</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-eclipse-plug-in.html" title="iPOJO Eclipse Plug-in">iPOJO Eclipse Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-ant-task.html" title="iPOJO Ant Task">iPOJO Ant Task</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-maven-plug-in.html" title="iPOJO Maven Plug-in">iPOJO Maven Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-concepts-overview.html" title="iPOJO Concepts Overview">iPOJO concepts overview</A></LI>
+</UL>
+
+
+<H6><A name="ApacheFelixiPOJO-DeveloperGuide"></A><B>Developer Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/how-to-write-your-own-handler.html" title="How to write your own handler">How to write your own handler</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-manipulation-metadata.html" title="How to use iPOJO Manipulation Metadata">How to use iPOJO Manipulation Metadata</A></LI>
+</UL>
+
+
+<H6><A name="ApacheFelixiPOJO-Misc%26Contact"></A><B>Misc & Contact</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-issuestracker.html" title="apache-felix-ipojo-issuestracker">Issues Tracker</A></LI>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-supportedvms.html" title="apache-felix-ipojo-supportedVMs">Supported JVMs</A></LI>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-supportedosgi.html" title="apache-felix-ipojo-supportedOSGi">Supported OSGi Implementations</A></LI>
+ <LI><A href="http://felix.apache.org/site/future-ideas.html" title="Future Ideas">Future Ideas</A></LI>
+ <LI><A href="http://felix.apache.org/site/contact.html" title="Contact">Contact</A></LI>
+ <LI><A href="http://felix.apache.org/site/related-works.html" title="Related Works">Related Works</A></LI>
+ <LI><A href="http://felix.apache.org/site/article-presentations.html" title="Article & Presentations">Article & Presentations</A></LI>
+</UL>
+
+
+<HR>
+<DIV class="" align="center">
+<P><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/createrssfeed.action?types=blogpost&statuses=created&statuses=modified&spaces=FELIX&labelString=iPOJO&rssType=atom&maxResults=10&timeSpan=5&publicFeed=true&title=iPOJO%20Atom%20Feed" title="Stay tuned!" rel="nofollow"><IMG src="http://cwiki.apache.org/confluence/images/icons/feed-icon-32x32.png" align="absmiddle" border="0"><SUP><IMG class="rendericon" src="http://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>
+ </DIV>
+ </BODY>
+
+
+</HTML>
diff --git a/ipojo/core/doc/architecture-handler.html b/ipojo/core/doc/architecture-handler.html
new file mode 100644
index 0000000..52c9c55
--- /dev/null
+++ b/ipojo/core/doc/architecture-handler.html
@@ -0,0 +1,135 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+
+
+<HEAD>
+ <TITLE>Apache Felix - Architecture Handler</TITLE>
+ <LINK rel="stylesheet" href="http://felix.apache.org/site/media.data/site.css" type="text/css" media="all">
+ <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ </HEAD>
+ <BODY>
+ <DIV class="title"><DIV class="logo"><A href="http://felix.apache.org/site/index.html"><IMG border="0" alt="Apache Felix" src="http://felix.apache.org/site/media.data/logo.png"></A></DIV><DIV class="header"><A href="http://www.apache.org/"><IMG border="0" alt="Apache" src="http://felix.apache.org/site/media.data/apache.png"></A></DIV></DIV>
+ <DIV class="menu">
+
+
+
+
+
+ <UL>
+ <LI><A href="http://felix.apache.org/site/news.html" title="news">news</A></LI>
+ <LI><A href="http://felix.apache.org/site/license.html" title="license">license</A></LI>
+ <LI><SPAN class="nobr"><A href="http://felix.apache.org/site/downloads.cgi" title="Visit page outside Confluence" rel="nofollow">downloads<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/documentation.html" title="documentation">documentation</A></LI>
+ <LI><A href="http://felix.apache.org/site/mailinglists.html" title="mailinglists">mailing lists</A></LI>
+ <LI><A href="http://felix.apache.org/site/contributing.html" title="Contributing">contributing</A></LI>
+ <LI><SPAN class="nobr"><A href="http://www.apache.org/" title="Visit page outside Confluence" rel="nofollow">asf<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>
+<!-- ApacheCon Ad -->
+<IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+<P style="height: 100px">
+<!-- ApacheCon Ad --></LI>
+</UL>
+ </DIV>
+ <DIV class="main">
+<TABLE class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR>
+<TD class="confluenceTd" valign="top" width="80%">
+<H1><A name="ArchitectureHandler-IntrospectionandArchitecture"></A>Introspection and Architecture</H1>
+
+<P>The architecture feature allows obtaining an architectural / component view of your systems. It exposes a snapshot of the present instances & factories, the state of these instances ...<BR>
+Moreover; iPOJO defines an 'arch' command displaying this architecture in Felix. You need to install the arch command bundle available in the Felix trunk.</P>
+
+<H2><A name="ArchitectureHandler-Reflectiononthecomponent"></A>Reflection on the component</H2>
+
+<P>The architecture feature does "reflection" on the iPOJO containers. It gathers information about the component (state, class name ...), requirement (state, multiple, optional ...), provided services (state, properties) ... Each handler can participate to the architecture. This information allows you to know why an instance does not start, or why the component does not publish / provide a service.</P>
+
+<H2><A name="ArchitectureHandler-Metadata"></A>Metadata</H2>
+
+<P>The architecture (i.e. instance introspection) is activated by default. To disable it, you need to add an attribute <EM>"architecture=false"</EM> to the component element:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><Component className=<SPAN class="code-quote">"fr.imag.adele.escoffier.hello.impl.HelloServiceImpl"</SPAN> architecture=<SPAN class="code-quote">"false"</SPAN>></SPAN></PRE>
+</DIV></DIV>
+<P>By default, the architecture feature is enabled.</P>
+
+<H2><A name="ArchitectureHandler-The%22arch%22command"></A>The "arch" command</H2>
+
+<P>A Felix command comes with the architecture handler. This command looks for all component exposing the architecture and print the information.</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">arch => displays instances name & state (equivalent to arch \-instances)
+arch -instance $instance_name => displays complete information about the instance $instance_name
+arch -factories => display the list of available factories
+arch -factory $factory_name => display complete information about the factory $factory_name</PRE>
+</DIV></DIV>
+<H2><A name="ArchitectureHandler-Technicalinformation"></A>Technical information</H2>
+
+<P>In fact, when a component enables the architecture introspection, its container exposes an Architecture service. Any architecture requester can obtain information about the instance. For example, the arch command requests all the architecture services and prints the information.</P>
+</TD>
+<TD class="confluenceTd" valign="top" width="20%">
+<FORM method="get" class="confluence-searchbox marginlessForm " action="http://felix.apache.org/confluence/dosearchsite.action">
+ <INPUT type="hidden" name="searchQuery.spaceKey" value="FELIX">
+ <INPUT type="text" name="searchQuery.queryString">
+ <INPUT type="submit" value="Search">
+</FORM>
+<HR>
+<H6><A name="ArchitectureHandler-Overview"></A><B>Overview</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo.html" title="Apache Felix iPOJO">Home Page</A></LI>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-feature-overview.html" title="Apache Felix iPOJO Feature Overview">iPOJO Feature Overview</A></LI>
+ <LI><A href="http://felix.apache.org/site/download.html" title="Download">Download & Install </A></LI>
+</UL>
+
+
+<H6><A name="ArchitectureHandler-GettingStarted"></A><B>Getting Started</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-in-10-minutes.html" title="iPOJO in 10 minutes">iPOJO in 10 minutes</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-hello-word-maven-based-tutorial.html" title="iPOJO Hello Word (Maven-Based) tutorial">iPOJO Hello Word (Maven-Based) tutorial</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-tutorial.html" title="iPOJO Advanced Tutorial">iPOJO Advanced Tutorial</A></LI>
+</UL>
+
+
+<H6><A name="ArchitectureHandler-UserGuide"></A><B>User Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/describing-components.html" title="Describing components">Describing components</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-annotations.html" title="How to use iPOJO Annotations">How to use iPOJO Annotations</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-topics.html" title="iPOJO Advanced Topics">Advanced Topics</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-faq.html" title="iPOJO FAQ">FAQ</A></LI>
+</UL>
+
+
+<H6><A name="ArchitectureHandler-Tools"></A><B>Tools</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-eclipse-plug-in.html" title="iPOJO Eclipse Plug-in">iPOJO Eclipse Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-ant-task.html" title="iPOJO Ant Task">iPOJO Ant Task</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-maven-plug-in.html" title="iPOJO Maven Plug-in">iPOJO Maven Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-concepts-overview.html" title="iPOJO Concepts Overview">iPOJO concepts overview</A></LI>
+</UL>
+
+
+<H6><A name="ArchitectureHandler-DeveloperGuide"></A><B>Developer Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/how-to-write-your-own-handler.html" title="How to write your own handler">How to write your own handler</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-manipulation-metadata.html" title="How to use iPOJO Manipulation Metadata">How to use iPOJO Manipulation Metadata</A></LI>
+</UL>
+
+
+<H6><A name="ArchitectureHandler-Misc%26Contact"></A><B>Misc & Contact</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-issuestracker.html" title="apache-felix-ipojo-issuestracker">Issues Tracker</A></LI>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-supportedvms.html" title="apache-felix-ipojo-supportedVMs">Supported JVMs</A></LI>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-supportedosgi.html" title="apache-felix-ipojo-supportedOSGi">Supported OSGi Implementations</A></LI>
+ <LI><A href="http://felix.apache.org/site/future-ideas.html" title="Future Ideas">Future Ideas</A></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Contact&linkCreation=true&fromPageId=82824" title="Create Page: Contact" class="createlink">Contact<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/related-works.html" title="Related Works">Related Works</A></LI>
+ <LI><A href="http://felix.apache.org/site/article-presentations.html" title="Article & Presentations">Article & Presentations</A></LI>
+</UL>
+
+
+<HR>
+<DIV class="" align="center">
+<P><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/createrssfeed.action?types=blogpost&statuses=created&statuses=modified&spaces=FELIX&labelString=iPOJO&rssType=atom&maxResults=10&timeSpan=5&publicFeed=true&title=iPOJO%20Atom%20Feed" title="Stay tuned!" rel="nofollow"><IMG src="http://cwiki.apache.org/confluence/images/icons/feed-icon-32x32.png" align="absmiddle" border="0"><SUP><IMG class="rendericon" src="http://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>
+ </DIV>
+ </BODY>
+
+
+</HTML>
diff --git a/ipojo/core/doc/configuration-handler.html b/ipojo/core/doc/configuration-handler.html
new file mode 100644
index 0000000..6070284
--- /dev/null
+++ b/ipojo/core/doc/configuration-handler.html
@@ -0,0 +1,171 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+
+
+<HEAD>
+ <TITLE>Apache Felix - Configuration Handler</TITLE>
+ <LINK rel="stylesheet" href="http://felix.apache.org/site/media.data/site.css" type="text/css" media="all">
+ <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ </HEAD>
+ <BODY>
+ <DIV class="title"><DIV class="logo"><A href="http://felix.apache.org/site/index.html"><IMG border="0" alt="Apache Felix" src="http://felix.apache.org/site/media.data/logo.png"></A></DIV><DIV class="header"><A href="http://www.apache.org/"><IMG border="0" alt="Apache" src="http://felix.apache.org/site/media.data/apache.png"></A></DIV></DIV>
+ <DIV class="menu">
+ <UL>
+ <LI><A href="http://felix.apache.org/site/news.html" title="news">news</A></LI>
+ <LI><A href="http://felix.apache.org/site/license.html" title="license">license</A></LI>
+ <LI><SPAN class="nobr"><A href="http://felix.apache.org/site/downloads.cgi" title="Visit page outside Confluence" rel="nofollow">downloads<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/documentation.html" title="documentation">documentation</A></LI>
+ <LI><A href="http://felix.apache.org/site/mailinglists.html" title="mailinglists">mailing lists</A></LI>
+ <LI><A href="http://felix.apache.org/site/contributing.html" title="Contributing">contributing</A></LI>
+ <LI><SPAN class="nobr"><A href="http://www.apache.org/" title="Visit page outside Confluence" rel="nofollow">asf<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>
+<!-- ApacheCon Ad -->
+<IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+<P style="height: 100px">
+<!-- ApacheCon Ad --></LI>
+</UL>
+ </DIV>
+ <DIV class="main">
+<TABLE class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR>
+<TD class="confluenceTd" valign="top" width="80%">
+<H1><A name="ConfigurationHandler-ConfigurationHandler"></A>Configuration Handler</H1>
+
+<P>The configuration handler aims to manage component configuration. This handler allows the configuration and dynamic reconfiguration of instances. A configuration is a set of couple (name, value). The name can be a field name or a property name associated to a field or/and a method.</P>
+
+<H2><A name="ConfigurationHandler-ConfigurablePropertyconfiguration"></A>Configurable Property configuration</H2>
+
+<P>To support configuration, the component type needs to declare which properties are configurable. These properties are not necessarily service property but can be internal component property.</P>
+
+
+<H2><A name="ConfigurationHandler-Examples"></A>Examples</H2>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><iPOJO></SPAN>
+<SPAN class="code-tag"><Component className=<SPAN class="code-quote">"fr.imag.adele.escoffier.hello.impl.HelloServiceImpl"</SPAN>></SPAN>
+ <SPAN class="code-tag"><Provides></SPAN>
+ <SPAN class="code-tag"><Property name=<SPAN class="code-quote">"foo"</SPAN> field=<SPAN class="code-quote">"m_foo"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></Provides></SPAN>
+ <SPAN class="code-tag"><Properties propagation=<SPAN class="code-quote">"false"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><Property name=<SPAN class="code-quote">"foo"</SPAN> field=<SPAN class="code-quote">"m_foo"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><Property name=<SPAN class="code-quote">"array"</SPAN> method=<SPAN class="code-quote">"updateArray"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><Properties name=<SPAN class="code-quote">"hello.language"</SPAN> type=<SPAN class="code-quote">"java.lang.String"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></Properties></SPAN>
+<SPAN class="code-tag"></Component></SPAN>
+
+<SPAN class="code-tag"><instance component=<SPAN class="code-quote">"fr.imag.adele.escoffier.hello.impl.HelloServiceImpl"</SPAN> name=<SPAN class="code-quote">"HelloService"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"foo"</SPAN> value=<SPAN class="code-quote">"bar"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"array"</SPAN> value=<SPAN class="code-quote">"\{1, 2, 3}"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"hello.language"</SPAN> value=<SPAN class="code-quote">"en"</SPAN>/></SPAN>
+</instance
+<SPAN class="code-tag"></iPOJO></SPAN></PRE>
+</DIV></DIV>
+<P>In the previous snippet, you can see three configurable properties. The first is a configurable property attached to the field 'foo' that is a service property too. The second is an array property attached to a method (updatArray). The third property is a <EM>static</EM> property, in the sense that neither field nor method is attached to this property.</P>
+
+<P>These three properties are configured by the instance configuration.</P>
+
+<P>By setting the attribute <B>propagation</B> to <B>"true"</B>, you allow the property propagation to the service registration. It means that at each time that the configuration of the instance is updated; all properties contained in the configuration are propagated to the service registrations. For example, in the previous example, not only <EM>foo</EM> will be published but <EM>array</EM> and <EM>hello.language</EM> are also published.<BR>
+If a property has a method, this method is invoked each time that the property value changes (the method is called to push the initial value just after the constructor). The method receives one argument of the type of the property (an integer array in the example).</P>
+
+<H2><A name="ConfigurationHandler-ExposingaManagedService"></A>Exposing a Managed Service</H2>
+<P>The ManagedService is a service specified in the OSGi Compendium. It allows reconfiguring an instance with the Configuration Admin. There is two way for an iPOJO instance to expose a Managed Service.<BR>
+• In the component type description by adding the <EM>pid</EM> attribute in the properties element <BR>
+• In the instance configuration by configuring the <EM>managed.service.pid</EM> property</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><iPOJO></SPAN>
+<SPAN class="code-tag"><Component className=<SPAN class="code-quote">"fr.imag.adele.escoffier.hello.impl.HelloServiceImpl"</SPAN>></SPAN>
+ <SPAN class="code-tag"><Provides></SPAN>
+ <SPAN class="code-tag"><Property name=<SPAN class="code-quote">"foo"</SPAN> field=<SPAN class="code-quote">"m_foo"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></Provides></SPAN>
+ <SPAN class="code-tag"><Properties propagation=<SPAN class="code-quote">"false"</SPAN> pid=<SPAN class="code-quote">"mymanagedservicepid"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><Property name=<SPAN class="code-quote">"foo"</SPAN> field=<SPAN class="code-quote">"m_foo"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><Property name=<SPAN class="code-quote">"array"</SPAN> method=<SPAN class="code-quote">"updateArray"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><Properties name=<SPAN class="code-quote">"hello.language"</SPAN> type=<SPAN class="code-quote">"java.lang.String"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></Properties></SPAN>
+<SPAN class="code-tag"></Component></SPAN>
+
+<SPAN class="code-tag"><instance component=<SPAN class="code-quote">"fr.imag.adele.escoffier.hello.impl.HelloServiceImpl"</SPAN> name=<SPAN class="code-quote">"HelloService"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"foo"</SPAN> value=<SPAN class="code-quote">"bar"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"array"</SPAN> value=<SPAN class="code-quote">"\{1, 2, 3}"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"hello.language"</SPAN> value=<SPAN class="code-quote">"en"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"managed.service.pid"</SPAN> value=<SPAN class="code-quote">"mymanagedservicepid2"</SPAN>/></SPAN>
+</instance
+<SPAN class="code-tag"></iPOJO></SPAN></PRE>
+</DIV></DIV>
+<P><EM>Note</EM>: if specified in the two locations, the instance configuration is used.</P>
+
+<P>The managed service pid is the identifier used by the Configuration Admin to attach configuration to Managed Services. First this pid must be unique (as any pid in OSGi). Moreover, this pid cannot be the same one that the pid used in the Managed Service Factory to create the instance (if you use this way to create your instance).</P>
+
+<P>When an instance is reconfigured with the Managed Service, the configuration is propagated if the propagation is enabled.</P>
+
+<H2><A name="ConfigurationHandler-DynamicReconfigurationusingFactoriesorManagedServiceFactories"></A>Dynamic Reconfiguration using Factories or ManagedServiceFactories</H2>
+<P>The handler supports reconfiguration. To reconfigure an instance you can use both iPOJO Factory and the ManagedServiceFactory exposed by the factory of the targeted instance. By calling the method <EM>reconfigure</EM> or <EM>update</EM> (according of the service do you use), the handler receive the new configuration and apply it. If the propagation is activated, the service registrations are updated too.</P></TD>
+<TD class="confluenceTd" valign="top" width="20%">
+<FORM method="get" class="confluence-searchbox marginlessForm " action="http://felix.apache.org/confluence/dosearchsite.action">
+ <INPUT type="hidden" name="searchQuery.spaceKey" value="FELIX">
+ <INPUT type="text" name="searchQuery.queryString">
+ <INPUT type="submit" value="Search">
+</FORM>
+<HR>
+<H6><A name="ConfigurationHandler-Overview"></A><B>Overview</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-2.html" title="Apache Felix iPOJO-2">Home Page</A></LI>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-feature-overview.html" title="Apache Felix iPOJO Feature Overview">iPOJO Feature Overview</A></LI>
+ <LI><A href="http://felix.apache.org/site/download.html" title="Download">Download & Install </A></LI>
+</UL>
+
+
+<H6><A name="ConfigurationHandler-GettingStarted"></A><B>Getting Started</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-in-10-minutes.html" title="iPOJO in 10 minutes">iPOJO in 10 minutes</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-hello-word-maven-based-tutorial.html" title="iPOJO Hello Word (Maven-Based) tutorial">iPOJO Hello Word (Maven-Based) tutorial</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-tutorial.html" title="iPOJO Advanced Tutorial">iPOJO Advanced Tutorial</A></LI>
+</UL>
+
+
+<H6><A name="ConfigurationHandler-UserGuide"></A><B>User Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/describing-components.html" title="Describing components">Describing components</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-annotations.html" title="How to use iPOJO Annotations">How to use iPOJO Annotations</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-topics.html" title="iPOJO Advanced Topics">Advanced Topics</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-faq.html" title="iPOJO FAQ">FAQ</A></LI>
+</UL>
+
+
+<H6><A name="ConfigurationHandler-Tools"></A><B>Tools</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-eclipse-plug-in.html" title="iPOJO Eclipse Plug-in">iPOJO Eclipse Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-ant-task.html" title="iPOJO Ant Task">iPOJO Ant Task</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-maven-plug-in.html" title="iPOJO Maven Plug-in">iPOJO Maven Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-concepts-overview.html" title="iPOJO Concepts Overview">iPOJO concepts overview</A></LI>
+</UL>
+
+
+<H6><A name="ConfigurationHandler-DeveloperGuide"></A><B>Developer Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/how-to-write-your-own-handler.html" title="How to write your own handler">How to write your own handler</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-manipulation-metadata.html" title="How to use iPOJO Manipulation Metadata">How to use iPOJO Manipulation Metadata</A></LI>
+</UL>
+
+
+<H6><A name="ConfigurationHandler-Misc%26Contact"></A><B>Misc & Contact</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-issuestracker.html" title="apache-felix-ipojo-issuestracker">Issues Tracker</A></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Supported%20JVMs&linkCreation=true&fromPageId=82824" title="Create Page: Supported JVMs" class="createlink">Supported JVMs<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Supported%20OSGi%20Implementations&linkCreation=true&fromPageId=82824" title="Create Page: Supported OSGi Implementations" class="createlink">Supported OSGi Implementations<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/future-ideas.html" title="Future Ideas">Future Ideas</A></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Contact&linkCreation=true&fromPageId=82824" title="Create Page: Contact" class="createlink">Contact<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/related-works.html" title="Related Works">Related Works</A></LI>
+ <LI><A href="http://felix.apache.org/site/article-presentations.html" title="Article & Presentations">Article & Presentations</A></LI>
+</UL>
+
+
+<HR>
+<DIV class="" align="center">
+<P><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/createrssfeed.action?types=blogpost&statuses=created&statuses=modified&spaces=FELIX&labelString=iPOJO&rssType=atom&maxResults=10&timeSpan=5&publicFeed=true&title=iPOJO%20Atom%20Feed" title="Stay tuned!" rel="nofollow"><IMG src="http://cwiki.apache.org/confluence/images/icons/feed-icon-32x32.png" align="absmiddle" border="0"><SUP><IMG class="rendericon" src="http://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>
+ </DIV>
+ </BODY>
+
+
+</HTML>
diff --git a/ipojo/core/doc/controller-lifecycle-handler.html b/ipojo/core/doc/controller-lifecycle-handler.html
new file mode 100644
index 0000000..aae21b4
--- /dev/null
+++ b/ipojo/core/doc/controller-lifecycle-handler.html
@@ -0,0 +1,141 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+
+
+<HEAD>
+ <TITLE>Apache Felix - Controller Lifecycle Handler</TITLE>
+ <LINK rel="stylesheet" href="http://felix.apache.org/site/media.data/site.css" type="text/css" media="all">
+ <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ </HEAD>
+ <BODY>
+ <DIV class="title"><DIV class="logo"><A href="http://felix.apache.org/site/index.html"><IMG border="0" alt="Apache Felix" src="http://felix.apache.org/site/media.data/logo.png"></A></DIV><DIV class="header"><A href="http://www.apache.org/"><IMG border="0" alt="Apache" src="http://felix.apache.org/site/media.data/apache.png"></A></DIV></DIV>
+ <DIV class="menu">
+ <UL>
+ <LI><A href="http://felix.apache.org/site/news.html" title="news">news</A></LI>
+ <LI><A href="http://felix.apache.org/site/license.html" title="license">license</A></LI>
+ <LI><SPAN class="nobr"><A href="http://felix.apache.org/site/downloads.cgi" title="Visit page outside Confluence" rel="nofollow">downloads<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/documentation.html" title="documentation">documentation</A></LI>
+ <LI><A href="http://felix.apache.org/site/mailinglists.html" title="mailinglists">mailing lists</A></LI>
+ <LI><A href="http://felix.apache.org/site/contributing.html" title="Contributing">contributing</A></LI>
+ <LI><SPAN class="nobr"><A href="http://www.apache.org/" title="Visit page outside Confluence" rel="nofollow">asf<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>
+<!-- ApacheCon Ad -->
+<IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+<P style="height: 100px">
+<!-- ApacheCon Ad --></LI>
+</UL>
+ </DIV>
+ <DIV class="main">
+<TABLE class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR>
+<TD class="confluenceTd" valign="top" width="80%">
+<P>The controller lifecycle handler allows a component implementation to participate to the instance lifecycle. This handler allows you checking instances configuration (file existence for instance).</P>
+
+<H2><A name="ControllerLifecycleHandler-iPOJOInstanceLifecycle%26Lifecyclecontroller"></A>iPOJO Instance Lifecycle & Lifecycle controller</H2>
+
+<P>Once started, iPOJO instances can be either valid or invalid. The decision comes from handlers. An instance is valid if every plugged handler are valid. As soos as one handler becomes invalid, the instance becomes invalid.</P>
+
+<P>The lifecycle controller just monitors a field inside the POJO class. When this field becomes 'false', the handler becomes invalid. When the field get the 'true' value, the handler becomes valid.</P>
+
+<H2><A name="ControllerLifecycleHandler-Anexemple"></A>An exemple</H2>
+
+<P>Imagine the following component :</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class LifecycleControllerTest {
+
+ <SPAN class="code-keyword">private</SPAN> <SPAN class="code-object">boolean</SPAN> m_state;
+ <SPAN class="code-keyword">private</SPAN> <SPAN class="code-object">String</SPAN> m_conf;
+
+ <SPAN class="code-keyword">public</SPAN> void setConf(<SPAN class="code-object">String</SPAN> newConf) {
+ <SPAN class="code-object">System</SPAN>.out.println(<SPAN class="code-quote">"setConf : "</SPAN> + newConf);
+ <SPAN class="code-keyword">if</SPAN> (newConf.equals(<SPAN class="code-quote">"foo"</SPAN>)) {
+ m_state = <SPAN class="code-keyword">true</SPAN>;
+ } <SPAN class="code-keyword">else</SPAN> {
+ m_state = <SPAN class="code-keyword">false</SPAN>;
+ }
+ }
+}</PRE>
+</DIV></DIV>
+<P>with the following metadata :</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component classname=<SPAN class="code-quote">"org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest"</SPAN> name=<SPAN class="code-quote">"lcTest"</SPAN> immediate=<SPAN class="code-quote">"true"</SPAN> architecture=<SPAN class="code-quote">"true"</SPAN>></SPAN>
+ <SPAN class="code-tag"><controller field=<SPAN class="code-quote">"m_state"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><properties></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"conf"</SPAN> field=<SPAN class="code-quote">"m_conf"</SPAN> method=<SPAN class="code-quote">"setConf"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></properties></SPAN>
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+<P>This component declares the 'm_state' field as a lifecycle controller (<controller/> element)</P>
+
+
+<P>The component requires the 'conf' property. iPOJO checks if this property is inside the pushed configuration, but cannot checks if the configuration is correct according to the component. When the instance is created, the setConf method is called with the pushed value. If the given 'conf' property is "foo" the 'm_state' field (i.e. the controller) becomes true. Else, the 'm_state' receives the false value. It means that the lifecycle controller handler becomes invalid and as a consequence, the instance becomes invalid.</P>
+</TD>
+<TD class="confluenceTd" valign="top" width="20%">
+<FORM method="get" class="confluence-searchbox marginlessForm " action="http://felix.apache.org/confluence/dosearchsite.action">
+ <INPUT type="hidden" name="searchQuery.spaceKey" value="FELIX">
+ <INPUT type="text" name="searchQuery.queryString">
+ <INPUT type="submit" value="Search">
+</FORM>
+<HR>
+<H6><A name="ControllerLifecycleHandler-Overview"></A><B>Overview</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-2.html" title="Apache Felix iPOJO-2">Home Page</A></LI>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-feature-overview.html" title="Apache Felix iPOJO Feature Overview">iPOJO Feature Overview</A></LI>
+ <LI><A href="http://felix.apache.org/site/download.html" title="Download">Download & Install </A></LI>
+</UL>
+
+
+<H6><A name="ControllerLifecycleHandler-GettingStarted"></A><B>Getting Started</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-in-10-minutes.html" title="iPOJO in 10 minutes">iPOJO in 10 minutes</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-hello-word-maven-based-tutorial.html" title="iPOJO Hello Word (Maven-Based) tutorial">iPOJO Hello Word (Maven-Based) tutorial</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-tutorial.html" title="iPOJO Advanced Tutorial">iPOJO Advanced Tutorial</A></LI>
+</UL>
+
+
+<H6><A name="ControllerLifecycleHandler-UserGuide"></A><B>User Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/describing-components.html" title="Describing components">Describing components</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-annotations.html" title="How to use iPOJO Annotations">How to use iPOJO Annotations</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-topics.html" title="iPOJO Advanced Topics">Advanced Topics</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-faq.html" title="iPOJO FAQ">FAQ</A></LI>
+</UL>
+
+
+<H6><A name="ControllerLifecycleHandler-Tools"></A><B>Tools</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-eclipse-plug-in.html" title="iPOJO Eclipse Plug-in">iPOJO Eclipse Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-ant-task.html" title="iPOJO Ant Task">iPOJO Ant Task</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-maven-plug-in.html" title="iPOJO Maven Plug-in">iPOJO Maven Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-concepts-overview.html" title="iPOJO Concepts Overview">iPOJO concepts overview</A></LI>
+</UL>
+
+
+<H6><A name="ControllerLifecycleHandler-DeveloperGuide"></A><B>Developer Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/how-to-write-your-own-handler.html" title="How to write your own handler">How to write your own handler</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-manipulation-metadata.html" title="How to use iPOJO Manipulation Metadata">How to use iPOJO Manipulation Metadata</A></LI>
+</UL>
+
+
+<H6><A name="ControllerLifecycleHandler-Misc%26Contact"></A><B>Misc & Contact</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-issuestracker.html" title="apache-felix-ipojo-issuestracker">Issues Tracker</A></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Supported%20JVMs&linkCreation=true&fromPageId=82824" title="Create Page: Supported JVMs" class="createlink">Supported JVMs<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Supported%20OSGi%20Implementations&linkCreation=true&fromPageId=82824" title="Create Page: Supported OSGi Implementations" class="createlink">Supported OSGi Implementations<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/future-ideas.html" title="Future Ideas">Future Ideas</A></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Contact&linkCreation=true&fromPageId=82824" title="Create Page: Contact" class="createlink">Contact<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/related-works.html" title="Related Works">Related Works</A></LI>
+ <LI><A href="http://felix.apache.org/site/article-presentations.html" title="Article & Presentations">Article & Presentations</A></LI>
+</UL>
+
+
+<HR>
+<DIV class="" align="center">
+<P><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/createrssfeed.action?types=blogpost&statuses=created&statuses=modified&spaces=FELIX&labelString=iPOJO&rssType=atom&maxResults=10&timeSpan=5&publicFeed=true&title=iPOJO%20Atom%20Feed" title="Stay tuned!" rel="nofollow"><IMG src="http://cwiki.apache.org/confluence/images/icons/feed-icon-32x32.png" align="absmiddle" border="0"><SUP><IMG class="rendericon" src="http://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>
+ </DIV>
+ </BODY>
+
+
+</HTML>
diff --git a/ipojo/core/doc/describing-components.html b/ipojo/core/doc/describing-components.html
new file mode 100644
index 0000000..fc5ac53
--- /dev/null
+++ b/ipojo/core/doc/describing-components.html
@@ -0,0 +1,125 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+
+
+<HEAD>
+ <TITLE>Apache Felix - Describing components</TITLE>
+ <LINK rel="stylesheet" href="http://felix.apache.org/site/media.data/site.css" type="text/css" media="all">
+ <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ </HEAD>
+ <BODY>
+ <DIV class="title"><DIV class="logo"><A href="http://felix.apache.org/site/index.html"><IMG border="0" alt="Apache Felix" src="http://felix.apache.org/site/media.data/logo.png"></A></DIV><DIV class="header"><A href="http://www.apache.org/"><IMG border="0" alt="Apache" src="http://felix.apache.org/site/media.data/apache.png"></A></DIV></DIV>
+ <DIV class="menu">
+ <UL>
+ <LI><A href="http://felix.apache.org/site/news.html" title="news">news</A></LI>
+ <LI><A href="http://felix.apache.org/site/license.html" title="license">license</A></LI>
+ <LI><SPAN class="nobr"><A href="http://felix.apache.org/site/downloads.cgi" title="Visit page outside Confluence" rel="nofollow">downloads<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/documentation.html" title="documentation">documentation</A></LI>
+ <LI><A href="http://felix.apache.org/site/mailinglists.html" title="mailinglists">mailing lists</A></LI>
+ <LI><A href="http://felix.apache.org/site/contributing.html" title="Contributing">contributing</A></LI>
+ <LI><SPAN class="nobr"><A href="http://www.apache.org/" title="Visit page outside Confluence" rel="nofollow">asf<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>
+<!-- ApacheCon Ad -->
+<IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+<P style="height: 100px">
+<!-- ApacheCon Ad --></LI>
+</UL>
+ </DIV>
+ <DIV class="main">
+<TABLE class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR>
+<TD class="confluenceTd" valign="top" width="80%">
+
+<H1><A name="Describingcomponents-DescribingyouriPOJOcomponents"></A>Describing your iPOJO components</H1>
+
+<P>This section describes the different features supported by iPOJO. In fact, this page aims to answer to the following question: <EM>"What can I write in my iPOJO component descriptor (i.e. the metadata.xml file)?"</EM></P>
+
+<H2><A name="Describingcomponents-Corefeatures"></A>Core features</H2>
+<P>Core features are provided with the iPOJO runtime bundles. You can use it directly, as soon as the iPOJO runtime is deployed.</P>
+<UL>
+ <LI><A href="http://felix.apache.org/site/service-requirement-handler.html" title="Service Requirement Handler">Service Dependencies</A></LI>
+ <LI><A href="http://felix.apache.org/site/providing-osgi-services.html" title="Providing OSGi services">Service Providing</A></LI>
+ <LI><A href="http://felix.apache.org/site/lifecycle-callback-handler.html" title="Lifecycle Callback Handler">Lifecycle Callbacks</A></LI>
+ <LI><A href="http://felix.apache.org/site/configuration-handler.html" title="Configuration Handler">Configuration</A></LI>
+ <LI><A href="http://felix.apache.org/site/architecture-handler.html" title="Architecture Handler">Architecture</A></LI>
+ <LI><A href="http://felix.apache.org/site/controller-lifecycle-handler.html" title="Controller Lifecycle Handler">Lifecycle Controller</A></LI>
+</UL>
+
+
+<H2><A name="Describingcomponents-Extensions"></A>Extensions</H2>
+<P>Extensions <EM>extend</EM> the iPOJO model to add some specific functionalities. This is made thanks to the external handler mechanism. So before using one of these features, deploy the attached external handler.</P>
+
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-event-handler.html" title="iPOJO Event Handler">iPOJO Event Handler</A>: allows receiving and sending events through the event admin.</LI>
+ <LI><A href="http://felix.apache.org/site/jmx-handler.html" title="JMX Handler">JMX Handler</A>: allows managing your instances with JMX</LI>
+ <LI><A href="http://felix.apache.org/site/extender-pattern-handler.html" title="Extender Pattern Handler">Extender Pattern Handler</A>: simplify the implementation of extender pattern</LI>
+ <LI><A href="http://felix.apache.org/site/white-board-pattern-handler.html" title="White Board Pattern Handler">White Board Pattern Handler</A>: simplify the implementation of a white board patternh1. Describing your components</LI>
+</UL>
+
+
+<H2><A name="Describingcomponents-Amissingfunctionality%3F"></A>A missing functionality ?</H2>
+<P>iPOJO component model is extensible. So, you can implement your own handler managing you specific requirement. Refer the handler development guide (<SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=here&linkCreation=true&fromPageId=82813" title="Create Page: here" class="createlink">here<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>) for more details.</P></TD>
+<TD class="confluenceTd" valign="top" width="20%">
+<H6><A name="Describingcomponents-Overview"></A><B>Overview</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo.html" title="Apache Felix iPOJO">Home Page</A></LI>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-feature-overview.html" title="Apache Felix iPOJO Feature Overview">iPOJO Feature Overview</A></LI>
+ <LI><A href="http://felix.apache.org/site/download.html" title="Download">Download & Install </A></LI>
+</UL>
+
+
+<H6><A name="Describingcomponents-GettingStarted"></A><B>Getting Started</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-in-10-minutes.html" title="iPOJO in 10 minutes">iPOJO in 10 minutes</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-hello-word-maven-based-tutorial.html" title="iPOJO Hello Word (Maven-Based) tutorial">iPOJO Hello Word (Maven-Based) tutorial</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-tutorial.html" title="iPOJO Advanced Tutorial">iPOJO Advanced Tutorial</A></LI>
+</UL>
+
+
+<H6><A name="Describingcomponents-UserGuide"></A><B>User Guide</B></H6>
+<UL>
+ <LI><A href="#" title="Describing components">Describing components</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-annotations.html" title="How to use iPOJO Annotations">How to use iPOJO Annotations</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-topics.html" title="iPOJO Advanced Topics">Advanced Topics</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-faq.html" title="iPOJO FAQ">FAQ</A></LI>
+</UL>
+
+
+<H6><A name="Describingcomponents-Tools"></A><B>Tools</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-eclipse-plug-in.html" title="iPOJO Eclipse Plug-in">iPOJO Eclipse Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-ant-task.html" title="iPOJO Ant Task">iPOJO Ant Task</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-maven-plug-in.html" title="iPOJO Maven Plug-in">iPOJO Maven Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-concepts-overview.html" title="iPOJO Concepts Overview">iPOJO concepts overview</A></LI>
+</UL>
+
+
+<H6><A name="Describingcomponents-DeveloperGuide"></A><B>Developer Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/how-to-write-your-own-handler.html" title="How to write your own handler">How to write your own handler</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-manipulation-metadata.html" title="How to use iPOJO Manipulation Metadata">How to use iPOJO Manipulation Metadata</A></LI>
+</UL>
+
+
+<H6><A name="Describingcomponents-Misc%26Contact"></A><B>Misc & Contact</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-issuestracker.html" title="apache-felix-ipojo-issuestracker">Issues Tracker</A></LI>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-supportedvms.html" title="apache-felix-ipojo-supportedVMs">Supported JVMs</A></LI>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-supportedosgi.html" title="apache-felix-ipojo-supportedOSGi">Supported OSGi Implementations</A></LI>
+ <LI><A href="http://felix.apache.org/site/future-ideas.html" title="Future Ideas">Future Ideas</A></LI>
+ <LI><A href="http://felix.apache.org/site/contact.html" title="Contact">Contact</A></LI>
+ <LI><A href="http://felix.apache.org/site/related-works.html" title="Related Works">Related Works</A></LI>
+ <LI><A href="http://felix.apache.org/site/article-presentations.html" title="Article & Presentations">Article & Presentations</A></LI>
+</UL>
+
+
+<HR>
+<DIV class="" align="center">
+<P><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/createrssfeed.action?types=blogpost&statuses=created&statuses=modified&spaces=FELIX&labelString=iPOJO&rssType=atom&maxResults=10&timeSpan=5&publicFeed=true&title=iPOJO%20Atom%20Feed" title="Stay tuned!" rel="nofollow"><IMG src="http://cwiki.apache.org/confluence/images/icons/feed-icon-32x32.png" align="absmiddle" border="0"><SUP><IMG class="rendericon" src="http://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>
+
+ </DIV>
+ </BODY>
+
+
+</HTML>
diff --git a/ipojo/core/doc/ipojo-in-10-minutes.data/spell.png b/ipojo/core/doc/ipojo-in-10-minutes.data/spell.png
new file mode 100644
index 0000000..d592456
--- /dev/null
+++ b/ipojo/core/doc/ipojo-in-10-minutes.data/spell.png
Binary files differ
diff --git a/ipojo/core/doc/ipojo-in-10-minutes.data/spell2.png b/ipojo/core/doc/ipojo-in-10-minutes.data/spell2.png
new file mode 100644
index 0000000..a3b06c8
--- /dev/null
+++ b/ipojo/core/doc/ipojo-in-10-minutes.data/spell2.png
Binary files differ
diff --git a/ipojo/core/doc/ipojo-in-10-minutes.data/spell3.png b/ipojo/core/doc/ipojo-in-10-minutes.data/spell3.png
new file mode 100644
index 0000000..e63146e
--- /dev/null
+++ b/ipojo/core/doc/ipojo-in-10-minutes.data/spell3.png
Binary files differ
diff --git a/ipojo/core/doc/ipojo-in-10-minutes.data/ss.png b/ipojo/core/doc/ipojo-in-10-minutes.data/ss.png
new file mode 100644
index 0000000..22f9e26
--- /dev/null
+++ b/ipojo/core/doc/ipojo-in-10-minutes.data/ss.png
Binary files differ
diff --git a/ipojo/core/doc/ipojo-in-10-minutes.html b/ipojo/core/doc/ipojo-in-10-minutes.html
new file mode 100644
index 0000000..850312f
--- /dev/null
+++ b/ipojo/core/doc/ipojo-in-10-minutes.html
@@ -0,0 +1,512 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+
+
+<HEAD>
+ <TITLE>Apache Felix - iPOJO in 10 minutes</TITLE>
+ <LINK rel="stylesheet" href="http://felix.apache.org/site/media.data/site.css" type="text/css" media="all">
+ <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ </HEAD>
+ <BODY>
+ <DIV class="title"><DIV class="logo"><A href="http://felix.apache.org/site/index.html"><IMG border="0" alt="Apache Felix" src="http://felix.apache.org/site/media.data/logo.png"></A></DIV><DIV class="header"><A href="http://www.apache.org/"><IMG border="0" alt="Apache" src="http://felix.apache.org/site/media.data/apache.png"></A></DIV></DIV>
+ <DIV class="menu">
+ <UL>
+ <LI><A href="http://felix.apache.org/site/news.html" title="news">news</A></LI>
+ <LI><A href="http://felix.apache.org/site/license.html" title="license">license</A></LI>
+ <LI><SPAN class="nobr"><A href="http://felix.apache.org/site/downloads.cgi" title="Visit page outside Confluence" rel="nofollow">downloads<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/documentation.html" title="documentation">documentation</A></LI>
+ <LI><A href="http://felix.apache.org/site/mailinglists.html" title="mailinglists">mailing lists</A></LI>
+ <LI><A href="http://felix.apache.org/site/contributing.html" title="Contributing">contributing</A></LI>
+ <LI><SPAN class="nobr"><A href="http://www.apache.org/" title="Visit page outside Confluence" rel="nofollow">asf<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>
+<!-- ApacheCon Ad -->
+<IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+<P style="height: 100px">
+<!-- ApacheCon Ad --></LI>
+</UL>
+ </DIV>
+ <DIV class="main">
+<TABLE class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR>
+<TD class="confluenceTd" valign="top" width="80%">
+<H1><A name="iPOJOin10minutes-iPOJOin10minutes"></A>iPOJO in 10 minutes</H1>
+
+<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>
+
+<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><IMG src="http://felix.apache.org/site/ipojo-in-10-minutes.data/spell.png" align="absmiddle" border="0"></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 <SPAN class="nobr"><A href="http://ant.apache.org/" title="Visit page outside Confluence" rel="nofollow">here<SUP><IMG class="rendericon" src="http://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="http://felix.apache.org/site/ipojo-in-10-minutes.data/tutorial.zip" title="tutorial.zip attached to iPOJO in 10 minutes">here<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/link_attachment_7.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>
+<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"><DIV class="codeContent">
+<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 "src/spell/services/SpellChecker.java" for the following <EM>Spell Checker</EM> service interface:</P>
+<DIV class="code"><DIV class="codeContent">
+<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"><DIV class="codeContent">
+<PRE class="code-java">$ 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 <SPAN class="nobr"><A href="http://www.aqute.biz/Code/Bnd" title="Visit page outside Confluence" rel="nofollow">BND<SUP><IMG class="rendericon" src="http://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>
+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"><DIV class="codeContent">
+<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 < 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"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><ipojo></SPAN>
+<SPAN class="code-tag"><component classname=<SPAN class="code-quote">"spell.english.EnglishDictionary"</SPAN>></SPAN>
+ <SPAN class="code-tag"><provides/></SPAN>
+<SPAN class="code-tag"></component></SPAN>
+<SPAN class="code-tag"><instance component=<SPAN class="code-quote">"spell.english.EnglishDictionary"</SPAN>/></SPAN>
+<SPAN class="code-tag"></ipojo></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"><DIV class="codeContent">
+<PRE class="code-java">$ 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 spell.english.bnd 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"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">package</SPAN> spell.check;
+<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"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><ipojo></SPAN>
+<SPAN class="code-tag"><component classname=<SPAN class="code-quote">"spell.check.SpellCheck"</SPAN>></SPAN>
+ <SPAN class="code-tag"><requires field=<SPAN class="code-quote">"m_dictionary"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><provides/></SPAN>
+<SPAN class="code-tag"></component></SPAN>
+<SPAN class="code-tag"><instance component=<SPAN class="code-quote">"spell.check.SpellCheck"</SPAN>/></SPAN>
+<SPAN class="code-tag"></ipojo></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.check.guiproject"></A>The spell.check.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"><DIV class="codeContent">
+<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);
+ 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"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><ipojo></SPAN>
+<SPAN class="code-tag"><component classname=<SPAN class="code-quote">"spell.gui.SpellCheckerGui"</SPAN>></SPAN>
+ <SPAN class="code-tag"><requires field=<SPAN class="code-quote">"m_checker"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><callback transition=<SPAN class="code-quote">"validate"</SPAN> method=<SPAN class="code-quote">"start"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><callback transition=<SPAN class="code-quote">"invalidate"</SPAN> method=<SPAN class="code-quote">"stop"</SPAN>/></SPAN>
+<SPAN class="code-tag"></component></SPAN>
+<SPAN class="code-tag"><instance component=<SPAN class="code-quote">"spell.gui.SpellCheckerGui"</SPAN>/></SPAN>
+<SPAN class="code-tag"></ipojo></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"><DIV class="codeContent">
+<PRE class="code-java">java -jar bin/felix.jar</PRE>
+</DIV></DIV>
+<P>You can check installed bundles by using the '_ps'_command:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">-> ps
+START LEVEL 1
+ ID State Level Name
+[ 0] [Active ] [ 0] <SPAN class="code-object">System</SPAN> Bundle (1.0.3)
+[ 1] [Active ] [ 1] Apache Felix Shell Service (1.0.0)
+[ 2] [Active ] [ 1] Apache Felix Shell TUI (1.0.0)
+[ 3] [Active ] [ 1] Apache Felix Bundle Repository (1.0.2)
+[ 4] [Active ] [ 1] iPOJO (0.7.6.SNAPSHOT)
+-></PRE>
+</DIV></DIV>
+<P>iPOJO runtime is the bundle 4. Once started, install the four created bundles as above:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">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>
+<IMG src="http://felix.apache.org/site/ipojo-in-10-minutes.data/ss.png" align="absmiddle" border="0"><BR>
+Then, 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>
+<IMG src="http://felix.apache.org/site/ipojo-in-10-minutes.data/spell2.png" align="absmiddle" border="0"><BR>
+Then, 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>
+<IMG src="http://felix.apache.org/site/ipojo-in-10-minutes.data/spell3.png" align="absmiddle" border="0"></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 users-subscribe@felix.apache.org; after subscribing, email questions or feedback to users@felix.apache.org.</P>
+</TD>
+<TD class="confluenceTd" valign="top" width="20%">
+<H6><A name="iPOJOin10minutes-Overview"></A><B>Overview</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo.html" title="Apache Felix iPOJO">Home Page</A></LI>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-feature-overview.html" title="Apache Felix iPOJO Feature Overview">iPOJO Feature Overview</A></LI>
+ <LI><A href="http://felix.apache.org/site/download.html" title="Download">Download & Install </A></LI>
+</UL>
+
+
+<H6><A name="iPOJOin10minutes-GettingStarted"></A><B>Getting Started</B></H6>
+<UL>
+ <LI><A href="#" title="iPOJO in 10 minutes">iPOJO in 10 minutes</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-hello-word-maven-based-tutorial.html" title="iPOJO Hello Word (Maven-Based) tutorial">iPOJO Hello Word (Maven-Based) tutorial</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-tutorial.html" title="iPOJO Advanced Tutorial">iPOJO Advanced Tutorial</A></LI>
+</UL>
+
+
+<H6><A name="iPOJOin10minutes-UserGuide"></A><B>User Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/describing-components.html" title="Describing components">Describing components</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-annotations.html" title="How to use iPOJO Annotations">How to use iPOJO Annotations</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-topics.html" title="iPOJO Advanced Topics">Advanced Topics</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-faq.html" title="iPOJO FAQ">FAQ</A></LI>
+</UL>
+
+
+<H6><A name="iPOJOin10minutes-Tools"></A><B>Tools</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-eclipse-plug-in.html" title="iPOJO Eclipse Plug-in">iPOJO Eclipse Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-ant-task.html" title="iPOJO Ant Task">iPOJO Ant Task</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-maven-plug-in.html" title="iPOJO Maven Plug-in">iPOJO Maven Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-concepts-overview.html" title="iPOJO Concepts Overview">iPOJO concepts overview</A></LI>
+</UL>
+
+
+<H6><A name="iPOJOin10minutes-DeveloperGuide"></A><B>Developer Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/how-to-write-your-own-handler.html" title="How to write your own handler">How to write your own handler</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-manipulation-metadata.html" title="How to use iPOJO Manipulation Metadata">How to use iPOJO Manipulation Metadata</A></LI>
+</UL>
+
+
+<H6><A name="iPOJOin10minutes-Misc%26Contact"></A><B>Misc & Contact</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-issuestracker.html" title="apache-felix-ipojo-issuestracker">Issues Tracker</A></LI>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-supportedvms.html" title="apache-felix-ipojo-supportedVMs">Supported JVMs</A></LI>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-supportedosgi.html" title="apache-felix-ipojo-supportedOSGi">Supported OSGi Implementations</A></LI>
+ <LI><A href="http://felix.apache.org/site/future-ideas.html" title="Future Ideas">Future Ideas</A></LI>
+ <LI><A href="http://felix.apache.org/site/contact.html" title="Contact">Contact</A></LI>
+ <LI><A href="http://felix.apache.org/site/related-works.html" title="Related Works">Related Works</A></LI>
+ <LI><A href="http://felix.apache.org/site/article-presentations.html" title="Article & Presentations">Article & Presentations</A></LI>
+</UL>
+
+
+<HR>
+<DIV class="" align="center">
+<P><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/createrssfeed.action?types=blogpost&statuses=created&statuses=modified&spaces=FELIX&labelString=iPOJO&rssType=atom&maxResults=10&timeSpan=5&publicFeed=true&title=iPOJO%20Atom%20Feed" title="Stay tuned!" rel="nofollow"><IMG src="http://cwiki.apache.org/confluence/images/icons/feed-icon-32x32.png" align="absmiddle" border="0"><SUP><IMG class="rendericon" src="http://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>
+ </DIV>
+ </BODY>
+
+
+</HTML>
diff --git a/ipojo/core/doc/lifecycle-callback-handler.html b/ipojo/core/doc/lifecycle-callback-handler.html
new file mode 100644
index 0000000..8dbb65b
--- /dev/null
+++ b/ipojo/core/doc/lifecycle-callback-handler.html
@@ -0,0 +1,203 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+
+
+<HEAD>
+ <TITLE>Apache Felix - Lifecycle Callback Handler</TITLE>
+ <LINK rel="stylesheet" href="http://felix.apache.org/site/media.data/site.css" type="text/css" media="all">
+ <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ </HEAD>
+ <BODY>
+ <DIV class="title"><DIV class="logo"><A href="http://felix.apache.org/site/index.html"><IMG border="0" alt="Apache Felix" src="http://felix.apache.org/site/media.data/logo.png"></A></DIV><DIV class="header"><A href="http://www.apache.org/"><IMG border="0" alt="Apache" src="http://felix.apache.org/site/media.data/apache.png"></A></DIV></DIV>
+ <DIV class="menu">
+ <UL>
+ <LI><A href="http://felix.apache.org/site/news.html" title="news">news</A></LI>
+ <LI><A href="http://felix.apache.org/site/license.html" title="license">license</A></LI>
+ <LI><SPAN class="nobr"><A href="http://felix.apache.org/site/downloads.cgi" title="Visit page outside Confluence" rel="nofollow">downloads<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/documentation.html" title="documentation">documentation</A></LI>
+ <LI><A href="http://felix.apache.org/site/mailinglists.html" title="mailinglists">mailing lists</A></LI>
+ <LI><A href="http://felix.apache.org/site/contributing.html" title="Contributing">contributing</A></LI>
+ <LI><SPAN class="nobr"><A href="http://www.apache.org/" title="Visit page outside Confluence" rel="nofollow">asf<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>
+<!-- ApacheCon Ad -->
+<IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+<P style="height: 100px">
+<!-- ApacheCon Ad --></LI>
+</UL>
+ </DIV>
+ <DIV class="main">
+<TABLE class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR>
+<TD class="confluenceTd" valign="top" width="80%">
+<H1><A name="LifecycleCallbackHandler-Lifecyclecallbacks"></A>Life cycle callbacks</H1>
+
+<P>It is often necessary to create a POJO object as soon the instance becomes valid. Moreover, it is also often needed to be able to stop it nicely. The lifecycle callback handler allows invoking methods (callbacks) on the instance when instance's state changed. For example, it allows invoking a <EM>start</EM>method when the instance becomes valid and a <EM>stop</EM> method when the instance becomes invalid. Moreover, this handler allows the creation of <EM>immediate</EM>component. This page presents how to use this handler.</P>
+
+<H2><A name="LifecycleCallbackHandler-InstanceLifecycle"></A>Instance Lifecycle</H2>
+
+<P>IPOJO instances have a very simple lifecycle. This lifecycle contains two states: INVALID and VALID. Once an instance is created, this instance can only be valid if all its plugged handlers are valid. For example, an instance requiring a service (and so using the dependency handler) cannot be valid if the required service is unavailable. Indeed, the dependency handler will be invalid.</P>
+
+<P>An instance starts and stops in the invalid state.</P>
+
+<P><IMG src="http://felix.apache.org/site/lifecycle-callback-handler.data/lifecycle.png" align="absmiddle" border="0"></P>
+
+<H1><A name="LifecycleCallbackHandler-Lifecyclecallback"></A>Lifecycle callback</H1>
+
+<P>This handler supports two kinds of callback. The INVALID=>VALID callback are invoked when the instance becomes valid (at starting or when an event allows the instance to become valid). The VALID=>INVALID callback are invoked when the instance becomes invalid (at stopping or when an event invalids the instance).</P>
+
+<P><IMG src="http://felix.apache.org/site/lifecycle-callback-handler.data/callback.png" align="absmiddle" border="0"></P>
+
+<P><IMG src="http://felix.apache.org/site/lifecycle-callback-handler.data/callbackOnTransition.png" align="absmiddle" border="0"></P>
+
+<H2><A name="LifecycleCallbackHandler-Anexample"></A>An example</H2>
+
+<P>Let's take an example. The following class requires a FooService and has two lifecycle callbacks: start and stop.</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class Foo {
+ FooService fs;
+ <SPAN class="code-keyword">private</SPAN> void start() {
+ <SPAN class="code-comment">// Starting method
+</SPAN> <SPAN class="code-comment">//...
+</SPAN> fs.foo();
+ <SPAN class="code-comment">//...
+</SPAN> }
+ <SPAN class="code-keyword">protected</SPAN> void stop() {
+ <SPAN class="code-comment">// Stopping method
+</SPAN> <SPAN class="code-keyword">if</SPAN>(fs!=<SPAN class="code-keyword">null</SPAN>) { fs.foo(); }
+ }
+}</PRE>
+</DIV></DIV>
+<P>For this class, we define the following component type:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component className=<SPAN class="code-quote">"...Foo"</SPAN>></SPAN>
+ <SPAN class="code-tag"><dependency field=<SPAN class="code-quote">"fs"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><callback transition=<SPAN class="code-quote">"validate"</SPAN> method=<SPAN class="code-quote">"start"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><callback transition=<SPAN class="code-quote">"invalidate"</SPAN> method=<SPAN class="code-quote">"stop"</SPAN>/></SPAN>
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+<P>When an instance of this component type is created, the start method is called as soon as the <EM>Foo</EM> Service (service requirement) becomes available. If the <EM>Foo</EM> Service is no more available or when the instance is stopped, the stop method is called.</P>
+
+<P>The invoked methods have no argument, but could be private, protected or public. Public methods can be in parent classes too. Moreover, the INVALID=>VALID (validate) method can use service dependencies (the instance becomes valid means that all required services are available); however, in the stop method (invalidate) it is possible that one of these dependency can be <EM>null</EM>. Indeed, the departure of a service can be the cause of the instance invalidation.</P>
+
+<H2><A name="LifecycleCallbackHandler-Managingthreads"></A>Managing threads</H2>
+
+<P>One usage of lifecycle callback is when the instance needs to create threads. Indeed, the thread can be created in the validate callback, and stopped in the invalidate method. The next class shows an example of a class handling a thread by using lifecycle callbacks.</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class HelloRequesterImpl <SPAN class="code-keyword">implements</SPAN> <SPAN class="code-object">Runnable</SPAN> {
+
+ <SPAN class="code-keyword">final</SPAN> <SPAN class="code-keyword">static</SPAN> <SPAN class="code-object">int</SPAN> DELAY=10000;
+ HelloService\[\] m_hello;&nbsp; <SPAN class="code-comment">// Service Dependency
+</SPAN> <SPAN class="code-object">boolean</SPAN> end;
+
+ <SPAN class="code-keyword">public</SPAN> void run() {
+ <SPAN class="code-keyword">while</SPAN> (\!end) {
+ <SPAN class="code-keyword">try</SPAN> {
+ <SPAN class="code-keyword">synchronized</SPAN> (<SPAN class="code-keyword">this</SPAN>) {
+ <SPAN class="code-keyword">for</SPAN>(<SPAN class="code-object">int</SPAN> i = 0; i < m_hello.length; i++) {
+ <SPAN class="code-object">System</SPAN>.out.println(m_hello\[i\].sayHello(<SPAN class="code-quote">"Clement"</SPAN>));
+ }
+ }
+ <SPAN class="code-object">Thread</SPAN>.sleep(DELAY);
+ } <SPAN class="code-keyword">catch</SPAN> (InterruptedException ie) {
+ /\* will recheck quit \*/
+ }
+ }
+}
+
+<SPAN class="code-keyword">public</SPAN> void starting() {
+ <SPAN class="code-object">Thread</SPAN> T = <SPAN class="code-keyword">new</SPAN> <SPAN class="code-object">Thread</SPAN>(<SPAN class="code-keyword">this</SPAN>);
+ end = <SPAN class="code-keyword">false</SPAN>;
+ T.start();
+}
+
+<SPAN class="code-keyword">public</SPAN> void stopping() { end = <SPAN class="code-keyword">true</SPAN>; }</PRE>
+</DIV></DIV>
+<P>For this component type, the metadata are :</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component className=<SPAN class="code-quote">"... HelloRequesterImpl"</SPAN>></SPAN>
+ <SPAN class="code-tag"><dependency field=<SPAN class="code-quote">"HelloService"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><callback transition=<SPAN class="code-quote">"valdiate"</SPAN> method=<SPAN class="code-quote">"starting"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><callback transition=<SPAN class="code-quote">"invaldiate"</SPAN> method=<SPAN class="code-quote">"stopping"</SPAN>/></SPAN>
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+
+<H2><A name="LifecycleCallbackHandler-Immediatecomponent"></A>Immediate component</H2>
+
+<P>An instance of an immediate component type is instantiated as soon it becomes valid. It means that, when the instance becomes valid, the constructor of the implementation class is called. This can replace the validate callback. However, it stills a difference between the immediate and the validate callback. The constructor is call only once time. The validate callback is re-called each time the instance becomes valid.</P>
+
+<P><IMG src="http://felix.apache.org/site/lifecycle-callback-handler.data/immediate.png" align="absmiddle" border="0"></P>
+
+<P>However as there is no destructor in Java, the invalidate callback is necessary if some actions are needed when stopping.</P>
+
+<H2><A name="LifecycleCallbackHandler-Callbackonseveralobjects"></A>Callback on several objects</H2>
+
+<P>If you instance has created several objects (called the implementation class constructor several times), the callback is called on each object in the creation order.</P></TD>
+<TD class="confluenceTd" valign="top" width="20%">
+<FORM method="get" class="confluence-searchbox marginlessForm " action="http://felix.apache.org/confluence/dosearchsite.action">
+ <INPUT type="hidden" name="searchQuery.spaceKey" value="FELIX">
+ <INPUT type="text" name="searchQuery.queryString">
+ <INPUT type="submit" value="Search">
+</FORM>
+<HR>
+<H6><A name="LifecycleCallbackHandler-Overview"></A><B>Overview</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-2.html" title="Apache Felix iPOJO-2">Home Page</A></LI>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-feature-overview.html" title="Apache Felix iPOJO Feature Overview">iPOJO Feature Overview</A></LI>
+ <LI><A href="http://felix.apache.org/site/download.html" title="Download">Download & Install </A></LI>
+</UL>
+
+
+<H6><A name="LifecycleCallbackHandler-GettingStarted"></A><B>Getting Started</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-in-10-minutes.html" title="iPOJO in 10 minutes">iPOJO in 10 minutes</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-hello-word-maven-based-tutorial.html" title="iPOJO Hello Word (Maven-Based) tutorial">iPOJO Hello Word (Maven-Based) tutorial</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-tutorial.html" title="iPOJO Advanced Tutorial">iPOJO Advanced Tutorial</A></LI>
+</UL>
+
+
+<H6><A name="LifecycleCallbackHandler-UserGuide"></A><B>User Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/describing-components.html" title="Describing components">Describing components</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-annotations.html" title="How to use iPOJO Annotations">How to use iPOJO Annotations</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-topics.html" title="iPOJO Advanced Topics">Advanced Topics</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-faq.html" title="iPOJO FAQ">FAQ</A></LI>
+</UL>
+
+
+<H6><A name="LifecycleCallbackHandler-Tools"></A><B>Tools</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-eclipse-plug-in.html" title="iPOJO Eclipse Plug-in">iPOJO Eclipse Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-ant-task.html" title="iPOJO Ant Task">iPOJO Ant Task</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-maven-plug-in.html" title="iPOJO Maven Plug-in">iPOJO Maven Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-concepts-overview.html" title="iPOJO Concepts Overview">iPOJO concepts overview</A></LI>
+</UL>
+
+
+<H6><A name="LifecycleCallbackHandler-DeveloperGuide"></A><B>Developer Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/how-to-write-your-own-handler.html" title="How to write your own handler">How to write your own handler</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-manipulation-metadata.html" title="How to use iPOJO Manipulation Metadata">How to use iPOJO Manipulation Metadata</A></LI>
+</UL>
+
+
+<H6><A name="LifecycleCallbackHandler-Misc%26Contact"></A><B>Misc & Contact</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-issuestracker.html" title="apache-felix-ipojo-issuestracker">Issues Tracker</A></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Supported%20JVMs&linkCreation=true&fromPageId=82824" title="Create Page: Supported JVMs" class="createlink">Supported JVMs<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Supported%20OSGi%20Implementations&linkCreation=true&fromPageId=82824" title="Create Page: Supported OSGi Implementations" class="createlink">Supported OSGi Implementations<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/future-ideas.html" title="Future Ideas">Future Ideas</A></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Contact&linkCreation=true&fromPageId=82824" title="Create Page: Contact" class="createlink">Contact<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/related-works.html" title="Related Works">Related Works</A></LI>
+ <LI><A href="http://felix.apache.org/site/article-presentations.html" title="Article & Presentations">Article & Presentations</A></LI>
+</UL>
+
+
+<HR>
+<DIV class="" align="center">
+<P><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/createrssfeed.action?types=blogpost&statuses=created&statuses=modified&spaces=FELIX&labelString=iPOJO&rssType=atom&maxResults=10&timeSpan=5&publicFeed=true&title=iPOJO%20Atom%20Feed" title="Stay tuned!" rel="nofollow"><IMG src="http://cwiki.apache.org/confluence/images/icons/feed-icon-32x32.png" align="absmiddle" border="0"><SUP><IMG class="rendericon" src="http://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>
+ </DIV>
+ </BODY>
+
+
+</HTML>
diff --git a/ipojo/core/doc/media.data/apache.png b/ipojo/core/doc/media.data/apache.png
new file mode 100644
index 0000000..5132f65
--- /dev/null
+++ b/ipojo/core/doc/media.data/apache.png
Binary files differ
diff --git a/ipojo/core/doc/media.data/gradient.png b/ipojo/core/doc/media.data/gradient.png
new file mode 100644
index 0000000..6ddc10b
--- /dev/null
+++ b/ipojo/core/doc/media.data/gradient.png
Binary files differ
diff --git a/ipojo/core/doc/media.data/logo.png b/ipojo/core/doc/media.data/logo.png
new file mode 100644
index 0000000..dccbddc
--- /dev/null
+++ b/ipojo/core/doc/media.data/logo.png
Binary files differ
diff --git a/ipojo/core/doc/media.data/site.css b/ipojo/core/doc/media.data/site.css
new file mode 100644
index 0000000..959ab0a
--- /dev/null
+++ b/ipojo/core/doc/media.data/site.css
@@ -0,0 +1,25 @@
+/* @override http://felix.apache.org/site/media.data/site.css */
+
+body { background-color: #ffffff; color: #3b3b3b; font-family: Tahoma, Arial, sans-serif; font-size: 10pt; line-height: 140% }
+h1, h2, h3, h4, h5, h6 { font-weight: normal; color: #000000; line-height: 100%; margin-top: 0px}
+h1 { font-size: 200% }
+h2 { font-size: 175% }
+h3 { font-size: 150% }
+h4 { font-size: 140% }
+h5 { font-size: 130% }
+h6 { font-size: 120% }
+a { color: #1980af }
+a:visited { color: #1980af }
+a:hover { color: #1faae9 }
+.title { position: absolute; left: 1px; right: 1px; top:25px; height: 81px; background: url(http://felix.apache.org/site/media.data/gradient.png) repeat-x; background-position: bottom; }
+.logo { position: absolute; width: 15em; height: 81px; text-align: center; }
+.header { text-align: right; margin-right: 20pt; margin-top: 30pt;}
+.menu { border-top: 10px solid #f9bb00; position: absolute; top: 107px; left: 1px; width: 15em; bottom: 0px; padding: 0px; background-color: #fcfcfc }
+.menu ul { background-color: #fdf5d9; list-style: none; padding-left: 4em; margin-top: 0px; padding-top: 2em; padding-bottom: 2em; margin-left: 0px; color: #4a4a43}
+.menu a { text-decoration: none; color: #4a4a43 }
+.main { position: absolute; border-top: 10px solid #cde0ea; top: 107px; left: 15em; right: 1px; margin-left: 2px; padding-right: 4em; padding-left: 1em; padding-top: 1em;}
+.code { background-color: #eeeeee; border: solid 1px black; padding: 0.5em }
+.code-keyword { color: #880000 }
+.code-quote { color: #008800 }
+.code-object { color: #0000dd }
+.code-java { margin: 0em }
\ No newline at end of file
diff --git a/ipojo/core/doc/providing-osgi-services.html b/ipojo/core/doc/providing-osgi-services.html
new file mode 100644
index 0000000..e7160c1
--- /dev/null
+++ b/ipojo/core/doc/providing-osgi-services.html
@@ -0,0 +1,276 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+
+
+<HEAD>
+ <TITLE>Apache Felix - Providing OSGi services</TITLE>
+ <LINK rel="stylesheet" href="http://felix.apache.org/site/media.data/site.css" type="text/css" media="all">
+ <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ </HEAD>
+ <BODY>
+ <DIV class="title"><DIV class="logo"><A href="http://felix.apache.org/site/index.html"><IMG border="0" alt="Apache Felix" src="http://felix.apache.org/site/media.data/logo.png"></A></DIV><DIV class="header"><A href="http://www.apache.org/"><IMG border="0" alt="Apache" src="http://felix.apache.org/site/media.data/apache.png"></A></DIV></DIV>
+ <DIV class="menu">
+ <UL>
+ <LI><A href="http://felix.apache.org/site/news.html" title="news">news</A></LI>
+ <LI><A href="http://felix.apache.org/site/license.html" title="license">license</A></LI>
+ <LI><SPAN class="nobr"><A href="http://felix.apache.org/site/downloads.cgi" title="Visit page outside Confluence" rel="nofollow">downloads<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/documentation.html" title="documentation">documentation</A></LI>
+ <LI><A href="http://felix.apache.org/site/mailinglists.html" title="mailinglists">mailing lists</A></LI>
+ <LI><A href="http://felix.apache.org/site/contributing.html" title="Contributing">contributing</A></LI>
+ <LI><SPAN class="nobr"><A href="http://www.apache.org/" title="Visit page outside Confluence" rel="nofollow">asf<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>
+<!-- ApacheCon Ad -->
+<IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+<P style="height: 100px">
+<!-- ApacheCon Ad --></LI>
+</UL>
+ </DIV>
+ <DIV class="main">
+<TABLE class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR>
+<TD class="confluenceTd" valign="top" width="80%">
+<H1><A name="ProvidingOSGiservices-ProvidingOSGiservices"></A>Providing OSGi services</H1>
+
+<P>This handler allows publishing OSGi services. It manages:</P>
+<UL>
+ <LI>service publication</LI>
+ <LI>service object creation</LI>
+ <LI>service un-registration</LI>
+ <LI>configuration property propagation</LI>
+</UL>
+
+
+<P><IMG src="http://felix.apache.org/site/providing-osgi-services.data/ps-simple.png" handler="" overview="" align="absmiddle" border="0"></P>
+
+<H1><A name="ProvidingOSGiservices-Asimpleexample"></A><B>A simple example</B></H1>
+
+<P>The following code snippet shows a simple class implementing the FooService interface:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class FooProviderType1 <SPAN class="code-keyword">implements</SPAN> FooService {
+ <SPAN class="code-keyword">private</SPAN> <SPAN class="code-object">String</SPAN> m_foo = <SPAN class="code-quote">"foo"</SPAN>;
+
+ <SPAN class="code-keyword">public</SPAN> void foo() {
+ <SPAN class="code-object">System</SPAN>.out.println(<SPAN class="code-quote">"foo "</SPAN> + m_foo);
+ }
+
+}</PRE>
+</DIV></DIV>
+<P>To provide a service, the implementation class <B>NEEDS</B> to implement the service interface. By the way, it guaranties that each methods of the service interface are implemented.</P>
+
+<P>To provide the service, the component type needs to declare the providing:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component className=<SPAN class="code-quote">"...FooProviderType1"</SPAN>></SPAN>
+ <SPAN class="code-tag"><provides/></SPAN>
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+<P><IMG src="http://felix.apache.org/site/providing-osgi-services.data/ps-foo.png" align="absmiddle" border="0"></P>
+
+<P>The <provides/> element suffice to declare that each instance of this type will provide the FooService. Indeed, the provided interface can be discovered by analyzing the implementation class. By default, all implemented interface are published in the same service registration. IPOJO looks down the entire inheritance tree.</P>
+
+<H1><A name="ProvidingOSGiservices-ServicePublication"></A><B>Service Publication</B></H1>
+
+<P>The provided service handler manages the service publication and providing. For each declared <EM>provides</EM>, the handler register a service. The service is published as long as the instance is valid. If the instance becomes invalid, the service is removed from the service registry.</P>
+
+<P>By default, it publishes all interfaces implemented by the implementation class of the component class. It collects all super-interfaces (interfaces implemented by implemented interfaces and by super class). However it is possible to set exposed interface with the <EM>interface</EM> attribute to avoid to exposes all collected interfaces.</P>
+
+<P>The following xml snippet is equivalent to the previous example:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component className=<SPAN class="code-quote">"...FooProviderType1"</SPAN>></SPAN>
+ <SPAN class="code-tag"><provides interface=<SPAN class="code-quote">"...FooService "</SPAN>/></SPAN>
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+<P>If the implementation class implements several interfaces, all these interfaces are published by default in the same service publication. You can use the interface attribute to set exactly published interfaces. If you want to publish several interfaces, you can use the following syntax:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component className=<SPAN class="code-quote">"...FooProviderType1"</SPAN>></SPAN>
+ <SPAN class="code-tag"><provides interface=<SPAN class="code-quote">"{...FooService, ...BarService}"</SPAN>/></SPAN>
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+<P><IMG src="http://felix.apache.org/site/providing-osgi-services.data/ps-foobar.png" align="absmiddle" border="0"></P>
+
+<P><EM>Note</EM>: if you use the interface attribute, the handler check that all declared interface are really implemented by the implementation class. If an interface is not implemented, the handler throws an error.</P>
+
+<P><EM>Note</EM>: if the implementation class does not implement any interface, you cannot provide a service. In this case, the handler throws an error.</P>
+
+<H1><A name="ProvidingOSGiservices-ServiceProperties"></A><B>Service Properties</B></H1>
+
+<P>The handler can manage service properties. Service properties are attached to published service and allow consumer filtering providers. A property can be attached to a field (contained in the component implementation class), and so by handle dynamically.</P>
+
+<P>Let's take a new example very closed of the last one:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class FooProviderType1 <SPAN class="code-keyword">implements</SPAN> FooService {
+ <SPAN class="code-keyword">private</SPAN> <SPAN class="code-object">String</SPAN> m_foo;
+ <SPAN class="code-keyword">public</SPAN> void foo() {
+ <SPAN class="code-object">System</SPAN>.out.println(<SPAN class="code-quote">"foo "</SPAN> + m_foo);
+ m_foo = <SPAN class="code-quote">"bar"</SPAN>;
+ }
+}</PRE>
+</DIV></DIV>
+<P>Remark that the m_foo field does not have any value. The following snippet shows a component publishing the <EM>FooService</EM>with two properties:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component className=<SPAN class="code-quote">"...FooProviderType1"</SPAN>></SPAN>
+ <SPAN class="code-tag"><provides></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"foo"</SPAN> field=<SPAN class="code-quote">"m_foo"</SPAN> value=<SPAN class="code-quote">"Foo"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"intProps"</SPAN> type=<SPAN class="code-quote">"int"</SPAN> value=<SPAN class="code-quote">"5"</SPAN>></SPAN>
+ <SPAN class="code-tag"></provides></SPAN>
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+<P>The first declared property will be attached to the _m_foo_ field. This property is published with the name <EM>foo</EM>. This property has a default value "Foo". This value will be injected in the _m_foo_ field, when this field asks for a value. A property with a field attribute does not need to declare a type (the type can be discovered by analyzing the implementation class).</P>
+
+<P>The second property is published with the name <EM>intProps</EM>. This property is not attached to a field, so, we need to declare the property type. All primitive types or objects can be used has property type (for object, the qualified name of the class is used as java.lang.String).</P>
+
+<P><IMG src="http://felix.apache.org/site/providing-osgi-services.data/ps-foo2.png" align="absmiddle" border="0"></P>
+
+<P>The implementation class set a new value to the _m_foo_ field in the code. When this action occurs, the handler will modify the service publication to update the <EM>foo</EM> property published value. If a published property value becomes <EM>null</EM>, the property is unpublished since it has a new value.</P>
+
+<P><IMG src="http://felix.apache.org/site/providing-osgi-services.data/ps-foo3.png" align="absmiddle" border="0"></P>
+
+<P>If property does not have default value, the instance configuration needs to set a value for each unvalued property. Moreover, the instance can override the property value. The following xml snippet shows the declaration of an instance overriding the property values:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><instance component=<SPAN class="code-quote">"...FooProviderType1"</SPAN> name=<SPAN class="code-quote">"myFooServiceProvider"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"foo"</SPAN> value=<SPAN class="code-quote">"baz"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"intProps"</SPAN> value=<SPAN class="code-quote">"2"</SPAN>/></SPAN>
+<SPAN class="code-tag"></instance></SPAN></PRE>
+</DIV></DIV>
+<P><IMG src="http://felix.apache.org/site/providing-osgi-services.data/ps-foo4.png" align="absmiddle" border="0"></P>
+
+<P>Properties can be attached to a method too. When a property receive a new value, this method is called with the new value in parameter. For example, when the foo property receive a new value (at instance creation or when the instance is reconfigured), the <EM>fooMethod</EM> is called. The <EM>fooMethod</EM> must have only one argument of the Foo type (String in the example).</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component className=<SPAN class="code-quote">"...FooProviderType1"</SPAN>></SPAN>
+ <SPAN class="code-tag"><provides></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"foo"</SPAN> method=<SPAN class="code-quote">"fooMethod"</SPAN> value=<SPAN class="code-quote">"Foo"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"intProps"</SPAN> type=<SPAN class="code-quote">"int"</SPAN> value=<SPAN class="code-quote">"5"</SPAN>></SPAN>
+ <SPAN class="code-tag"></provides></SPAN>
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class FooProviderType1 <SPAN class="code-keyword">implements</SPAN> FooService {
+ <SPAN class="code-keyword">private</SPAN> <SPAN class="code-object">String</SPAN> m_foo;
+ <SPAN class="code-keyword">public</SPAN> void foo() {
+ <SPAN class="code-object">System</SPAN>.out.println(<SPAN class="code-quote">"foo "</SPAN> + m_foo);
+ } void fooMethod(<SPAN class="code-object">String</SPAN> newFoo) {
+ m_foo = newFoo;
+ }</PRE>
+</DIV></DIV>
+<P>A property can declare both a field and a method. In this case, the field receive the value and then the method is called. </P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><component className=<SPAN class="code-quote">"...FooProviderType1"</SPAN>>
+ <provides>
+ <property name=<SPAN class="code-quote">"foo"</SPAN> method=<SPAN class="code-quote">"fooMethod"</SPAN> field=<SPAN class="code-quote">"m_foo"</SPAN> value=<SPAN class="code-quote">"Foo"</SPAN>>
+ <property name=<SPAN class="code-quote">"intProps"</SPAN> type=<SPAN class="code-quote">"<SPAN class="code-object">int</SPAN>"</SPAN> value=<SPAN class="code-quote">"5"</SPAN>>
+ </provides>
+</component></PRE>
+</DIV></DIV>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class FooProviderType1 <SPAN class="code-keyword">implements</SPAN> FooService {
+ <SPAN class="code-keyword">private</SPAN> <SPAN class="code-object">String</SPAN> m_foo;
+ <SPAN class="code-keyword">public</SPAN> void foo() {
+ <SPAN class="code-object">System</SPAN>.out.println(<SPAN class="code-quote">"foo "</SPAN> + m_foo);
+ } void fooMethod(<SPAN class="code-object">String</SPAN> newFoo) {
+ <SPAN class="code-object">System</SPAN>.out.println(<SPAN class="code-quote">"Update foo : "</SPAN> + m_foo);
+ }</PRE>
+</DIV></DIV>
+
+<H1><A name="ProvidingOSGiservices-Advancedfeatures"></A>Advanced features</H1>
+
+
+<H2><A name="ProvidingOSGiservices-ServiceServing%26ObjectCreation"></A><B>Service Serving & Object Creation</B></H2>
+
+<P>When a consumer requires the published service, the handler sends an object (instance) of the implementation class. By default, it is always the same instance. If no instance already exists, an instance is created.</P>
+
+<P>However, the handler supports the OSGi <EM>Service Factory</EM>. In this case, for each requester bundle, the handler sends a new object. To activate this policy, add the <EM>factory</EM> attribute in the <EM>provides</EM> element:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><provides factory=<SPAN class="code-quote">"SERVICE"</SPAN>/></SPAN></PRE>
+</DIV></DIV>
+
+<H2><A name="ProvidingOSGiservices-SeveralServiceProviding"></A><B>Several Service Providing</B></H2>
+
+<P>You can declare several <EM>provides</EM> inside the same component. All this provided service will be manage by the same handler but separately. Several services will be published (with different service registrations). This case is useful when service properties are different for the different services.</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><component className=<SPAN class="code-quote">"...FooProviderType1"</SPAN>>
+ <provides <SPAN class="code-keyword">interface</SPAN>=<SPAN class="code-quote">"...Foo"</SPAN>/>
+ <provides <SPAN class="code-keyword">interface</SPAN>=<SPAN class="code-quote">"...Bar"</SPAN>>
+ <property name=<SPAN class="code-quote">"foo"</SPAN> value=<SPAN class="code-quote">"baz"</SPAN>/>
+ </provides>
+</component></PRE>
+</DIV></DIV>
+<P><IMG src="http://felix.apache.org/site/providing-osgi-services.data/ps-foobar2.png" align="absmiddle" border="0"></P>
+
+<H2><A name="ProvidingOSGiservices-ServicePropertyPropagation"></A><B>Service Property Propagation</B></H2>
+
+<P>The configuration handler has the possibility to propagate received properties to service publication. So, when the propagation is activated, all properties received by the configuration handler will be propagated to all published service. If some properties are mapped on methods, these methods are invoked with the new value in argument.</P>
+
+<P><IMG src="http://felix.apache.org/site/providing-osgi-services.data/ps-propagation.png" align="absmiddle" border="0"></P>
+
+<H2><A name="ProvidingOSGiservices-Instancereconfiguration"></A><B>Instance reconfiguration</B></H2>
+
+<P>The handler supports instance reconfiguration. When an instance is dynamically reconfigured, if the new configuration updates property values, these value are take into account (both for field, and service publication). If some of these properties have methods, these methods are invoked with the new value in argument.</P>
+</TD>
+<TD class="confluenceTd" valign="top" width="20%">
+<FORM method="get" class="confluence-searchbox marginlessForm " action="http://felix.apache.org/confluence/dosearchsite.action">
+ <INPUT type="hidden" name="searchQuery.spaceKey" value="FELIX">
+ <INPUT type="text" name="searchQuery.queryString">
+ <INPUT type="submit" value="Search">
+</FORM>
+<HR>
+<H6><A name="ProvidingOSGiservices-Overview"></A><B>Overview</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-2.html" title="Apache Felix iPOJO-2">Home Page</A></LI>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-feature-overview.html" title="Apache Felix iPOJO Feature Overview">iPOJO Feature Overview</A></LI>
+ <LI><A href="http://felix.apache.org/site/download.html" title="Download">Download & Install </A></LI>
+</UL>
+
+
+<H6><A name="ProvidingOSGiservices-GettingStarted"></A><B>Getting Started</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-in-10-minutes.html" title="iPOJO in 10 minutes">iPOJO in 10 minutes</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-hello-word-maven-based-tutorial.html" title="iPOJO Hello Word (Maven-Based) tutorial">iPOJO Hello Word (Maven-Based) tutorial</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-tutorial.html" title="iPOJO Advanced Tutorial">iPOJO Advanced Tutorial</A></LI>
+</UL>
+
+
+<H6><A name="ProvidingOSGiservices-UserGuide"></A><B>User Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/describing-components.html" title="Describing components">Describing components</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-annotations.html" title="How to use iPOJO Annotations">How to use iPOJO Annotations</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-topics.html" title="iPOJO Advanced Topics">Advanced Topics</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-faq.html" title="iPOJO FAQ">FAQ</A></LI>
+</UL>
+
+
+<H6><A name="ProvidingOSGiservices-Tools"></A><B>Tools</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-eclipse-plug-in.html" title="iPOJO Eclipse Plug-in">iPOJO Eclipse Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-ant-task.html" title="iPOJO Ant Task">iPOJO Ant Task</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-maven-plug-in.html" title="iPOJO Maven Plug-in">iPOJO Maven Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-concepts-overview.html" title="iPOJO Concepts Overview">iPOJO concepts overview</A></LI>
+</UL>
+
+
+<H6><A name="ProvidingOSGiservices-DeveloperGuide"></A><B>Developer Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/how-to-write-your-own-handler.html" title="How to write your own handler">How to write your own handler</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-manipulation-metadata.html" title="How to use iPOJO Manipulation Metadata">How to use iPOJO Manipulation Metadata</A></LI>
+</UL>
+
+
+<H6><A name="ProvidingOSGiservices-Misc%26Contact"></A><B>Misc & Contact</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-issuestracker.html" title="apache-felix-ipojo-issuestracker">Issues Tracker</A></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Supported%20JVMs&linkCreation=true&fromPageId=82824" title="Create Page: Supported JVMs" class="createlink">Supported JVMs<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Supported%20OSGi%20Implementations&linkCreation=true&fromPageId=82824" title="Create Page: Supported OSGi Implementations" class="createlink">Supported OSGi Implementations<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/future-ideas.html" title="Future Ideas">Future Ideas</A></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Contact&linkCreation=true&fromPageId=82824" title="Create Page: Contact" class="createlink">Contact<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/related-works.html" title="Related Works">Related Works</A></LI>
+ <LI><A href="http://felix.apache.org/site/article-presentations.html" title="Article & Presentations">Article & Presentations</A></LI>
+</UL>
+
+
+<HR>
+<DIV class="" align="center">
+<P><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/createrssfeed.action?types=blogpost&statuses=created&statuses=modified&spaces=FELIX&labelString=iPOJO&rssType=atom&maxResults=10&timeSpan=5&publicFeed=true&title=iPOJO%20Atom%20Feed" title="Stay tuned!" rel="nofollow"><IMG src="http://cwiki.apache.org/confluence/images/icons/feed-icon-32x32.png" align="absmiddle" border="0"><SUP><IMG class="rendericon" src="http://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>
+ </DIV>
+ </BODY>
+
+
+</HTML>
diff --git a/ipojo/core/doc/service-requirement-handler.html b/ipojo/core/doc/service-requirement-handler.html
new file mode 100644
index 0000000..24c71fb
--- /dev/null
+++ b/ipojo/core/doc/service-requirement-handler.html
@@ -0,0 +1,494 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+
+
+<HEAD>
+ <TITLE>Apache Felix - Service Requirement Handler</TITLE>
+ <LINK rel="stylesheet" href="http://felix.apache.org/site/media.data/site.css" type="text/css" media="all">
+ <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ </HEAD>
+ <BODY>
+ <DIV class="title"><DIV class="logo"><A href="http://felix.apache.org/site/index.html"><IMG border="0" alt="Apache Felix" src="http://felix.apache.org/site/media.data/logo.png"></A></DIV><DIV class="header"><A href="http://www.apache.org/"><IMG border="0" alt="Apache" src="http://felix.apache.org/site/media.data/apache.png"></A></DIV></DIV>
+ <DIV class="menu">
+ <UL>
+ <LI><A href="http://felix.apache.org/site/news.html" title="news">news</A></LI>
+ <LI><A href="http://felix.apache.org/site/license.html" title="license">license</A></LI>
+ <LI><SPAN class="nobr"><A href="http://felix.apache.org/site/downloads.cgi" title="Visit page outside Confluence" rel="nofollow">downloads<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/documentation.html" title="documentation">documentation</A></LI>
+ <LI><A href="http://felix.apache.org/site/mailinglists.html" title="mailinglists">mailing lists</A></LI>
+ <LI><A href="http://felix.apache.org/site/contributing.html" title="Contributing">contributing</A></LI>
+ <LI><SPAN class="nobr"><A href="http://www.apache.org/" title="Visit page outside Confluence" rel="nofollow">asf<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <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="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>
+<!-- ApacheCon Ad -->
+<IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
+<P style="height: 100px">
+<!-- ApacheCon Ad --></LI>
+</UL>
+ </DIV>
+ <DIV class="main">
+<TABLE class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR>
+<TD class="confluenceTd" valign="top" width="80%">
+<H1><A name="ServiceRequirementHandler-ServiceDependencyManagement"></A>Service Dependency Management</H1>
+
+<P>The dependency handler manages <EM>OSGi service</EM> <EM>dependencies/requirements</EM>. It allows a component to consume service without managing service discovery, tracking and binding. The handler manages all this interaction and injects required service in the component.</P>
+
+<H2><A name="ServiceRequirementHandler-ServiceRequirement"></A>Service Requirement</H2>
+
+
+<H3><A name="ServiceRequirementHandler-What%27saservicerequirement%3F"></A>What's a service requirement?</H3>
+
+<P>A requirement represents a required service. Therefore, it manages the service lookup and the service binding. When an instance requires a service, the handler injects directly a service object inside a field, or invokes a method when a consistent service appears (or disappears). Service requirements can be:</P>
+<UL>
+ <LI>Simple / Aggregate : the component can require one or several service providers</LI>
+ <LI>Mandatory / Optional : a component can declare an optional dependency</LI>
+ <LI>Filtered : a component can filter available providers</LI>
+ <LI>Dynamic / Static / Dynamic-Priority : the component can specify the binding policy</LI>
+</UL>
+
+
+<H3><A name="ServiceRequirementHandler-Dynamism%26InstanceLifecycle"></A>Dynamism & Instance Lifecycle</H3>
+
+<P>In OSGi™, services can appear and disappear dynamically. This implies dependencies can target a provider which can appear or disappear dynamically. So, dependencies need to manage this dynamism by tracking every time available services. At any moment, a dependency can be unresolved (i.e. no more provider can fulfill the requirement). In the case of a mandatory requirement, the instance becomes invalid (an invalid instance is no more accessible externally, for example provided service are unpublished). If a service, resolving the unfilled dependency appears, the instance becomes valid. In consequence, dependencies affect directly the instance state, and must manage correctly OSGi dynamism to allow a complete unloading when a service goes away. As soon a mandatory dependency cannot be fulfilled, the instance is invalidated.</P>
+
+<P>By default, dependencies are managed dynamically (as previously explained). However, iPOJO supports two other types of binding policies: </P>
+<UL>
+ <LI>Static : if a bound service disappears, the instance is invalidated and cannot be revalidated (binding broken)</LI>
+ <LI>Dynamic-Priority: at each injection, the <EM>best</EM> provider is injected, or the providers array is sorted according to the OSGi Ranking policy.</LI>
+</UL>
+
+
+<H2><A name="ServiceRequirementHandler-ServiceRequirementInjectionMechanisms"></A>Service Requirement Injection Mechanisms</H2>
+
+<P>The handler manages two types of injections:</P>
+<UL>
+ <LI>Field injection: a field contains the service object. As soon as the field is used, a consistent service object is injected. This injection type fully hides the dynamism</LI>
+ <LI>Method invocation: when a service appears, or disappears a method in the component is invoked. For each dependency, bind and unbind methods are invoke to notify the component of the event.</LI>
+</UL>
+
+
+<P>Moreover, the two injections type can be merged. A component can declare a requirement containing both a field and 'binding'.</P>
+
+<H3><A name="ServiceRequirementHandler-Fieldinjection"></A>Field injection</H3>
+
+<P>Imagine a Hello service with one method 'getMessage' returning a "Hello Message". The following component implementation can use this service by attaching this service to a field and by using the field:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class HelloConsumer {
+ <SPAN class="code-keyword">private</SPAN> Hello m_hello;
+ <SPAN class="code-keyword">public</SPAN> doSomething() {
+ <SPAN class="code-object">System</SPAN>.out.println(m_hello.getMesage());
+ }
+}</PRE>
+</DIV></DIV>
+<P>For this component, metadata could be:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component classname=<SPAN class="code-quote">"...HelloConsumer"</SPAN>></SPAN>
+ <SPAN class="code-tag"><requires field=<SPAN class="code-quote">"m_hello"</SPAN>/></SPAN>
+ ...
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+<P>The metadata contains a 'requires' element (representing the service dependency). This element has a field attribute. This attribute is the name of the field representing the service dependency in the implementation class. The implementation uses the field as a normal field without managing service interactions.</P>
+
+<H3><A name="ServiceRequirementHandler-Methodinvocation"></A>Method invocation</H3>
+
+<P>The second injection mechanism uses methods in the implementation class. By this way, the dynamics can be managed directly by the developer. Each dependency can declare two methods:</P>
+<UL>
+ <LI>A bind method called when a service appears</LI>
+ <LI>An unbind method called when a service disappears</LI>
+</UL>
+
+
+<P>Moreover, callbacks can be in the component super class (in this case methods must be public). These methods can have one of these four signatures:</P>
+<UL>
+ <LI>Without any argument: the method is just a notification (method())</LI>
+ <LI>With the service object : the object is the implicated service object (method(Service svc))</LI>
+ <LI>With an OSGi service reference: the service reference appearing or disappearing (method(ServiceReference ref))</LI>
+ <LI>With the service object and the OSGi service reference (method(Service svc, ServiceReference ref))</LI>
+</UL>
+
+
+<P>The following component implementation shows an example of implementation using this mechanism:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class HelloConsumer {
+ <SPAN class="code-keyword">private</SPAN> Hello m_hello;
+
+ <SPAN class="code-keyword">public</SPAN> void bindHello(Hello h) { m_hello = h; }
+ <SPAN class="code-keyword">public</SPAN> void unbindHello() { m_hello = <SPAN class="code-keyword">null</SPAN>; }
+ <SPAN class="code-keyword">public</SPAN> doSomething() { <SPAN class="code-object">System</SPAN>.out.println(m_hello.getMesage()); }
+}</PRE>
+</DIV></DIV>
+<P>For this component, metadata could be:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component classname=<SPAN class="code-quote">"...HelloConsumer"</SPAN>></SPAN>
+<SPAN class="code-tag"><requires></SPAN>
+ <SPAN class="code-tag"><callback type=<SPAN class="code-quote">"bind"</SPAN> method=<SPAN class="code-quote">"bindHello"</SPAN>></SPAN>
+ <SPAN class="code-tag"><callback type=<SPAN class="code-quote">"unbind"</SPAN> method=<SPAN class="code-quote">"unbindHello"</SPAN>></SPAN>
+<SPAN class="code-tag"></requires></SPAN>
+...
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+<P>Note, that the bind the unbind method can be have different signatures. By using this mechanism, you need to be sure to manage the dynamism correctly.<BR>
+(<A href="#ServiceRequirementHandler-discovery" title="discovery on Service Requirement Handler">See note on type discovery</A>)</P>
+
+<H3><A name="ServiceRequirementHandler-FieldinjectionsandMethodinvocations"></A>Field injections and Method invocations</H3>
+
+<P>The two mechanisms can be used together. In this case, the field receives the value before the bind method invocation. So, if the field is use in the method, the returned value will be up to date. The following component implementation uses this mechanism:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class HelloConsumer {
+ <SPAN class="code-keyword">private</SPAN> Hello m_hello; <SPAN class="code-comment">// Injected Field
+</SPAN>
+ <SPAN class="code-keyword">public</SPAN> void bindHello() { <SPAN class="code-object">System</SPAN>.out.println(<SPAN class="code-quote">"Hello appears"</SPAN>); }
+ <SPAN class="code-keyword">public</SPAN> void unbindHello() { <SPAN class="code-object">System</SPAN>.out.println(<SPAN class="code-quote">"Hello disapears"</SPAN>); }
+ <SPAN class="code-keyword">public</SPAN> doSomething() { <SPAN class="code-object">System</SPAN>.out.println(m_hello.getMesage()); }
+}</PRE>
+</DIV></DIV>
+<P>For this component, metadata could be:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component classname=<SPAN class="code-quote">"...HelloConsumer"</SPAN>></SPAN>
+ <SPAN class="code-tag"><requires field=<SPAN class="code-quote">"m_hello"</SPAN>></SPAN>
+ <SPAN class="code-tag"><callback type=<SPAN class="code-quote">"bind"</SPAN> method=<SPAN class="code-quote">"bindHello"</SPAN>></SPAN>
+ <SPAN class="code-tag"><callback type=<SPAN class="code-quote">"unbind"</SPAN> method=<SPAN class="code-quote">"unbindHello"</SPAN>></SPAN>
+ <SPAN class="code-tag"></requires></SPAN>
+ ...
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+
+<H3><A name="ServiceRequirementHandler-Injectionmechanisms%26lazyobjectcreation"></A>Injection mechanisms & lazy object creation</H3>
+
+<P>IPOJO creates objects only when required. When needed, iPOJO invokes the constructor of the implementation class. The implementation class can use field requirement because values are already injected. However, method dependencies are called just after the constructor. If the service already presents, the invocation of the methods are delayed just after the constructor invocation.</P>
+
+<H2><A name="ServiceRequirementHandler-SomeExamples"></A>Some Examples</H2>
+
+
+<H3><A name="ServiceRequirementHandler-SimpleRequirement"></A>Simple Requirement</H3>
+
+<P>By default, a requirement is mandatory, non-filtered and simple (non-aggregate). The two previous examples illustrate this kind of dependency. When services goes away and appears, the service substitution is hidden. Fields attached to simple requirement point always a consistent service object. For a simple dependency, the bind method is called once time when the service appears or just after the POJO constructor invocation is the service is available. When the service disappears the unbind method is called. The bind method is re-invoked as soon as another service provider is available. This invocation occurs immediately if another service provider if available. In this case, the instance is not invalidated.</P>
+
+<H3><A name="ServiceRequirementHandler-AggregateRequirement"></A>Aggregate Requirement</H3>
+
+<P>When a component requires several providers of the same service, it declares an aggregate dependency.</P>
+
+<H4><A name="ServiceRequirementHandler-AggregateDependencywithfieldinjection"></A>Aggregate Dependency with field injection</H4>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class HelloConsumer {
+ <SPAN class="code-keyword">private</SPAN> Hello m_hellos[];
+ <SPAN class="code-keyword">public</SPAN> doSomething() {
+ <SPAN class="code-keyword">for</SPAN>(<SPAN class="code-object">int</SPAN> I = 0; I < m_hellos.length; i++) { <SPAN class="code-object">System</SPAN>.out.println(m_hellos[i].getMessage());}
+ }
+}</PRE>
+</DIV></DIV>
+<P>For this component, metadata could be:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component classname=<SPAN class="code-quote">"...HelloConsumer"</SPAN>></SPAN>
+ <SPAN class="code-tag"><requires field=<SPAN class="code-quote">"m_hellos"</SPAN>/></SPAN>
+ ...
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+<P>To declare an aggregate field for field requirement, you only need to declare an array (instead of a scalar type). IPOJO will create and inject the service object array. IPOJO discover that the dependency is aggregate during the bytecode introspection.</P>
+
+<P><EM>Note:</EM> The synchronization is managed by iPOJO. As soon as you are 'touching' a dependency in a method, iPOJO ensure that you will keep these objects until the end of the method. Nested methods will share the same service object set.</P>
+
+<H4><A name="ServiceRequirementHandler-AggregateDependencywithmethodinvocation"></A>Aggregate Dependency with method invocation</H4>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class HelloConsumer {
+ <SPAN class="code-keyword">private</SPAN> List m_hellos= <SPAN class="code-keyword">new</SPAN> ArrayList();
+ <SPAN class="code-keyword">private</SPAN> void bindHello(Hello h) { m_hellos.add(h); }
+ <SPAN class="code-keyword">private</SPAN> void unbindHello(Hello h) { m_hellos.remove(h); }
+ <SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">synchronized</SPAN> doSomething() {
+ <SPAN class="code-keyword">for</SPAN>(<SPAN class="code-object">int</SPAN> I = 0; I < m_hellos.size(); i++) { <SPAN class="code-object">System</SPAN>.out.println(m_hellos.get(i).getMessage());}
+ }
+ }
+}</PRE>
+</DIV></DIV>
+<P>This requirement is configured as following:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><requires aggregate=<SPAN class="code-quote">"true"</SPAN>></SPAN>
+ <SPAN class="code-tag"><callback type=<SPAN class="code-quote">"bind"</SPAN> method=<SPAN class="code-quote">"bindHello"</SPAN>></SPAN>
+ <SPAN class="code-tag"><callback type=<SPAN class="code-quote">"unbind"</SPAN> method=<SPAN class="code-quote">"unbindHello"</SPAN>></SPAN>
+<SPAN class="code-tag"></requires></SPAN></PRE>
+</DIV></DIV>
+<P>In this case, iPOJO cannot detect if the dependency is aggregate or not. So, you need to add the '<EM>aggregate</EM>' attribute. The bindHello and unbindHello will be called each time a Hello service appears or disappears.<BR>
+<EM>Note:</EM> To avoid the list modification during the loop, you need synchronized the block. Indeed, as the field is not an iPOJO requirement, iPOJO will not manage the synchronization.</P>
+
+<H3><A name="ServiceRequirementHandler-OptionalRequirement%28nonaggregate%29"></A>Optional Requirement (non-aggregate)</H3>
+
+<P>An optional requirement does not invalidate the instance despite no providers are available. Moreover, it is possible to inject a default service implementation when no <EM>real</EM> providers are available.</P>
+
+<H4><A name="ServiceRequirementHandler-OptionalRequirementwithfieldinjection"></A>Optional Requirement with field injection</H4>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class HelloConsumer {
+ <SPAN class="code-keyword">private</SPAN> Hello m_hello;
+ <SPAN class="code-keyword">public</SPAN> doSomething() { <SPAN class="code-object">System</SPAN>.out.println(m_hello.getMesage()); }
+}</PRE>
+</DIV></DIV>
+<P>For this component, metadata could be:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component classname=<SPAN class="code-quote">"...HelloConsumer"</SPAN>></SPAN>
+ <SPAN class="code-tag"><requires field=<SPAN class="code-quote">"m_hello"</SPAN> optional=<SPAN class="code-quote">"true"</SPAN>/></SPAN>
+ ...
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+<P>To declare an optional requirement, you need to add the <EM>'optional'</EM> attribute. To avoid null pointer exception, iPOJO injects a <EM>Nullable</EM> object in the field when no service provider is available. The <EM>nullable</EM>object implements the service interface, but does nothing. Moreover, it is possible to set a default-implementation for the service. A default-implementation is a class implementing the service but used only when no others service providers are available. The default-implementation object will be injected instead of the <EM>Nullable</EM> objet. For further information <A href="#ServiceRequirementHandler-nullable" title="nullable on Service Requirement Handler">refer to the note about nullable object</A>.</P>
+
+<H4><A name="ServiceRequirementHandler-OptionalDependencywithmethodinvocation"></A>Optional Dependency with method invocation</H4>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class HelloConsumer {
+ <SPAN class="code-keyword">private</SPAN> Hello m_hello;
+ <SPAN class="code-keyword">public</SPAN> void bindHello(Hello h) { m_hello = h; }
+ <SPAN class="code-keyword">public</SPAN> void unbindHello() { m_hello = <SPAN class="code-keyword">null</SPAN>; }
+ <SPAN class="code-keyword">public</SPAN> doSomething() { <SPAN class="code-keyword">if</SPAN>(m_hello != <SPAN class="code-keyword">null</SPAN>) { <SPAN class="code-object">System</SPAN>.out.println(m_hello.getMesage()); } }
+}</PRE>
+</DIV></DIV>
+<P>For this component, metadata should be:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component classname=<SPAN class="code-quote">"...HelloConsumer"</SPAN>></SPAN>
+<SPAN class="code-tag"><requires optional=<SPAN class="code-quote">"true"</SPAN>></SPAN>
+ <SPAN class="code-tag"><callback type=<SPAN class="code-quote">"bind"</SPAN> method=<SPAN class="code-quote">"bindHello"</SPAN>></SPAN>
+ <SPAN class="code-tag"><callback type=<SPAN class="code-quote">"unbind"</SPAN> method=<SPAN class="code-quote">"unbindHello"</SPAN>></SPAN>
+<SPAN class="code-tag"></requires></SPAN>
+...
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+<P>As for field requirement, the dependency metadata needs to contain the optional attribute. IPOJO invokes the method only when a 'real' service is available, so you need to test if m_hello is null before to use it.</P>
+
+<H3><A name="ServiceRequirementHandler-Aggregate%26OptionalRequirement"></A>Aggregate & Optional Requirement</H3>
+
+<P>A dependency can be both aggregate and optional.</P>
+
+<H4><A name="ServiceRequirementHandler-Aggregate%26OptionalDependencywithfieldinjection"></A>Aggregate & Optional Dependency with field injection</H4>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class HelloConsumer {
+ <SPAN class="code-keyword">private</SPAN> Hello m_hellos[];
+ <SPAN class="code-keyword">public</SPAN> doSomething() {
+ <SPAN class="code-keyword">for</SPAN>(<SPAN class="code-object">int</SPAN> I = 0; I < m_hellos.length; i++) { <SPAN class="code-object">System</SPAN>.out.println(m_hellos[i].getMessage());}
+ }
+}</PRE>
+</DIV></DIV>
+<P>For this component, metadata could be:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component classname=<SPAN class="code-quote">"...HelloConsumer"</SPAN>></SPAN>
+<SPAN class="code-tag"><requires field=<SPAN class="code-quote">"m_hellos"</SPAN> optional=<SPAN class="code-quote">"true"</SPAN>/></SPAN>
+...
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+<P>To declare an optional & aggregate field requirement you need to write the optional attribute in the dependency metadata and to point on a field array. If no service available, iPOJO injects an empty array.</P>
+
+<H4><A name="ServiceRequirementHandler-Aggregate%26OptionalRequirementwithmethodinvocation"></A>Aggregate & Optional Requirement with method invocation</H4>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> class HelloConsumer {
+ <SPAN class="code-keyword">private</SPAN> List m_hellos<Hello> = <SPAN class="code-keyword">new</SPAN> ArrayList<Hello>();
+ <SPAN class="code-keyword">private</SPAN> void bindHello(Hello h) { m_hellos.add(h); }
+ <SPAN class="code-keyword">private</SPAN> void unbindHello(Hello h) { m_hellos.remove(h); }
+ <SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">synchronized</SPAN> doSomething() {
+ <SPAN class="code-keyword">for</SPAN>(<SPAN class="code-object">int</SPAN> I = 0; I < m_hellos.size(); i++) { <SPAN class="code-object">System</SPAN>.out.println(m_hellos.get(i).getMessage());}
+ }
+}</PRE>
+</DIV></DIV>
+<P>For this component, metadata could be:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><requires aggregate=<SPAN class="code-quote">"true"</SPAN> optional=<SPAN class="code-quote">"true"</SPAN>></SPAN>
+ <SPAN class="code-tag"><callback type=<SPAN class="code-quote">"bind"</SPAN> method=<SPAN class="code-quote">"bindHello"</SPAN>></SPAN>
+ <SPAN class="code-tag"><callback type=<SPAN class="code-quote">"unbind"</SPAN> method=<SPAN class="code-quote">"unbindHello"</SPAN>></SPAN>
+<SPAN class="code-tag"></requires></SPAN></PRE>
+</DIV></DIV>
+<P>In this case, you need to add the _'aggregate'_attribute and the _'optional'_attribute. The bindHello and unbindHello will be called each time a Hello service appears or disappears. These bind / unbind methods are not called when binding / unbinding a Nullable object (when both field and method are used).</P>
+
+<H3><A name="ServiceRequirementHandler-FilteredRequirement"></A>Filtered Requirement</H3>
+
+<P>A filtered dependency applies an LDAP filter on service provider. IPOJO reuses OSGi LDAP filter ability. The following metadata illustrates how to use filters:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component classname=<SPAN class="code-quote">"...HelloConsumer"</SPAN>></SPAN>
+<SPAN class="code-tag"><requires filter=<SPAN class="code-quote">"(language=fr)"</SPAN>></SPAN>
+ <SPAN class="code-tag"><callback type=<SPAN class="code-quote">"bind"</SPAN> method=<SPAN class="code-quote">"bindHello"</SPAN>></SPAN>
+ <SPAN class="code-tag"><callback type=<SPAN class="code-quote">"unbind"</SPAN> method=<SPAN class="code-quote">"unbindHello"</SPAN>></SPAN>
+<SPAN class="code-tag"></requires></SPAN>
+...
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+<P>To add a filter, just add a 'filter' attribute in your dependency containing the LDAP filter. IPOJO will select only provider matching with this filter.</P>
+
+<P>Moreover, filters can be customized instance by instance. It is possible to specialize / change / add the filter of a component in the instance description. It is useful when you want to create different instances of the same component, with different filter. To do it, you have to identify your dependency with an 'id' attribute. Then, you can adapt the filter of the dependency in the instance description by using the property "requires.filters". In this property you can specify each dependency identified by its id and the new value of the filter.</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component className=<SPAN class="code-quote">"org.apache.felix.ipojo.example.FilteredDependency"</SPAN> name=<SPAN class="code-quote">"FOO"</SPAN>></SPAN>
+ <SPAN class="code-tag"><requires field=<SPAN class="code-quote">"m_foo"</SPAN> fiter=<SPAN class="code-quote">"(foo.property=FOO)"</SPAN> id=<SPAN class="code-quote">"id1"</SPAN>></SPAN>
+ <SPAN class="code-tag"><callback type=<SPAN class="code-quote">"bind"</SPAN> method=<SPAN class="code-quote">"bind"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><callback type=<SPAN class="code-quote">"unbind"</SPAN> method=<SPAN class="code-quote">"unbind"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></requires></SPAN>
+<SPAN class="code-tag"></component></SPAN>
+
+<SPAN class="code-tag"><instance name=<SPAN class="code-quote">"FOO1"</SPAN> component=<SPAN class="code-quote">"FOO"</SPAN>/></SPAN>
+
+<SPAN class="code-tag"><instance name=<SPAN class="code-quote">"FOO2"</SPAN> component=<SPAN class="code-quote">"FOO"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"requires.filters"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"id1"</SPAN> value=<SPAN class="code-quote">"(foo.property=BAR)"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+<SPAN class="code-tag"></instance></SPAN>
+
+<SPAN class="code-tag"><instance name=<SPAN class="code-quote">"FOO3"</SPAN> component=<SPAN class="code-quote">"FOO"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"requires.filters"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN class="code-quote">"id1"</SPAN> value=<SPAN class="code-quote">"(foo.property=BAZ)"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></property></SPAN>
+<SPAN class="code-tag"></instance></SPAN></PRE>
+</DIV></DIV>
+<P>The FOO component type declares a service dependency with the 'id1' id. This dependency has no filter by default. The first instance is just an instance of the FOO component type and does not modify the dependency. The second one adds a filter to the declared dependency to target providers with foo.property = BAR. The last one adds another filter to the declared dependency. By using instance filter customization, it is possible to create complex applications where you avoid binding problems by filtering dependencies instance by instance.</P>
+
+<H2><A name="ServiceRequirementHandler-BindingPolicies"></A>Binding Policies</H2>
+
+<P>Three binding policies are supported inside iPOJO.</P>
+<UL>
+ <LI>Dynamic policy (default): the binding are managed dynamically. At each injection, the same provider is injected if the provider is always available. Else a new one is chosen. For aggregate dependency, the array order does not change; new providers are placed at the end of the array.</LI>
+ <LI>Static policy: the binding is static. So, once bound a provider cannot disappear. If it disappears, the instance is invalidated and cannot be revalidated without stopping and restarting the instance.</LI>
+ <LI>Dynamic-priority policy: the binding is managed dynamically but the injected provider is selected by using a ranking policy. Two injections can return two different providers, is a new provider is 'better' than the previous one, despite the first one is always available. For aggregate dependency, the array is sorted.</LI>
+</UL>
+
+
+<P>A static binding is declared as following:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component classname=<SPAN class="code-quote">"...HelloConsumer"</SPAN>></SPAN>
+ <SPAN class="code-tag"><requires field=<SPAN class="code-quote">"m_hellos"</SPAN> policy=<SPAN class="code-quote">"static"</SPAN>/></SPAN>
+ ...
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+<P>A dynamic-priority binding is declared as following:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component classname=<SPAN class="code-quote">"...HelloConsumer"</SPAN>></SPAN>
+ <SPAN class="code-tag"><requires field=<SPAN class="code-quote">"m_hellos"</SPAN> policy=<SPAN class="code-quote">"dynamic-priority"</SPAN>/></SPAN>
+ ...
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+<P>By default, the dynamic-priority policy uses the OSGi service ranking policy. However, it is possible to customize the policy by adding the '<EM>comparator</EM>' attribute. This attribute indicates the class name of a class implementing the java.util.Comparator interface. IPOJO will create an instance of your comparator and use it to sort service references (so your customized comparator needs to be able to sort OSGi Service Reference).</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component classname=<SPAN class="code-quote">"...HelloConsumer"</SPAN>></SPAN>
+ <SPAN class="code-tag"><requires field=<SPAN class="code-quote">"m_hellos"</SPAN> policy=<SPAN class="code-quote">"dynamic-priority"</SPAN> comparator=<SPAN class="code-quote">"my.comparator"</SPAN>/></SPAN>
+ ...
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+
+<P><A name="ServiceRequirementHandler-nullable"></A></P>
+<H2><A name="ServiceRequirementHandler-Noteaboutnullableobject%26defaultimplementation"></A>Note about nullable object & default-implementation</H2>
+
+<P>The instance implementation can use an optional dependency without any checking. Indeed, when an instance declares an optional dependency using field injection, iPOJO create on the fly a Nullable class implementing the service specification but doing nothing (mock object). Therefore, iPOJO cannot return a service to the instance, for an optional dependency, it returns a nullable object.</P>
+
+<P>A nullable object returns:</P>
+<UL>
+ <LI>Null when the method returns an object</LI>
+ <LI>0 when the method returns an int, log, byte, short, char, float or a double</LI>
+ <LI>False when the method return a boolean</LI>
+</UL>
+
+
+<P>You can check if the returned object is a nullable object with the test: <EM>"myservice instanceof Nullable"</EM>.</P>
+
+<P>You can disable the Nullable pattern too (activated by default). In this case, iPOJO will inject <EM>null</EM> instead of a <EM>Nullable</EM> object. So, you can just test if your field is equals to <EM>null</EM> to check if the service is available. To disable the Nullable pattern, you need to add the 'nullable="false"' attribute in your service dependency description as follows:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component classname=<SPAN class="code-quote">"...LogExample"</SPAN>></SPAN>
+ <SPAN class="code-tag"><requires field=<SPAN class="code-quote">"m_log"</SPAN> optional=<SPAN class="code-quote">"true"</SPAN> nullable=<SPAN class="code-quote">"false"</SPAN>/></SPAN>
+ ...
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+
+<P>However, you can also indicate a <EM>default-implementation</EM> for your optional service. In this case, if no providers are found, iPOJO creates an instance of the default-implementation and injects it. The default-implementation attribute describes the class name of your implementation. The given class <B>MUST</B>implement the required service interface.</P>
+
+<P>For example, the following component uses a default implementation for a Log Service dependency:</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><component classname=<SPAN class="code-quote">"...LogExample"</SPAN>></SPAN>
+ <SPAN class="code-tag"><requires field=<SPAN class="code-quote">"m_log"</SPAN> optional=<SPAN class="code-quote">"true"</SPAN> default-implementation=<SPAN class="code-quote">"org.apache.felix.ipojo.example.default.MyLogService"</SPAN>/></SPAN>
+ ...
+<SPAN class="code-tag"></component></SPAN></PRE>
+</DIV></DIV>
+<P>If the log service is not available, iPOJO creates an object of the 'org.apache.felix.ipojo.example.default.MyLogService' class. This object is injected instead of a Nullable object. For instance, the default implementation can print messages on the System.err stream. The nullable object does no display anything.</P>
+
+
+<P><A name="ServiceRequirementHandler-callbacks"></A></P>
+<H2><A name="ServiceRequirementHandler-NoteaboutCallbacks"></A>Note about Callbacks</H2>
+<P>Dependency manages two type of callback: bind and unbind. A callback with a type "bind" is called each type that a service provider arrives and the binding is necessary. According to the cardinality of the dependency it means:</P>
+<UL>
+ <LI>Simple dependency : at the firs binding and at each rebinding to another service provider</LI>
+ <LI>Aggregate dependencies: each time that a service provider arrives</LI>
+</UL>
+
+
+<P>An unbind callback is called each time that a <B>used</B> service provider goes away. For a simple dependency this method is called each time that the used service provider goes away. For a multiple dependency this method is called each time that a service provider goes away.</P>
+
+<P>The method can receive in argument the service object or the service reference (in order to obtain service properties). The bind methods are delayed since a POJO object is created.</P>
+
+<P><A name="ServiceRequirementHandler-discovery"></A></P>
+<H2><A name="ServiceRequirementHandler-Noteonserviceinterfacediscovery"></A>Note on service interface discovery</H2>
+
+<P>The <EM>'interface'</EM> attribute is generally optional except when iPOJO cannot discover the type of the service. IPOJO cannot infer the type when the dependency has no field and callbacks do not receive the service object in parameter. In this case, you need to declare the service interface.</P>
+</TD>
+<TD class="confluenceTd" valign="top" width="20%">
+<FORM method="get" class="confluence-searchbox marginlessForm " action="http://felix.apache.org/confluence/dosearchsite.action">
+ <INPUT type="hidden" name="searchQuery.spaceKey" value="FELIX">
+ <INPUT type="text" name="searchQuery.queryString">
+ <INPUT type="submit" value="Search">
+</FORM>
+<HR>
+<H6><A name="ServiceRequirementHandler-Overview"></A><B>Overview</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-2.html" title="Apache Felix iPOJO-2">Home Page</A></LI>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-feature-overview.html" title="Apache Felix iPOJO Feature Overview">iPOJO Feature Overview</A></LI>
+ <LI><A href="http://felix.apache.org/site/download.html" title="Download">Download & Install </A></LI>
+</UL>
+
+
+<H6><A name="ServiceRequirementHandler-GettingStarted"></A><B>Getting Started</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-in-10-minutes.html" title="iPOJO in 10 minutes">iPOJO in 10 minutes</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-hello-word-maven-based-tutorial.html" title="iPOJO Hello Word (Maven-Based) tutorial">iPOJO Hello Word (Maven-Based) tutorial</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-tutorial.html" title="iPOJO Advanced Tutorial">iPOJO Advanced Tutorial</A></LI>
+</UL>
+
+
+<H6><A name="ServiceRequirementHandler-UserGuide"></A><B>User Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/describing-components.html" title="Describing components">Describing components</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-annotations.html" title="How to use iPOJO Annotations">How to use iPOJO Annotations</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-advanced-topics.html" title="iPOJO Advanced Topics">Advanced Topics</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-faq.html" title="iPOJO FAQ">FAQ</A></LI>
+</UL>
+
+
+<H6><A name="ServiceRequirementHandler-Tools"></A><B>Tools</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/ipojo-eclipse-plug-in.html" title="iPOJO Eclipse Plug-in">iPOJO Eclipse Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-ant-task.html" title="iPOJO Ant Task">iPOJO Ant Task</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-maven-plug-in.html" title="iPOJO Maven Plug-in">iPOJO Maven Plug-in</A></LI>
+ <LI><A href="http://felix.apache.org/site/ipojo-concepts-overview.html" title="iPOJO Concepts Overview">iPOJO concepts overview</A></LI>
+</UL>
+
+
+<H6><A name="ServiceRequirementHandler-DeveloperGuide"></A><B>Developer Guide</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/how-to-write-your-own-handler.html" title="How to write your own handler">How to write your own handler</A></LI>
+ <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-manipulation-metadata.html" title="How to use iPOJO Manipulation Metadata">How to use iPOJO Manipulation Metadata</A></LI>
+</UL>
+
+
+<H6><A name="ServiceRequirementHandler-Misc%26Contact"></A><B>Misc & Contact</B></H6>
+<UL>
+ <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-issuestracker.html" title="apache-felix-ipojo-issuestracker">Issues Tracker</A></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Supported%20JVMs&linkCreation=true&fromPageId=82824" title="Create Page: Supported JVMs" class="createlink">Supported JVMs<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Supported%20OSGi%20Implementations&linkCreation=true&fromPageId=82824" title="Create Page: Supported OSGi Implementations" class="createlink">Supported OSGi Implementations<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/future-ideas.html" title="Future Ideas">Future Ideas</A></LI>
+ <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&title=Contact&linkCreation=true&fromPageId=82824" title="Create Page: Contact" class="createlink">Contact<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
+ <LI><A href="http://felix.apache.org/site/related-works.html" title="Related Works">Related Works</A></LI>
+ <LI><A href="http://felix.apache.org/site/article-presentations.html" title="Article & Presentations">Article & Presentations</A></LI>
+</UL>
+
+
+<HR>
+<DIV class="" align="center">
+<P><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/createrssfeed.action?types=blogpost&statuses=created&statuses=modified&spaces=FELIX&labelString=iPOJO&rssType=atom&maxResults=10&timeSpan=5&publicFeed=true&title=iPOJO%20Atom%20Feed" title="Stay tuned!" rel="nofollow"><IMG src="http://cwiki.apache.org/confluence/images/icons/feed-icon-32x32.png" align="absmiddle" border="0"><SUP><IMG class="rendericon" src="http://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>
+ </DIV>
+ </BODY>
+
+
+</HTML>