felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r879451 - 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 15:57:47 GMT
Author: buildbot
Date: Sun Sep 22 15:57:47 2013
New Revision: 879451

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 15:57:47 2013
@@ -1 +1 @@
-1525379
+1525384

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 15:57:47 2013
@@ -73,21 +73,53 @@
       
       
       <h1>Dependency Manager Component Lifecycle</h1>
-      <p>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 <em>DependencyManager-Component</em>
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 th
 e DM Runtime bundle (org.apache.felix.dm.runtime bundle).</p>
+      <p>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 
+<em>DependencyManager-Component</em> 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. </p>
+<p>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 bundle (org.apache.felix.dm.runtime bundle).</p>
 <h2 id="lifecycle-callbacks">Lifecycle Callbacks</h2>
 <h3 id="component-activation">Component Activation</h3>
-<p>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.
-1. * Inject all required dependencies (on class fields using reflection, or by invoking callback
methods).
-1. * Inject all optional dependencies defined on class fields, <em>possibly with a
NullObject</em> if the dependency is not available.
-1. * Call the component init method (annotated with <em>@Init</em>). In the 
Init method, you are yet allowed to add some additional dependencies  (but using the API).
Alternatively, you can also configure some  dependencies dynamically (explained later, in
<a href="">#Dynamic Dependency Configuration</a>).
-1. Wait for extra dependencies optionally configured from the init() method.
-1. If the component is not using the @<em>LifecycleController</em> annotation
(detailed in the <a href="">#Controlling the Lifecycle</a> section), then:
-1. * Invoke the component start method (annotated with <em>@Start</em>).
-1. * Publish some OSGi services (if the component provides some services).
-1. * Start tracking optional dependencies applied on method callbacks (useful for the whiteboard
pattern). <em>Notice that NullObject pattern is not applied to optional callback dependencies</em>.
In other words, if the dependency is not there, your callback won't be invoked at all. If
you need the NullObject pattern, then apply optional dependencies on class fields, not on
callback methods.
-1. Else do nothing because&nbsp; the component will trigger itself the startup using
the lifecycle controller.</p>
+<p>Activating a component consists of the following steps:</p>
+<ol>
+<li>
+<p>Wait for all required dependencies to be available. When all required dependencies
are available:</p>
+</li>
+<li>
+<p>Instantiate the component.</p>
+</li>
+<li>Inject all required dependencies (on class fields using reflection, or by invoking

+callback methods).</li>
+<li>Inject all optional dependencies defined on class fields, possibly with a <em>NullObject</em>
if the dependency is not available.</li>
+<li>Call the component init method (annotated with <em>@Init</em>). In
the  Init method, you are 
+yet allowed to add some additional dependencies  (but using the API). 
+Alternatively, you can also configure some  dependencies dynamically 
+(explained later, in <a href="#dynamic-dependency-configuration">#Dynamic Dependency
Configuration</a>.</li>
+<li>Wait for extra dependencies optionally configured from the init() method.</li>
+<li>
+<p>If the component is not using the @<em>LifecycleController</em> annotation
(detailed in the 
+<a href="#controlling-the-lifecycle.path">#Controlling the Lifecycle</a> section),
then:</p>
+</li>
+<li>
+<p>Invoke the component start method (annotated with <em>@Start</em>).</p>
+</li>
+<li>Publish some OSGi services (if the component provides some services).</li>
+<li>
+<p>Start tracking optional dependencies applied on method callbacks (useful for the
whiteboard pattern). <em>Notice that NullObject pattern is not applied to optional callback
dependencies</em>. In other words, if the dependency is not there, your callback won't
be invoked at all. If you need the NullObject pattern, then apply optional dependencies on
class fields, not on callback methods.</p>
+</li>
+<li>
+<p>Else do nothing because&nbsp; the component will trigger itself the startup
using the lifecycle controller.</p>
+</li>
+</ol>
 <h3 id="component-deactivation">Component Deactivation</h3>
 <p>Deactivating a component consists of the following steps:
 1. If the bundle is stopped or if some required dependencies are unavailable, or if the component
is deactivated by a factorySet, then:
@@ -121,7 +153,6 @@
 </pre></div>
 
 
-<h3></h3>
 <h3 id="dynamic-dependency-configuration">Dynamic Dependency Configuration</h3>
 <h4 id="rationale">Rationale</h4>
 <p>We have seen that a component may declare some dependencies and is  started when
all required dependencies are available. But there are some  cases when you may need to define
some dependencies filters  dynamically, possibly from data picked up from other  dependencies
(like a configuration dependency for instance).</p>
@@ -271,7 +302,7 @@
 </ul>
 <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. 1525171 by pderop on Fri, 20 Sep 2013 23:10:33 +0000
+        Rev. 1525384 by pderop on Sun, 22 Sep 2013 15:57:38 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project



Mime
View raw message