felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r879444 - in /websites/staging/felix/trunk/content: ./ documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-component.html
Date Sun, 22 Sep 2013 15:19:39 GMT
Author: buildbot
Date: Sun Sep 22 15:19:38 2013
New Revision: 879444

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-component.html

Propchange: websites/staging/felix/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sun Sep 22 15:19:38 2013
@@ -1 +1 @@
-1525374
+1525375

Modified: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-component.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-component.html
(original)
+++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-component.html
Sun Sep 22 15:19:38 2013
@@ -397,17 +397,17 @@ exposed service properties.</p>
 instance.</p>
 <h3 id="usage-examples">Usage Examples</h3>
 <p>In the following example, a "VideoPlayer" Service is registered into the OSGi registry
each time an active bundle containing a "Video-Path" manifest header is detected:</p>
-<div class="codehilite"><pre> <span class="p">@</span><span class="n">BundleAdapterService</span><span
class="p">(</span><span class="n">filter</span> <span class="p">=</span>
&quot;<span class="p">(</span><span class="n">Video</span><span
class="o">-</span><span class="n">Path</span><span class="p">=</span><span
class="o">*</span><span class="p">)</span>&quot;<span class="p">,</span>
<span class="n">stateMask</span> <span class="p">=</span> <span
class="n">Bundle</span><span class="p">.</span><span class="n">ACTIVE</span><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">public</span> <span class="n">class</span> <span
class="n">VideoPlayerImpl</span> <span class="n">implements</span> <span
class="n">VideoPlayer</span> <span class="p">{</span>
-     <span class="n">Bundle</span> <span class="n">bundle</span><span
class="p">;</span> <span class="o">//</span> <span class="n">Injected</span>
<span class="n">by</span> <span class="n">reflection</span>
-
-     <span class="n">void</span> <span class="n">play</span><span
class="p">()</span> <span class="p">{</span>
-         <span class="n">URL</span> <span class="n">mpegFile</span>
<span class="p">=</span> <span class="n">bundle</span><span class="p">.</span><span
class="n">getEntry</span><span class="p">(</span><span class="n">bundle</span><span
class="p">.</span><span class="n">getHeaders</span><span class="p">().</span><span
class="n">get</span><span class="p">(</span>&quot;<span class="n">Video</span><span
class="o">-</span><span class="n">Path</span>&quot;<span class="p">));</span>
-         <span class="o">//</span> <span class="n">play</span> <span
class="n">the</span> <span class="n">video</span> <span class="n">provided</span>
<span class="n">by</span> <span class="n">the</span> <span class="n">bundle</span>
<span class="p">...</span>
-     <span class="p">}</span>
+<div class="codehilite"><pre><span class="nd">@BundleAdapterService</span><span
class="o">(</span><span class="n">filter</span> <span class="o">=</span>
<span class="s">&quot;(Video-Path=*)&quot;</span><span class="o">,</span>
<span class="n">stateMask</span> <span class="o">=</span> <span
class="n">Bundle</span><span class="o">.</span><span class="na">ACTIVE</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="kd">public</span> <span class="kd">class</span> <span
class="nc">VideoPlayerImpl</span> <span class="kd">implements</span>
<span class="n">VideoPlayer</span> <span class="o">{</span>
+    <span class="n">Bundle</span> <span class="n">bundle</span><span
class="o">;</span> <span class="c1">// Injected by reflection</span>
+
+    <span class="kt">void</span> <span class="nf">play</span><span
class="o">()</span> <span class="o">{</span>
+        <span class="n">URL</span> <span class="n">mpegFile</span>
<span class="o">=</span> <span class="n">bundle</span><span class="o">.</span><span
class="na">getEntry</span><span class="o">(</span><span class="n">bundle</span><span
class="o">.</span><span class="na">getHeaders</span><span class="o">().</span><span
class="na">get</span><span class="o">(</span><span class="s">&quot;Video-Path&quot;</span><span
class="o">));</span>
+        <span class="c1">// play the video provided by the bundle ...</span>
+    <span class="o">}</span>
 
-     <span class="n">void</span> <span class="n">stop</span><span
class="p">()</span> <span class="p">{}</span>
- <span class="p">}</span>
+    <span class="kt">void</span> <span class="nf">stop</span><span
class="o">()</span> <span class="o">{}</span>
+<span class="o">}</span>
 </pre></div>
 
 
@@ -434,15 +434,15 @@ properties will be propagated from the r
 <p>Here, the "VideoPlayer" service provides a video service on top of any movie 
 resources, with service properties "host"/"port"/"protocol"/"path" extracted 
 from the resource URL:</p>
-<div class="codehilite"><pre> <span class="p">@</span><span class="n">ResourceAdapterService</span><span
class="p">(</span><span class="n">filter</span> <span class="p">=</span>
&quot;<span class="p">(</span><span class="o">&amp;</span><span
class="p">(</span><span class="n">path</span><span class="p">=</span><span
class="o">/</span><span class="n">videos</span><span class="o">/*</span><span
class="p">.</span><span class="n">mkv</span><span class="p">)(</span><span
class="n">host</span><span class="p">=</span><span class="n">localhost</span><span
class="p">))</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">public</span> <span class="n">class</span> <span
class="n">VideoPlayerImpl</span> <span class="n">implements</span> <span
class="n">VideoPlayer</span> <span class="p">{</span>
-     <span class="o">//</span> <span class="n">Injected</span> <span
class="n">by</span> <span class="n">reflection</span>
-     <span class="n">URL</span> <span class="n">resource</span><span
class="p">;</span>
-
-     <span class="n">void</span> <span class="n">play</span><span
class="p">()</span> <span class="p">{}</span> <span class="o">//</span>
<span class="n">play</span> <span class="n">video</span> <span
class="n">referenced</span> <span class="n">by</span> <span class="n">this</span><span
class="p">.</span><span class="n">resource</span>     
-     <span class="n">void</span> <span class="n">stop</span><span
class="p">()</span> <span class="p">{}</span> <span class="o">//</span>
<span class="n">stop</span> <span class="n">playing</span> <span
class="n">the</span> <span class="n">video</span>
-     <span class="n">void</span> <span class="n">transcode</span><span
class="p">()</span> <span class="p">{}</span> <span class="o">//</span>
<span class="p">...</span>
- <span class="p">}</span>
+<div class="codehilite"><pre><span class="nd">@ResourceAdapterService</span><span
class="o">(</span><span class="n">filter</span> <span class="o">=</span>
<span class="s">&quot;(&amp;(path=/videos/*.mkv)(host=localhost))&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="kd">public</span> <span class="kd">class</span> <span
class="nc">VideoPlayerImpl</span> <span class="kd">implements</span>
<span class="n">VideoPlayer</span> <span class="o">{</span>
+    <span class="c1">// Injected by reflection</span>
+    <span class="n">URL</span> <span class="n">resource</span><span
class="o">;</span>
+
+    <span class="kt">void</span> <span class="nf">play</span><span
class="o">()</span> <span class="o">{}</span> <span class="c1">//
play video referenced by this.resource     </span>
+    <span class="kt">void</span> <span class="nf">stop</span><span
class="o">()</span> <span class="o">{}</span> <span class="c1">//
stop playing the video</span>
+    <span class="kt">void</span> <span class="nf">transcode</span><span
class="o">()</span> <span class="o">{}</span> <span class="c1">//
...</span>
+<span class="o">}</span>
 </pre></div>
 
 
@@ -591,37 +591,37 @@ factory pid:</p>
 <div class="codehilite"><pre><span class="nd">@FactoryConfigurationAdapterService</span><span
class="o">(</span><span class="n">factoryPid</span><span class="o">=</span><span
class="s">&quot;DictionaryServiceFactory&quot;</span><span class="o">,</span>
<span class="n">updated</span><span class="o">=</span><span class="s">&quot;updated&quot;</span><span
class="o">)</span>
 <span class="kd">public</span> <span class="kd">class</span> <span
class="nc">DictionaryImpl</span> <span class="kd">implements</span> <span
class="n">DictionaryService</span>
 <span class="o">{</span>
-         <span class="cm">/**</span>
-<span class="cm">          * The key of our config admin dictionary language.</span>
-<span class="cm">          */</span>
-         <span class="kd">final</span> <span class="kd">static</span>
<span class="n">String</span> <span class="n">LANG</span> <span
class="o">=</span> <span class="s">&quot;lang&quot;</span><span
class="o">;</span>
-
-         <span class="cm">/**</span>
-<span class="cm">          * The key of our config admin dictionary values.</span>
-<span class="cm">          */</span>
-         <span class="kd">final</span> <span class="kd">static</span>
<span class="n">String</span> <span class="n">WORDS</span> <span
class="o">=</span> <span class="s">&quot;words&quot;</span><span
class="o">;</span>
-
-         <span class="cm">/**</span>
-<span class="cm">          * We store all configured words in a thread-safe data structure,
because ConfigAdmin</span>
-<span class="cm">          * may invoke our updated method at any time.</span>
-<span class="cm">          */</span>
-         <span class="kd">private</span> <span class="n">CopyOnWriteArrayList</span><span
class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span>
<span class="n">m_words</span> <span class="o">=</span> <span class="k">new</span>
<span class="n">CopyOnWriteArrayList</span><span class="o">&lt;</span><span
class="n">String</span><span class="o">&gt;();</span>
-
-         <span class="cm">/**</span>
-<span class="cm">          * Our Dictionary language.</span>
-<span class="cm">          */</span>
-         <span class="kd">private</span> <span class="n">String</span>
<span class="n">m_lang</span><span class="o">;</span>
-
-         <span class="kd">protected</span> <span class="kt">void</span>
<span class="nf">updated</span><span class="o">(</span><span class="n">Dictionary</span><span
class="o">&lt;</span><span class="n">String</span><span class="o">,</span>
<span class="o">?&gt;</span> <span class="n">config</span><span
class="o">)</span> <span class="o">{</span>
-             <span class="n">m_lang</span> <span class="o">=</span>
<span class="o">(</span><span class="n">String</span><span class="o">)</span>
<span class="n">config</span><span class="o">.</span><span class="na">get</span><span
class="o">(</span><span class="n">LANG</span><span class="o">);</span>
-             <span class="n">m_words</span><span class="o">.</span><span
class="na">clear</span><span class="o">();</span>
-             <span class="n">String</span><span class="o">[]</span>
<span class="n">words</span> <span class="o">=</span> <span class="o">(</span><span
class="n">String</span><span class="o">[])</span> <span class="n">config</span><span
class="o">.</span><span class="na">get</span><span class="o">(</span><span
class="n">WORDS</span><span class="o">);</span>
-             <span class="k">for</span> <span class="o">(</span><span
class="n">String</span> <span class="n">word</span> <span class="o">:</span>
<span class="n">words</span><span class="o">)</span> <span class="o">{</span>
-                 <span class="n">m_words</span><span class="o">.</span><span
class="na">add</span><span class="o">(</span><span class="n">word</span><span
class="o">);</span>
-             <span class="o">}</span>
-         <span class="o">}</span>   
-         <span class="c1">/// ...</span>
-     <span class="o">}</span>
+    <span class="cm">/**</span>
+<span class="cm">      * The key of our config admin dictionary language.</span>
+<span class="cm">      */</span>
+    <span class="kd">final</span> <span class="kd">static</span>
<span class="n">String</span> <span class="n">LANG</span> <span
class="o">=</span> <span class="s">&quot;lang&quot;</span><span
class="o">;</span>
+
+    <span class="cm">/**</span>
+<span class="cm">      * The key of our config admin dictionary values.</span>
+<span class="cm">      */</span>
+    <span class="kd">final</span> <span class="kd">static</span>
<span class="n">String</span> <span class="n">WORDS</span> <span
class="o">=</span> <span class="s">&quot;words&quot;</span><span
class="o">;</span>
+
+    <span class="cm">/**</span>
+<span class="cm">      * We store all configured words in a thread-safe data structure,
because ConfigAdmin</span>
+<span class="cm">      * may invoke our updated method at any time.</span>
+<span class="cm">      */</span>
+    <span class="kd">private</span> <span class="n">CopyOnWriteArrayList</span><span
class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span>
<span class="n">m_words</span> <span class="o">=</span> <span class="k">new</span>
<span class="n">CopyOnWriteArrayList</span><span class="o">&lt;</span><span
class="n">String</span><span class="o">&gt;();</span>
+
+    <span class="cm">/**</span>
+<span class="cm">      * Our Dictionary language.</span>
+<span class="cm">      */</span>
+    <span class="kd">private</span> <span class="n">String</span>
<span class="n">m_lang</span><span class="o">;</span>
+
+    <span class="kd">protected</span> <span class="kt">void</span>
<span class="nf">updated</span><span class="o">(</span><span class="n">Dictionary</span><span
class="o">&lt;</span><span class="n">String</span><span class="o">,</span>
<span class="o">?&gt;</span> <span class="n">config</span><span
class="o">)</span> <span class="o">{</span>
+        <span class="n">m_lang</span> <span class="o">=</span> <span
class="o">(</span><span class="n">String</span><span class="o">)</span>
<span class="n">config</span><span class="o">.</span><span class="na">get</span><span
class="o">(</span><span class="n">LANG</span><span class="o">);</span>
+        <span class="n">m_words</span><span class="o">.</span><span
class="na">clear</span><span class="o">();</span>
+        <span class="n">String</span><span class="o">[]</span> <span
class="n">words</span> <span class="o">=</span> <span class="o">(</span><span
class="n">String</span><span class="o">[])</span> <span class="n">config</span><span
class="o">.</span><span class="na">get</span><span class="o">(</span><span
class="n">WORDS</span><span class="o">);</span>
+        <span class="k">for</span> <span class="o">(</span><span
class="n">String</span> <span class="n">word</span> <span class="o">:</span>
<span class="n">words</span><span class="o">)</span> <span class="o">{</span>
+            <span class="n">m_words</span><span class="o">.</span><span
class="na">add</span><span class="o">(</span><span class="n">word</span><span
class="o">);</span>
+        <span class="o">}</span>
+     <span class="o">}</span>   
+         <span class="c1">// ...</span>
+<span class="o">}</span>
 </pre></div>
 
 
@@ -650,41 +650,41 @@ factory pid:</p>
   <span class="o">)</span>  
   <span class="kd">public</span> <span class="kd">class</span> <span
class="nc">DictionaryImpl</span> <span class="kd">implements</span> <span
class="n">DictionaryService</span>
   <span class="o">{</span>
-         <span class="cm">/**</span>
-<span class="cm">          * The key of our config admin dictionary language.</span>
-<span class="cm">          */</span>
-         <span class="kd">final</span> <span class="kd">static</span>
<span class="n">String</span> <span class="n">LANG</span> <span
class="o">=</span> <span class="s">&quot;lang&quot;</span><span
class="o">;</span>
-
-         <span class="cm">/**</span>
-<span class="cm">          * The key of our config admin dictionary values.</span>
-<span class="cm">          */</span>
-         <span class="kd">final</span> <span class="kd">static</span>
<span class="n">String</span> <span class="n">WORDS</span> <span
class="o">=</span> <span class="s">&quot;words&quot;</span><span
class="o">;</span>
-
-         <span class="cm">/**</span>
-<span class="cm">          * We store all configured words in a thread-safe data structure,
because ConfigAdmin</span>
-<span class="cm">          * may invoke our updated method at any time.</span>
-<span class="cm">          */</span>
-         <span class="kd">private</span> <span class="n">CopyOnWriteArrayList</span><span
class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span>
<span class="n">m_words</span> <span class="o">=</span> <span class="k">new</span>
<span class="n">CopyOnWriteArrayList</span><span class="o">&lt;</span><span
class="n">String</span><span class="o">&gt;();</span>
-
-         <span class="cm">/**</span>
-<span class="cm">          * Our Dictionary language.</span>
-<span class="cm">          */</span>
-         <span class="kd">private</span> <span class="n">String</span>
<span class="n">m_lang</span><span class="o">;</span>
-
-         <span class="kd">protected</span> <span class="kt">void</span>
<span class="nf">updated</span><span class="o">(</span><span class="n">Dictionary</span><span
class="o">&lt;</span><span class="n">String</span><span class="o">,</span>
<span class="o">?&gt;</span> <span class="n">config</span><span
class="o">)</span> <span class="o">{</span>
-             <span class="n">m_lang</span> <span class="o">=</span>
<span class="o">(</span><span class="n">String</span><span class="o">)</span>
<span class="n">config</span><span class="o">.</span><span class="na">get</span><span
class="o">(</span><span class="n">LANG</span><span class="o">);</span>
-             <span class="n">m_words</span><span class="o">.</span><span
class="na">clear</span><span class="o">();</span>
-             <span class="n">String</span><span class="o">[]</span>
<span class="n">words</span> <span class="o">=</span> <span class="o">(</span><span
class="n">String</span><span class="o">[])</span> <span class="n">config</span><span
class="o">.</span><span class="na">get</span><span class="o">(</span><span
class="n">WORDS</span><span class="o">);</span>
-             <span class="k">for</span> <span class="o">(</span><span
class="n">String</span> <span class="n">word</span> <span class="o">:</span>
<span class="n">words</span><span class="o">)</span> <span class="o">{</span>
-                 <span class="n">m_words</span><span class="o">.</span><span
class="na">add</span><span class="o">(</span><span class="n">word</span><span
class="o">);</span>
-             <span class="o">}</span>
+     <span class="cm">/**</span>
+<span class="cm">       * The key of our config admin dictionary language.</span>
+<span class="cm">       */</span>
+     <span class="kd">final</span> <span class="kd">static</span>
<span class="n">String</span> <span class="n">LANG</span> <span
class="o">=</span> <span class="s">&quot;lang&quot;</span><span
class="o">;</span>
+
+     <span class="cm">/**</span>
+<span class="cm">       * The key of our config admin dictionary values.</span>
+<span class="cm">       */</span>
+     <span class="kd">final</span> <span class="kd">static</span>
<span class="n">String</span> <span class="n">WORDS</span> <span
class="o">=</span> <span class="s">&quot;words&quot;</span><span
class="o">;</span>
+
+     <span class="cm">/**</span>
+<span class="cm">       * We store all configured words in a thread-safe data structure,
because ConfigAdmin</span>
+<span class="cm">       * may invoke our updated method at any time.</span>
+<span class="cm">       */</span>
+     <span class="kd">private</span> <span class="n">CopyOnWriteArrayList</span><span
class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span>
<span class="n">m_words</span> <span class="o">=</span> <span class="k">new</span>
<span class="n">CopyOnWriteArrayList</span><span class="o">&lt;</span><span
class="n">String</span><span class="o">&gt;();</span>
+
+     <span class="cm">/**</span>
+<span class="cm">       * Our Dictionary language.</span>
+<span class="cm">       */</span>
+     <span class="kd">private</span> <span class="n">String</span>
<span class="n">m_lang</span><span class="o">;</span>
+
+     <span class="kd">protected</span> <span class="kt">void</span>
<span class="nf">updated</span><span class="o">(</span><span class="n">Dictionary</span><span
class="o">&lt;</span><span class="n">String</span><span class="o">,</span>
<span class="o">?&gt;</span> <span class="n">config</span><span
class="o">)</span> <span class="o">{</span>
+         <span class="n">m_lang</span> <span class="o">=</span> <span
class="o">(</span><span class="n">String</span><span class="o">)</span>
<span class="n">config</span><span class="o">.</span><span class="na">get</span><span
class="o">(</span><span class="n">LANG</span><span class="o">);</span>
+         <span class="n">m_words</span><span class="o">.</span><span
class="na">clear</span><span class="o">();</span>
+         <span class="n">String</span><span class="o">[]</span> <span
class="n">words</span> <span class="o">=</span> <span class="o">(</span><span
class="n">String</span><span class="o">[])</span> <span class="n">config</span><span
class="o">.</span><span class="na">get</span><span class="o">(</span><span
class="n">WORDS</span><span class="o">);</span>
+         <span class="k">for</span> <span class="o">(</span><span
class="n">String</span> <span class="n">word</span> <span class="o">:</span>
<span class="n">words</span><span class="o">)</span> <span class="o">{</span>
+             <span class="n">m_words</span><span class="o">.</span><span
class="na">add</span><span class="o">(</span><span class="n">word</span><span
class="o">);</span>
          <span class="o">}</span>
+     <span class="o">}</span>
 
-         <span class="c1">// ...</span>
+     <span class="c1">// ...</span>
 <span class="o">}</span>
 </pre></div>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1525374 by pderop on Sun, 22 Sep 2013 15:12:45 +0000
+        Rev. 1525375 by pderop on Sun, 22 Sep 2013 15:19:30 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project



Mime
View raw message