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 2016/04/27 02:20:15 UTC

svn commit: r986775 - in /websites/staging/felix/trunk/content: ./ documentation/tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-9.html

Author: buildbot
Date: Wed Apr 27 00:20:15 2016
New Revision: 986775

Log:
Staging update by buildbot for felix

Modified:
    websites/staging/felix/trunk/content/   (props changed)
    websites/staging/felix/trunk/content/documentation/tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-9.html

Propchange: websites/staging/felix/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Apr 27 00:20:15 2016
@@ -1 +1 @@
-1741127
+1741128

Modified: websites/staging/felix/trunk/content/documentation/tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-9.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-9.html (original)
+++ websites/staging/felix/trunk/content/documentation/tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-9.html Wed Apr 27 00:20:15 2016
@@ -91,7 +91,7 @@ h2:hover > .headerlink, h3:hover > .head
 <h1 id="example-9-spell-checker-service-using-declarative-services">Example 9 - Spell Checker Service using Declarative Services<a class="headerlink" href="#example-9-spell-checker-service-using-declarative-services" title="Permanent link">&para;</a></h1>
 <p>The purpose of this example is to re-implement the spell checker service in Example 6, but to do so using Declarative Service. Therefore you need to install the Declarative Services implementation into your OSGi framework.</p>
 <p>The spell checker service of Example 6 was complex because it needed to aggregate all available dictionary services and monitor their dynamic availability. In addition, the spell checker service's own availability was dependent upon the availability of dictionary services; in other words, the spell checker service had a dynamic, one-to-many dependency on dictionary services. As it turns out, service dependencies are not managed at all by the OSGi framework and end up being the responsibility of the application developer. Declarative Services tries to eliminate complex and error-prone service dependency handling by automating it. To do this, Declarative Services parses XML files in a bundle that describes the components we want to create and their service dependencies. Instead of writing a lot of complex code, we simply use annotations. At build time the tooling creates a declarative XML file which is included in the bundle. There is no need to write an Activator.</p>
-<p>The above meta-data tells the generic activator to create one instance of <code>tutorial.example8.SpellCheckerImpl</code>, which we will define next. The meta-data also tells the generic activator that the instance has an aggregate service dependency (in this case, one-to-many) on dictionary services and that the services should be tracked dynamically. It also specifies the bind and unbind methods that should be called on the instance when dictionary services appear and disappear. It is important to understand that the generic activator is constantly trying to maintain the instances defined in the meta-data file. At any given point in time, a specific instance may be valid (if all service dependencies are satisfied) or invalid (if any service dependencies are unsatisfied), but at all times the generic activator is trying to get the declared instances into a valid state. The code for our new spell checker service is very similar to the implementation in Example 6, but it is no lon
 ger implemented as an inner class of the activator. We define the new spell checker service in a file called <code>SpellCheckerImpl.java</code> as follows:</p>
+<p>We define the new spell checker service in a file called <code>SpellCheckerImpl.java</code> as follows:</p>
 <div class="codehilite"><pre><span class="cm">/*</span>
 <span class="cm"> * Apache Felix OSGi tutorial.</span>
 <span class="cm">**/</span>
@@ -198,7 +198,7 @@ h2:hover > .headerlink, h3:hover > .head
 
 <p>Notice how much simpler this service implementation is when compared to the same service implemented in Example 6. There are no references to OSGi interfaces in our application code and all tricky and complex code dealing with monitoring of services is handled for us.</p>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1741127 by cziegeler on Wed, 27 Apr 2016 00:15:07 +0000
+        Rev. 1741128 by cziegeler on Wed, 27 Apr 2016 00:20:00 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project