You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by bu...@apache.org on 2013/10/08 11:18:37 UTC
svn commit: r881682 - in /websites/staging/felix/trunk/content: ./
documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/instance-vs-service-controller.html
Author: buildbot
Date: Tue Oct 8 09:18:36 2013
New Revision: 881682
Log:
Staging update by buildbot for felix
Modified:
websites/staging/felix/trunk/content/ (props changed)
websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/instance-vs-service-controller.html
Propchange: websites/staging/felix/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Oct 8 09:18:36 2013
@@ -1 +1 @@
-1530195
+1530198
Modified: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/instance-vs-service-controller.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/instance-vs-service-controller.html (original)
+++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/instance-vs-service-controller.html Tue Oct 8 09:18:36 2013
@@ -213,29 +213,28 @@
<p>Unlike the instance lifecycle controller, such controller can:</p>
<ul>
<li>be set to <code>false</code> at startup (to not publish the services by default).</li>
-<li>
-<p>fluctuate between <code>true</code> and <code>false</code> to reflect the decision of the component implementation to publish or not the services.</p>
-<p>:::java
-@Component
-@Provides
-public class MyComponent implements MyService {</p>
-<div class="codehilite"><pre><span class="c1">// Service not published by default</span>
-<span class="p">@</span><span class="n">ServiceController</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="n">false</span><span class="p">)</span>
-<span class="n">private</span> <span class="n">boolean</span> <span class="n">controller</span><span class="p">;</span>
-
-<span class="p">@</span><span class="n">Validate</span>
-<span class="n">public</span> <span class="k">void</span> <span class="n">initialize</span><span class="p">()</span> <span class="p">{</span>
- <span class="c1">//...</span>
- <span class="c1">// publish the service once the initialization</span>
- <span class="c1">// is completed.</span>
- <span class="n">controller</span> <span class="o">=</span> <span class="n">true</span><span class="p">;</span>
-<span class="p">}</span>
+<li>fluctuate between <code>true</code> and <code>false</code> to reflect the decision of the component implementation to publish or not the services.</li>
+</ul>
+<p>The following example publishes the component's provided service only after initialization.</p>
+<div class="codehilite"><pre><span class="nd">@Component</span>
+<span class="nd">@Provides</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">MyComponent</span> <span class="kd">implements</span> <span class="n">MyService</span> <span class="o">{</span>
+
+ <span class="c1">// Service not published by default</span>
+ <span class="nd">@ServiceController</span><span class="o">(</span><span class="n">value</span><span class="o">=</span><span class="kc">false</span><span class="o">)</span>
+ <span class="kd">private</span> <span class="kt">boolean</span> <span class="n">controller</span><span class="o">;</span>
+
+ <span class="nd">@Validate</span>
+ <span class="kd">public</span> <span class="kt">void</span> <span class="nf">initialize</span><span class="o">()</span> <span class="o">{</span>
+ <span class="c1">//...</span>
+ <span class="c1">// publish the service once the initialization</span>
+ <span class="c1">// is completed.</span>
+ <span class="n">controller</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
+ <span class="o">}</span>
+<span class="o">}</span>
</pre></div>
-<p>}</p>
-</li>
-</ul>
<p>When the controller is set to <code>true</code>, the <code>@PostRegistration</code> callback is called. When it is set to <code>false</code> the <code>@PostUnregistration</code> callback is called. In both cases, the service is already registered or unregistered when the callback is invoked.</p>
<p>Notice that a <code>@ServiceController</code> controls all exposed services by default, but can be restricted to specific service interface with the <code>specification</code> attribute.</p>
</div>
@@ -252,7 +251,7 @@ public class MyComponent implements MySe
may be trademarks or registered trademarks of their respective owners.
</div>
<div class="timestamp span3 offset2">
- Rev. 1530195 by guillaume on Tue, 8 Oct 2013 09:12:32 +0000
+ Rev. 1530198 by guillaume on Tue, 8 Oct 2013 09:18:27 +0000
</div>
</div>
</footer>