Update documentation
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@734735 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/core/doc/providing-osgi-services.html b/ipojo/core/doc/providing-osgi-services.html
index 503fe82..50d5ee6 100644
--- a/ipojo/core/doc/providing-osgi-services.html
+++ b/ipojo/core/doc/providing-osgi-services.html
@@ -1,272 +1,305 @@
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<HTML>
+<html><head>
+
+
-<!-- Mirrored Site: felix.apache.org. File: /site/providing-osgi-services.html. Date: Mon, 13 Oct 2008 06:53:06 GMT -->
-<HEAD>
- <TITLE>Apache Felix - Providing OSGi services</TITLE>
- <LINK rel="stylesheet" href="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="index.html"><IMG border="0" alt="Apache Felix" src="media.data/logo.png"></A></DIV><DIV class="header"><A href="http://www.apache.org/"><IMG border="0" alt="Apache" src="media.data/apache.png"></A></DIV></DIV>
- <DIV class="menu">
- <UL>
- <LI><A href="news.html" title="news">news</A></LI>
- <LI><A href="license.html" title="license">license</A></LI>
- <LI><SPAN class="nobr"><A href="downloads.html" title="Visit page outside Confluence" rel="nofollow">downloads<SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
- <LI><A href="documentation.html" title="documentation">documentation</A></LI>
- <LI><A href="mailinglists.html" title="mailinglists">mailing lists</A></LI>
- <LI><A href="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="../../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="../../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="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>
+ <title>Apache Felix - Providing OSGi services</title>
+ <link rel="stylesheet" href="providing-osgi-services_files/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 alt="Apache Felix" src="providing-osgi-services_files/logo.png" border="0"></a></div><div class="header"><a href="http://www.apache.org/"><img alt="Apache" src="providing-osgi-services_files/apache.png" border="0"></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="providing-osgi-services_files/linkext7.gif" alt="" align="absmiddle" border="0" width="7" height="7"></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="providing-osgi-services_files/linkext7.gif" alt="" align="absmiddle" border="0" width="7" height="7"></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="providing-osgi-services_files/linkext7.gif" alt="" align="absmiddle" border="0" width="7" height="7"></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="providing-osgi-services_files/linkext7.gif" alt="" align="absmiddle" border="0" width="7" height="7"></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>
+<iframe src="providing-osgi-services_files/button.html" style="border-width: 0pt; float: left;" scrolling="no" width="135" frameborder="0" height="135"></iframe>
+<p style="height: 100px;">
+<!-- ApacheCon Ad -->
+</p></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>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="providing-osgi-services.data/ps-simple.png" handler="" overview="" align="absmiddle" border="0"></P>
+<p><img src="providing-osgi-services_files/ps-simple.png" handler="" overview="" align="absmiddle" border="0"></p>
-<H1><A name="ProvidingOSGiservices-Asimpleexample"></A><B>A simple example</B></H1>
+<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>;
+<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);
+ <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>
+}</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="providing-osgi-services.data/ps-foo.png" align="absmiddle" border="0"></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="providing-osgi-services_files/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>
+<p>The <provides/> element suffice to declare that each instance
+of this type will provide the FooService. Indeed, the provided
+specification 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>
+<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>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>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 the super class). However it is possible to set exposed
+specifications with the <tt>specifications</tt> attribute to avoid to expose 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="providing-osgi-services.data/ps-foobar.png" align="absmiddle" border="0"></P>
+<p><em>Note</em>: In the 1.0.0 version, the <tt>specifications</tt> attribute was named <tt>interface</tt>.</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>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 specifications=<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 <tt>specifications</tt> attribute to set published service 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 specifications=<span class="code-quote">"{...FooService, ...BarService}"</span>/></span>
+<span class="code-tag"></component></span></pre>
+</div></div>
+<p><img src="providing-osgi-services_files/ps-foobar.png" align="absmiddle" border="0"></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>
+<p><em>Note</em>: if you use the <tt>specifications</tt> attribute, the
+handler check that all declared interfaces are really implemented by
+the implementation class. If an interface is not implemented, the
+handler throws an error.</p>
-<H1><A name="ProvidingOSGiservices-ServiceProperties"></A><B>Service Properties</B></H1>
+<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>
-<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>
+<h1><a name="ProvidingOSGiservices-ServiceProperties"></a><b>Service Properties</b></h1>
-<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>;
+<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>
+}</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>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="providing-osgi-services.data/ps-foo2.png" align="absmiddle" border="0"></P>
+<p><img src="providing-osgi-services_files/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>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="providing-osgi-services.data/ps-foo3.png" align="absmiddle" border="0"></P>
+<p><img src="providing-osgi-services_files/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="providing-osgi-services.data/ps-foo4.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="providing-osgi-services_files/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>
-<H1><A name="ProvidingOSGiservices-Advancedfeatures"></A>Advanced features</H1>
+<h2><a name="ProvidingOSGiservices-ServiceServing&ObjectCreation"></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>
+
+<p><b>NOTE [New in the 1.1.0-SNAPSHOT]</b>: The <tt>factory</tt> attribute became <tt>strategy</tt>. </p>
+<div class="code"><div class="codeContent">
+<pre class="code-xml"><span class="code-tag"><provides strategy=<span class="code-quote">"SERVICE"</span>/></span></pre>
+</div></div>
+<p>Moreover, several features appeared:</p>
+<ul>
+ <li><tt>strategy="instance"</tt> allows creating one service object per asking iPOJO instance (despite they are in the same bundle)</li>
+ <li>it is possible to create your own creation strategy by extending the <tt>org.apache.felix.ipojo.handlers.providedservice.CreationStrategy</tt> class and by indicating the qualified class name in the <tt>strategy</tt> attribute.</li>
+</ul>
-<H2><A name="ProvidingOSGiservices-ServiceServing%26ObjectCreation"></A><B>Service Serving & Object Creation</B></H2>
+<h2><a name="ProvidingOSGiservices-SeveralServiceProviding"></a><b>Several Service Providing</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>/>
+<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="providing-osgi-services.data/ps-foobar2.png" align="absmiddle" border="0"></P>
+</component></pre>
+</div></div>
+<p><img src="providing-osgi-services_files/ps-foobar2.png" align="absmiddle" border="0"></p>
-<H2><A name="ProvidingOSGiservices-ServicePropertyPropagation"></A><B>Service Property Propagation</B></H2>
+<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>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="providing-osgi-services.data/ps-propagation.png" align="absmiddle" border="0"></P>
+<p><img src="providing-osgi-services_files/ps-propagation.png" align="absmiddle" border="0"></p>
-<H2><A name="ProvidingOSGiservices-Instancereconfiguration"></A><B>Instance reconfiguration</B></H2>
+<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%">
-<H6><A name="ProvidingOSGiservices-Overview"></A><B>Overview</B></H6>
-<UL>
- <LI><A href="apache-felix-ipojo.html" title="Apache Felix iPOJO">Home Page</A></LI>
- <LI><A href="apache-felix-ipojo-feature-overview.html" title="Apache Felix iPOJO Feature Overview">iPOJO Feature Overview</A></LI>
- <LI><A href="download.html" title="Download">Download & Install </A></LI>
-</UL>
+<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%">
+<h6><a name="ProvidingOSGiservices-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="ProvidingOSGiservices-GettingStarted"></A><B>Getting Started</B></H6>
-<UL>
- <LI><A href="ipojo-in-10-minutes.html" title="iPOJO in 10 minutes">iPOJO in 10 minutes</A></LI>
- <LI><A href="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="ipojo-advanced-tutorial.html" title="iPOJO Advanced Tutorial">iPOJO Advanced Tutorial</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/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-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>
+ <li><a href="http://felix.apache.org/site/ipojo-composition-tutorial.html" title="iPOJO Composition Tutorial">iPOJO Composition Tutorial</a></li>
+</ul>
-<H6><A name="ProvidingOSGiservices-UserGuide"></A><B>User Guide</B></H6>
-<UL>
- <LI><A href="describing-components.html" title="Describing components">Describing components (handler list) </A></LI>
- <LI><A href="how-to-use-ipojo-annotations.html" title="How to use iPOJO Annotations">How to use iPOJO Annotations</A></LI>
- <LI><A href="using-xml-schemas.html" title="Using XML Schemas">Using XML Schemas</A></LI>
- <LI><A href="ipojo-advanced-topics.html" title="iPOJO Advanced Topics">Advanced Topics</A></LI>
- <LI><A href="ipojo-faq.html" title="iPOJO FAQ">FAQ</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 (handler list) </a></li>
+ <li><a href="http://felix.apache.org/site/using-xml-schemas.html" title="Using XML Schemas">Using XML Schemas</a></li>
+ <li><a href="http://felix.apache.org/site/apache-felix-ipojo-testing-components.html" title="apache-felix-ipojo-testing-components">Testing components</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="ipojo-eclipse-plug-in.html" title="iPOJO Eclipse Plug-in">iPOJO Eclipse Plug-in</A></LI>
- <LI><A href="ipojo-ant-task.html" title="iPOJO Ant Task">iPOJO Ant Task</A></LI>
- <LI><A href="ipojo-maven-plug-in.html" title="iPOJO Maven Plug-in">iPOJO Maven Plug-in</A></LI>
- <LI><A href="ipojo-concepts-overview.html" title="iPOJO Concepts Overview">iPOJO concepts overview</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/apache-felix-ipojo-junit4osgi.html" title="apache-felix-ipojo-junit4osgi">Junit4OSGi</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>API: <SPAN class="nobr"><A href="http://people.apache.org/~clement/ipojo/api/0.8/" title="Visit page outside Confluence" rel="nofollow">0.8<SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
- <LI><A href="how-to-write-your-own-handler.html" title="How to write your own handler">How to write your own handler</A></LI>
- <LI><A href="how-to-use-ipojo-manipulation-metadata.html" title="How to use iPOJO Manipulation Metadata">How to use iPOJO Manipulation Metadata</A></LI>
-</UL>
+<h6><a name="ProvidingOSGiservices-DeveloperGuide"></a><b>Developer Guide</b></h6>
+<ul>
+ <li>API: <span class="nobr"><a href="http://people.apache.org/%7Eclement/ipojo/api/1.0/" title="Visit page outside Confluence" rel="nofollow">1.0<sup><img class="rendericon" src="providing-osgi-services_files/linkext7.gif" alt="" align="absmiddle" border="0" width="7" height="7"></sup></a></span></li>
+ <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>
+ <li><a href="http://felix.apache.org/site/dive-into-the-ipojo-manipulation-depths.html" title="Dive into the iPOJO Manipulation depths">Dive into the iPOJO Manipulation depths</a></li>
+</ul>
-<H6><A name="ProvidingOSGiservices-Misc%26Contact"></A><B>Misc & Contact</B></H6>
-<UL>
- <LI><A href="apache-felix-ipojo-issuestracker.html" title="apache-felix-ipojo-issuestracker">Issues Tracker</A></LI>
- <LI><A href="apache-felix-ipojo-supportedvms.html" title="apache-felix-ipojo-supportedVMs">Supported JVMs</A></LI>
- <LI><A href="apache-felix-ipojo-supportedosgi.html" title="apache-felix-ipojo-supportedOSGi">Supported OSGi Implementations</A></LI>
- <LI><A href="future-ideas.html" title="Future Ideas">Future Ideas</A></LI>
- <LI><A href="contact.html" title="Contact">Contact</A></LI>
- <LI><A href="related-works.html" title="Related Works">Related Works</A></LI>
- <LI><A href="article-presentations.html" title="Article & Presentations">Article & Presentations</A></LI>
-</UL>
+<h6><a name="ProvidingOSGiservices-Misc&Contact"></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><span class="nobr"><a href="http://ipojo-dark-side.blogspot.com/" title="Visit page outside Confluence" rel="nofollow">iPOJO's Dark Side Blog<sup><img class="rendericon" src="providing-osgi-services_files/linkext7.gif" alt="" align="absmiddle" border="0" width="7" height="7"></sup></a></span></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="../../cwiki.apache.org/confluence/images/icons/feed-icon-32x32.png" align="absmiddle" border="0"><SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></P></DIV></TD></TR></TBODY></TABLE>
- </DIV>
- </BODY>
+<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="providing-osgi-services_files/feed-icon-32x32.png" align="absmiddle" border="0"><sup><img class="rendericon" src="providing-osgi-services_files/linkext7.gif" alt="" align="absmiddle" border="0" width="7" height="7"></sup></a></span></p></div>
-<!-- Mirrored Site: felix.apache.org. File: /site/providing-osgi-services.html. Date: Mon, 13 Oct 2008 06:53:06 GMT -->
-</HTML>
+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script><script src="providing-osgi-services_files/ga.js" type="text/javascript"></script>
+<script type="text/javascript">
+var pageTracker = _gat._getTracker("UA-1518442-4");
+pageTracker._trackPageview();
+</script>
+</td></tr></tbody></table>
+ </div>
+ </body></html>
\ No newline at end of file