felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r879471 - in /websites/staging/felix/trunk/content: ./ documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-lifecycle.html
Date Sun, 22 Sep 2013 20:03:00 GMT
Author: buildbot
Date: Sun Sep 22 20:02:59 2013
New Revision: 879471

Log:
Staging update by buildbot for felix

Modified:
    websites/staging/felix/trunk/content/   (props changed)
    websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-lifecycle.html

Propchange: websites/staging/felix/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sun Sep 22 20:02:59 2013
@@ -1 +1 @@
-1525421
+1525423

Modified: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-lifecycle.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-lifecycle.html
(original)
+++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-lifecycle.html
Sun Sep 22 20:02:59 2013
@@ -158,10 +158,10 @@ Alternatively, you can also configure so
 
 
 <p>Then you can return this map from your @Init method:</p>
-<div class="codehilite"><pre><span class="nd">@Init</span>
-<span class="n">Map</span> <span class="nf">init</span><span class="o">()</span>
<span class="o">{</span>
-    <span class="k">return</span> <span class="k">new</span> <span
class="nf">HashMap</span><span class="o">()</span> <span class="o">;</span>
-<span class="o">}</span>
+<div class="codehilite"><pre><span class="p">@</span><span class="n">Init</span>
+<span class="n">Map</span> <span class="n">init</span><span class="p">()</span>
<span class="p">{</span>
+    <span class="k">return</span> <span class="n">new</span> <span
class="n">HashMap</span><span class="p">()</span> <span class="p">;</span>
+<span class="p">}</span>
 </pre></div>
 
 
@@ -171,41 +171,41 @@ Alternatively, you can also configure so
 <div class="codehilite"><pre><span class="cm">/**</span>
 <span class="cm"> * A component whose FooService dependency filter is configured from
ConfigAdmin</span>
 <span class="cm"> */</span>
-<span class="nd">@Component</span>
-<span class="kd">class</span> <span class="nc">X</span> <span
class="o">{</span>
-    <span class="kd">private</span> <span class="n">Dictionary</span>
<span class="n">m_config</span><span class="o">;</span>
+<span class="p">@</span><span class="n">Component</span>
+<span class="k">class</span> <span class="no">X</span> <span class="p">{</span>
+    <span class="n">private</span> <span class="n">Dictionary</span>
<span class="n">m_config</span><span class="p">;</span>
 
     <span class="cm">/**</span>
 <span class="cm">     * Initialize our component from config ... and store the config
for later usage (from our init method)</span>
 <span class="cm">     */</span>
-    <span class="nd">@ConfigurationDependency</span><span class="o">(</span><span
class="n">pid</span><span class="o">=</span><span class="s">&quot;MyPid&quot;</span><span
class="o">)</span>
-    <span class="kt">void</span> <span class="nf">configure</span><span
class="o">(</span><span class="n">Dictionary</span> <span class="n">conf</span><span
class="o">)</span> <span class="o">{</span>
-         <span class="n">m_config</span> <span class="o">=</span>
<span class="n">config</span><span class="o">;</span>
-    <span class="o">}</span>
+    <span class="p">@</span><span class="n">ConfigurationDependency</span><span
class="p">(</span><span class="n">pid</span><span class="o">=</span><span
class="s">&quot;MyPid&quot;</span><span class="p">)</span>
+    <span class="k">void</span> <span class="n">configure</span><span
class="p">(</span><span class="n">Dictionary</span> <span class="n">conf</span><span
class="p">)</span> <span class="p">{</span>
+         <span class="n">m_config</span> <span class="o">=</span>
<span class="k">config</span><span class="p">;</span>
+    <span class="p">}</span>
 
     <span class="cm">/**</span>
 <span class="cm">     * All unnamed dependencies are injected: we can now configure
other named</span>
 <span class="cm">     * dependencies, using the already injected configuration.</span>
 <span class="cm">     * The returned Map will be used to configure our &quot;foo&quot;
Dependency (see below)</span>
 <span class="cm">     */</span>
-    <span class="nd">@Init</span>
-    <span class="n">Map</span> <span class="nf">init</span><span
class="o">()</span> <span class="o">{</span>
-        <span class="k">return</span> <span class="k">new</span>
<span class="nf">HashMap</span><span class="o">()</span> <span
class="o">;</span>
-    <span class="o">}</span>
+    <span class="p">@</span><span class="n">Init</span>
+    <span class="n">Map</span> <span class="n">init</span><span
class="p">()</span> <span class="p">{</span>
+        <span class="k">return</span> <span class="k">new</span>
<span class="n">HashMap</span><span class="p">()</span> <span class="p">;</span>
+    <span class="p">}</span>
 
     <span class="cm">/**</span>
 <span class="cm">     * This named dependency filter/required flag will be configured
by our init method (see above).</span>
 <span class="cm">     */</span>
-    <span class="nd">@ServiceDependency</span><span class="o">(</span><span
class="n">name</span><span class="o">=</span><span class="s">&quot;foo&quot;</span><span
class="o">)</span>
-    <span class="n">FooService</span> <span class="n">fooService</span><span
class="o">;</span>
+    <span class="p">@</span><span class="n">ServiceDependency</span><span
class="p">(</span><span class="n">name</span><span class="o">=</span><span
class="s">&quot;foo&quot;</span><span class="p">)</span>
+    <span class="n">FooService</span> <span class="n">fooService</span><span
class="p">;</span>
 
     <span class="cm">/**</span>
 <span class="cm">     * All dependencies are injected and our service is now ready
to be published.</span>
 <span class="cm">     */</span>
-    <span class="nd">@Start</span>
-    <span class="kt">void</span> <span class="nf">start</span><span
class="o">()</span> <span class="o">{</span>
-    <span class="o">}</span>
-<span class="o">}</span>
+    <span class="p">@</span><span class="n">Start</span>
+    <span class="k">void</span> <span class="n">start</span><span
class="p">()</span> <span class="p">{</span>
+    <span class="p">}</span>
+<span class="p">}</span>
 </pre></div>
 
 
