You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by pd...@apache.org on 2013/09/21 01:10:33 UTC

svn commit: r1525171 - in /felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager: ./ apache-felix-dependency-manager-using-annotations/

Author: pderop
Date: Fri Sep 20 23:10:33 2013
New Revision: 1525171

URL: http://svn.apache.org/r1525171
Log:
CMS migration

Added:
    felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-lifecycle.mdtext
      - copied, changed from r1525155, felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/apache-felix-dependency-manager-using-annotations-lifecycle.mdtext
Removed:
    felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/apache-felix-dependency-manager-using-annotations-lifecycle.mdtext
Modified:
    felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations.mdtext
    felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-component.mdtext
    felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-dependencies.mdtext
    felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-quickstart.mdtext
    felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-spellchecker.mdtext

Modified: felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations.mdtext
URL: http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations.mdtext?rev=1525171&r1=1525170&r2=1525171&view=diff
==============================================================================
--- felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations.mdtext (original)
+++ felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations.mdtext Fri Sep 20 23:10:33 2013
@@ -16,7 +16,10 @@ components can interact with the dynamic
 * [{{ refs.dependencymanager-annotations-spellchecker.headers.excerpt }}]({{ refs.dependencymanager-annotations-spellchecker.path }})
 * [{{ refs.dependencymanager-annotations-component.headers.excerpt }}]({{ refs.dependencymanager-annotations-component.path }})
 * [{{ refs.dependencymanager-annotations-dependencies.headers.excerpt }}]({{ refs.dependencymanager-annotations-dependencies.path }})
+
+* [{{ refs.dependencymanager-annotations-lifecycle.headers.excerpt }}]({{ refs.dependencymanager-annotations-lifecycle.path }})
 * [Lifecycle]({{ refs.apache-felix-dependency-manager-using-annotations-lifecycle.path }}) Explains the DM component lifecycle and how components interact with the dynamic OSGI service model.
