Author: buildbot
Date: Thu Mar 12 22:30:51 2015
New Revision: 943591
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/reference/components.html
Propchange: websites/staging/felix/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Mar 12 22:30:51 2015
@@ -1 +1 @@
-1666313
+1666326
Modified:
websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/components.html
==============================================================================
---
websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/components.html
(original)
+++
websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/components.html
Thu Mar 12 22:30:51 2015
@@ -116,7 +116,34 @@ been invoked in the <em>start</em> callb
then tracked.</li>
</ul>
<h2 id="what-happens-during-component-instantiation">What happens during
component instantiation ?</h2>
-<p>TBD (in progress).</p>
+<ol>
+<li>The service is instantiated.</li>
+<li>The following special objects are injected through reflection on class
fields, if
+they exist (but you can deactivate this behavior from the API):</li>
+<li>BundleContext</li>
+<li>ServiceRegistration</li>
+<li>DependencyManager</li>
+<li>Component</li>
+<li><em>autoconfig</em> dependencies are injected through reflection on class
fields, if they exist. If an <em>autoconfig</em>
+optional dependency is unavailable, a NullObject is then injected.</li>
+<li>Required dependency callbacks defined from the Activator are called.</li>
+<li>The component <em>init</em> method is called, and from that method you can
then dynamically add
+more dependencies by using the Component parameter passed to the init method,
or using
+a class field of <em>Component</em> type (which in this case has been injected
during step 2).</li>
+<li>When all required dependencies (including dependencies dynamically added
from the <em>init</em>
+method) are available, they are injected (using callbacks, or autoconfig).</li>
+<li>The component <em>start</em> callback is invoked.</li>
+<li>Optional dependencies (with callbacks) are then tracked.</li>
+<li>The component service(s) is then registered in the OSGi service
registry</li>
+</ol>
+<p>When using Annotations, there are some specific behaviors:</p>
+<ul>
+<li>The <em>@init</em> method may return a Map that contains filters in order
to
+dynamically configure dependencies annotated with a <em>name</em> attribute,
and the dependencies will
+then be injected after the <em>@init</em> method (exactly if you would have
added the dependencies from the init method using the API).</li>
+<li>The <em>@start</em> method may return a Map in order to dynamically add
more service properties (if the component provides some services).</li>
+<li>The component can be dynamically stopped or restarted using a special
<em>@LifecycleController</em> annotation.</li>
+</ul>
<h2 id="interfaces-and-properties">Interfaces and properties</h2>
<p>Components in the context of the dependency manager can be published as
OSGi services under one or more interface names, plus optionally a set of
properties. This is no different than a normal OSGi service. It's important to
mention that you don't have to register a service. If you don't, you basically
created a component that can do work and have dependencies and a managed life
cycle.</p>
<h2 id="composition">Composition</h2>
@@ -124,7 +151,7 @@ then tracked.</li>
<h2 id="factories">Factories</h2>
<p>Out of the box, there already is support for lazy instantiation, meaning
that the dependency manager can create component instances for you when their
required dependencies are resolved. However, sometimes creating a single
instance using a default constructor is not enough. In those cases, you can
tell the dependency manager to delegate the creation process to a factory.</p>
<div class="timestamp" style="margin-top: 30px; font-size: 80%;
text-align: right;">
- Rev. 1666313 by pderop on Thu, 12 Mar 2015 21:37:32 +0000
+ Rev. 1666326 by pderop on Thu, 12 Mar 2015 22:30:38 +0000
</div>
<div class="trademarkFooter">
Apache Felix, Felix, Apache, the Apache feather logo, and the Apache
Felix project