@@ -272,22 +272,22 @@ following:</p>
 <li>Any Dependency whose <em>propagate</em> attribute is set to true will
also insert its properties to the published service</li>
 </ul>
 <p>But when the component needs to specify some service properties dynamically (not
statically from the annotation), then it may do so by just returning a Map from the @Start
callback. For instance:</p>
-<div class="codehilite"><pre><span class="nd">@Component</span><span
class="o">(</span><span class="n">properties</span><span class="o">={</span><span
class="nd">@Property</span><span class="o">(</span><span class="n">name</span><span
class="o">=</span><span class="s">&quot;foo&quot;</span><span
class="o">,</span> <span class="n">value</span><span class="o">=</span><span
class="s">&quot;bar&quot;</span><span class="o">)})</span>
-<span class="kd">public</span> <span class="kd">class</span> <span
class="nc">MyServiceImpl</span> <span class="kd">implements</span> <span
class="n">MyService</span> <span class="o">{</span>
-    <span class="nd">@ConfigurationDependency</span><span class="o">(</span><span
class="n">pid</span><span class="o">=</span><span class="s">&quot;MyPid&quot;</span><span
class="o">,</span> <span class="n">propagate</span><span class="o">=</span><span
class="kc">true</span><span class="o">)</span>
-    <span class="kt">void</span> <span class="nf">updated</span><span
class="o">(</span><span class="n">Dictionary</span> <span class="n">conf</span><span
class="o">)</span> <span class="o">{</span>
-       <span class="c1">// &quot;conf&quot; contains foo2=bar2, for example,
and since we have set the &quot;propagate&quot; attribute to true, then</span>
-       <span class="c1">// the property will be propagated to our published service
...</span>
-    <span class="o">}</span>
-
-    <span class="nd">@Start</span>
-    <span class="n">Map</span> <span class="nf">start</span><span
class="o">()</span> <span class="o">{</span>
-        <span class="c1">// Return some extra properties to be inserted along with
our published properties. This map takes</span>
-        <span class="c1">// precedence, and may override some properties specified
in our @Component annotation, or some properties</span>
-        <span class="c1">// propagated from our @ConfigurationDependency dependency
...</span>
-        <span class="k">return</span> <span class="k">new</span>
<span class="nf">HashMap</span><span class="o">()</span> <span
class="o">;</span>
-    <span class="o">}</span>
-<span class="o">}</span>
+<div class="codehilite"><pre><span class="p">@</span><span class="n">Component</span><span
class="p">(</span><span class="k">properties</span><span class="p">={@</span><span
class="n">Property</span><span class="p">(</span><span class="n">name</span><span
class="p">=</span>&quot;<span class="n">foo</span>&quot;<span
class="p">,</span> <span class="n">value</span><span class="p">=</span>&quot;<span
class="n">bar</span>&quot;<span class="p">)})</span>
+<span class="n">public</span> <span class="n">class</span> <span
class="n">MyServiceImpl</span> <span class="n">implements</span> <span
class="n">MyService</span> <span class="p">{</span>
+    <span class="p">@</span><span class="n">ConfigurationDependency</span><span
class="p">(</span><span class="n">pid</span><span class="p">=</span>&quot;<span
class="n">MyPid</span>&quot;<span class="p">,</span> <span class="n">propagate</span><span
class="p">=</span><span class="n">true</span><span class="p">)</span>
+    <span class="n">void</span> <span class="n">updated</span><span
class="p">(</span><span class="n">Dictionary</span> <span class="n">conf</span><span
class="p">)</span> <span class="p">{</span>
+       <span class="o">//</span> &quot;<span class="n">conf</span>&quot;
<span class="n">contains</span> <span class="n">foo2</span><span
class="p">=</span><span class="n">bar2</span><span class="p">,</span>
<span class="k">for</span> <span class="n">example</span><span
class="p">,</span> <span class="n">and</span> <span class="n">since</span>
<span class="n">we</span> <span class="n">have</span> <span class="n">set</span>
<span class="n">the</span> &quot;<span class="n">propagate</span>&quot;
<span class="n">attribute</span> <span class="n">to</span> <span
class="n">true</span><span class="p">,</span> <span class="n">then</span>
+       <span class="o">//</span> <span class="n">the</span> <span
class="n">property</span> <span class="n">will</span> <span class="n">be</span>
<span class="n">propagated</span> <span class="n">to</span> <span
class="n">our</span> <span class="n">published</span> <span class="n">service</span>
<span class="p">...</span>
+    <span class="p">}</span>
+
+    <span class="p">@</span><span class="n">Start</span>
+    <span class="n">Map</span> <span class="n">start</span><span
class="p">()</span> <span class="p">{</span>
+        <span class="o">//</span> <span class="n">Return</span> <span
class="n">some</span> <span class="n">extra</span> <span class="k">properties</span>
<span class="n">to</span> <span class="n">be</span> <span class="n">inserted</span>
<span class="n">along</span> <span class="n">with</span> <span
class="n">our</span> <span class="n">published</span> <span class="k">properties</span><span
class="p">.</span> <span class="n">This</span> <span class="n">map</span>
<span class="n">takes</span>
+        <span class="o">//</span> <span class="n">precedence</span><span
class="p">,</span> <span class="n">and</span> <span class="n">may</span>
<span class="n">override</span> <span class="n">some</span> <span
class="k">properties</span> <span class="n">specified</span> <span
class="n">in</span> <span class="n">our</span> <span class="p">@</span><span
class="n">Component</span> <span class="n">annotation</span><span
class="p">,</span> <span class="n">or</span> <span class="n">some</span>
<span class="k">properties</span>
+        <span class="o">//</span> <span class="n">propagated</span>
<span class="n">from</span> <span class="n">our</span> <span class="p">@</span><span
class="n">ConfigurationDependency</span> <span class="n">dependency</span>
<span class="p">...</span>
+        <span class="k">return</span> <span class="n">new</span>
<span class="n">HashMap</span><span class="p">()</span> <span class="p">;</span>
+    <span class="p">}</span>
+<span class="p">}</span>
 </pre></div>
 
 
@@ -300,7 +300,7 @@ following:</p>
 <p>Notice that properties returned by the Map take precedence over other properties,
and may 
 override some of them.</p>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1525421 by pderop on Sun, 22 Sep 2013 19:55:37 +0000
+        Rev. 1525423 by pderop on Sun, 22 Sep 2013 20:02:51 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project



Mime
View raw message