+
 * [Composition]({{ refs.apache-felix-dependency-manager-using-annotations-composition.path }}) Explains how a component may be implemented using multiple object instances.
 * [BndTools Tutorial](https://bitbucket.org/marrs/bndtools-dmdemo) A BndTools based demo of DependencyManager annotations.
 

Modified: felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-component.mdtext
URL: http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-component.mdtext?rev=1525171&r1=1525170&r2=1525171&view=diff
==============================================================================
--- felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-component.mdtext (original)
+++ felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-component.mdtext Fri Sep 20 23:10:33 2013
@@ -1,6 +1,6 @@
 translation_pending: true
 Title: Dependency Manager Components Annotations
-Excerpt: Explains how to write Dependency Manager service components using annotations.
+Excerpt: Dependency Manager components annotations.
 
 This page describes the different types of Dependency Manager components:
 

Modified: felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-dependencies.mdtext
URL: http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-dependencies.mdtext?rev=1525171&r1=1525170&r2=1525171&view=diff
==============================================================================
--- felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-dependencies.mdtext (original)
+++ felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-dependencies.mdtext Fri Sep 20 23:10:33 2013
@@ -1,6 +1,6 @@
 translation_pending: true
 Title: Dependency Manager Dependencies Annotations
-Excerpt: Explains how to annotate component dependencies.
+Excerpt: Dependency Manager dependency annotations
 
 This section describes the various dependencies supported with annotations.
 

Copied: felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-lifecycle.mdtext (from r1525155, felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/apache-felix-dependency-manager-using-annotations-lifecycle.mdtext)
URL: http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-lifecycle.mdtext?p2=felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-lifecycle.mdtext&p1=felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/apache-felix-dependency-manager-using-annotations-lifecycle.mdtext&r1=1525155&r2=1525171&rev=1525171&view=diff
==============================================================================
--- felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/apache-felix-dependency-manager-using-annotations-lifecycle.mdtext (original)
+++ felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-lifecycle.mdtext Fri Sep 20 23:10:33 2013
@@ -1,10 +1,6 @@
 translation_pending: true
-Title: Apache Felix Dependency Manager - Using Annotations - Lifecycle
-
-# Annotations - Lifecycle
-
-
-
+Title: Dependency Manager Component Lifecycle
+Excerpt: Dependency Manager component lifecycle
 
 A component has a lifecycle that controls when it is started or stopped. A bundle must be started before the DM Runtime can process its components. When the bundle is started, the DM Runtime then parses a specific *DependencyManager-Component* manifest header, which points to a list of descriptors describing all annotated components. Such descriptors are actually generated at compilation time, and annotation are not reflectively parsed at runtime. Only the descriptor is used to process the components. For each component, the DM Runtime first ensures that all dependencies are satisfied before activating it. Likewise, the component is deactivated when some of the required dependencies are not available anymore or when the bundle is stopped. Unless the bundle is stopped, components may be deactivated and reactivated, depending on the departure and arrival of required dependencies. The manager which is in charge of maintaining the state of components is implemented in the DM Runtime bun
 dle (org.apache.felix.dm.runtime bundle).
 
@@ -12,8 +8,6 @@ A component has a lifecycle that control
 
 ### Component Activation
 
-
-
 Activating a component consists of the following steps:
 1. Wait for all required dependencies to be available. When all required dependencies are available:
 1. * Instantiate the component.
@@ -40,6 +34,7 @@ Deactivating a component consists of the
 
 The following example shows a basic component, which uses the @Start, @Stop, annotation:
 
+    :::java
     /**
      * A Component Using lifecyce callbacks
      */
@@ -79,14 +74,13 @@ To do so, your @Init method is allowed t
 
 For instance, if you define a Dependency like this:
 
-
+    :::java
     @ServiceDependency(name="foo")
     FooService fooService;
 
 Then you can return this map from your @Init method:
 
-
-
+    :::java
     @Init
     Map init() {
         return new HashMap() {{
@@ -101,7 +95,7 @@ So, after the init method returns, the m
 
 This is an example of a component X whose dependency "foo" filter is  configured from ConfigAdmin. First, we defined a ConfigurationDependency  in order to get injected with our configuration. Next, we define a  dependency on the *FooService*, but this time, we declare the annotation  like this: *@ServiceDependency(*{*}{*}name="foo"*{*}*)*. As explained  above, The  ConfigurationDependency will be injected *before* the @Init method, and  the named dependency ("foo") will be calculated *after* the @Init method  returns. So, from our Init method, we just return a map which contains  the filter and required flag for the "foo" dependency, and we actually  use the configuration which has already been injected:
 
-
+    :::java
     /**
      * A component whose FooService dependency filter is configured from ConfigAdmin
      */
@@ -144,12 +138,6 @@ This is an example of a component X whos
         }
     }
 
-
-
-
-## 
-
-
 ## Controlling the Lifecycle
 
 As explained in the *Component Activation* section, a  component which provides a service is automatically registered into the  OSGi registry, after the @Start method returns. But it is sometimes  required to control when the service is really started/published or  unpublished/stopped.
@@ -160,7 +148,7 @@ For instance, imagine that your componen
 
 Let's illustrate this use case with a concrete example: First here is the DHT asynchronous API:
 
-
+    :::java
     /**
      * This is an element which can be inserted into the distributed hash table.
      */
@@ -177,8 +165,7 @@ Let's illustrate this use case with a co
 
 Next, here is our service, which uses the @LifecycleController in  order to take control of when the service is published into the OSGi  registry:
 
-
-
+    :::java
     @Component(provides={MyService.class})
     public class MyServiceImpl implements MyService, DHTElement {
         @ServiceDependency
@@ -207,19 +194,17 @@ Next, here is our service, which uses th
     }
 
 
-## 
-
-
 ## Dynamic Service Properties
 
 When a component provides an OSGi Service, the service properties are calculated as the following:
+
 * Any properties specified in the @Component annotation are used to provide the OSGi Service
 * Any properties provided by a FactorySet are also inserted in the published service
 * Any Dependency whose *propagate* attribute is set to true will also insert its properties to the published service
 
 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:
 
-
+    :::java
     @Component(properties={@Property(name="foo", value="bar")})
     public class MyServiceImpl implements MyService {
         @ConfigurationDependency(pid="MyPid", propagate=true)
@@ -238,8 +223,9 @@ But when the component needs to specify 
     }
 
 Here, the service MyService will be published into the OSGi registry along with the following service properties:
-* foo=bar (specified in our @Component annotation)
-* foo2=bar2 (propagated by our ConfigurationDependency dependency)
-* foo3=bar3 (specified dynamically in the map returned from our start method)
+
+- foo=bar (specified in our @Component annotation)
+- foo2=bar2 (propagated by our ConfigurationDependency dependency)
+- foo3=bar3 (specified dynamically in the map returned from our start method)
 
 Notice that properties returned by the Map take precedence over other properties, and may override some of them.

Modified: felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-quickstart.mdtext
URL: http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-quickstart.mdtext?rev=1525171&r1=1525170&r2=1525171&view=diff
==============================================================================
--- felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-quickstart.mdtext (original)
+++ felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-quickstart.mdtext Fri Sep 20 23:10:33 2013
@@ -1,6 +1,6 @@
 translation_pending: true
 Title: Dependency Manager Annotations Quick Start
-Excerpt: Provides an "Hello World" example, and shows how to compile it.
+Excerpt: Dependency Manager annotations quick start
 
 This section presents a simple "Hello World" component defined using annotations, and also explains how to build the bundle using either Bnd, Ant, or Maven.
 

Modified: felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-spellchecker.mdtext
URL: http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-spellchecker.mdtext?rev=1525171&r1=1525170&r2=1525171&view=diff
==============================================================================
--- felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-spellchecker.mdtext (original)
+++ felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/apache-felix-dependency-manager-using-annotations/dependencymanager-annotations-spellchecker.mdtext Fri Sep 20 23:10:33 2013
@@ -1,6 +1,6 @@
 translation_pending: true
 Title: Dependency Manager SpellChecker Sample
-Excerpt: Helps you with the basic concepts using a full SpellChecker sample code.
+Excerpt: Basic concepts using a full SpellChecker sample code.
 
 This section presents a quick overview of the capabilities and usage of the 
 DependencyManager java 5 annotations. In particular, we will recap the DependencyManager