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 2015/03/10 22:03:26 UTC

svn commit: r943247 [2/6] - in /websites/staging/felix/trunk/content: ./ documentation/ documentation/subprojects/ documentation/subprojects/apache-felix-dependency-manager-4/ documentation/subprojects/apache-felix-dependency-manager/ documentation/sub...

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/design-patterns.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/design-patterns.html (added)
+++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/design-patterns.html Tue Mar 10 21:03:25 2015
@@ -0,0 +1,198 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+  <head>
+    <title>Apache Felix - Apache Felix Dependency Manager - Design Patterns</title>
+    <link rel="icon" href="/res/favicon.ico">
+    <link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/res/codehilite.css" type="text/css" media="all">
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </head>
+  <body>
+    <div class="title">
+      <div class="logo">
+        <a href="http://felix.apache.org/">
+          <img border="0" alt="Apache Felix" src="/res/logo.png">
+        </a>
+      </div>
+      <div class="header">
+        <a href="http://www.apache.org/">
+          <img border="0" alt="Apache" src="/res/apache.png">
+        </a>
+      </div>
+    </div>
+    
+    <div class="menu"> 
+      <p><a href="/news.html">news</a>  <br />
+<a href="/license.html">license</a>  <br />
+<a href="/downloads.cgi">downloads</a>  <br />
+<a href="/documentation.html">documentation</a>  <br />
+<a href="/mailinglists.html">mailing lists</a>  <br />
+<a href="/documentation/community/contributing.html">contributing</a>  <br />
+<a href="/sitemap.html">site map</a>  <br />
+<a href="http://www.apache.org/">asf</a>  <br />
+<a href="http://www.apache.org/security/">security</a>  <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">sponsorship</a>  <br />
+<a href="http://www.apache.org/foundation/thanks.html">sponsors</a>    </p>
+<iframe
+    src="http://www.apache.org/ads/button.html"
+    style="border-width:0; float: left"
+    frameborder="0"
+    scrolling="no"
+    width="135"
+    height="135">
+</iframe>
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects.html">Apache Felix Subproject Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-dependency-manager.html">Apache Felix Dependency Manager 4</a>
+      </div>
+
+      
+      
+      <h1>Apache Felix Dependency Manager - Design Patterns</h1>
+      <h2 id="osgi-design-patterns">OSGi Design Patterns</h2>
+<p>This section lists a couple of design patterns as they can be applied in an OSGi context.</p>
+<h3 id="singleton-service">Singleton Service</h3>
+<p>Provides a service as long as its dependencies are resolved.</p>
+<h4 id="motivation">Motivation</h4>
+<p>In a dynamic framework, services can come and go. Components that publish a service are often themselves dependent on other services to perform their task. In such cases, they have a dependency on those services and it makes sense to only publish their own services when these dependencies are available. Being able to declare such dependencies in code ensures consistent life cycle behavior.</p>
+<h4 id="structure">Structure</h4>
+<p><img src="./diagrams/singleton.png" alt="Singleton" style="width: 190px"/></p>
+<h4 id="code-example">Code Example</h4>
+<div class="codehilite"><pre><span class="n">public</span> <span class="n">class</span> <span class="n">Activator</span> <span class="n">extends</span> <span class="n">DependencyActivatorBase</span> <span class="p">{</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">init</span><span class="p">(</span><span class="n">BundleContext</span> <span class="n">context</span><span class="p">,</span> <span class="n">DependencyManager</span> <span class="n">manager</span><span class="p">)</span> <span class="n">throws</span> <span class="n">Exception</span> <span class="p">{</span>
+        <span class="n">manager</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createComponent</span><span class="p">()</span>
+            <span class="p">.</span><span class="n">setInterface</span><span class="p">(</span><span class="n">UserStore</span><span class="p">.</span><span class="n">class</span><span class="p">,</span> <span class="n">new</span> <span class="n">Properties</span><span class="p">()</span> <span class="p">)</span>
+            <span class="p">.</span><span class="n">setImplementation</span><span class="p">(</span><span class="n">UserStoreImpl</span><span class="p">.</span><span class="n">class</span><span class="p">)</span>
+            <span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createServiceDependency</span><span class="p">()</span>
+                <span class="p">.</span><span class="n">setService</span><span class="p">(</span><span class="n">Store</span><span class="p">.</span><span class="n">class</span><span class="p">)</span>
+                <span class="p">.</span><span class="n">setRequired</span><span class="p">(</span><span class="n">true</span><span class="p">)</span>
+            <span class="p">)</span>
+            <span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createServiceDependency</span><span class="p">()</span>
+                <span class="p">.</span><span class="n">setService</span><span class="p">(</span><span class="n">LogService</span><span class="p">.</span><span class="n">class</span><span class="p">)</span>
+                <span class="p">.</span><span class="n">setRequired</span><span class="p">(</span><span class="n">false</span><span class="p">)</span>
+            <span class="p">)</span>
+        <span class="p">);</span>
+    <span class="p">}</span>
+
+    <span class="n">public</span> <span class="n">void</span> <span class="n">destroy</span><span class="p">(</span><span class="n">BundleContext</span> <span class="n">context</span><span class="p">,</span> <span class="n">DependencyManager</span> <span class="n">manager</span><span class="p">)</span> <span class="n">throws</span> <span class="n">Exception</span> <span class="p">{}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<h3 id="aspect-service">Aspect Service</h3>
+<p>Provides an aspect on top of a specific type of service.</p>
+<h4 id="motivation_1">Motivation</h4>
+<p>In aspect oriented programming, supporting functions are isolated from the main application's business logic. This increases modularity at the source level by allowing the separation of cross-cutting concerns. In OSGi we want to extend this modularity to the runtime, therefore we implement aspects to work on certain services, where the aspect itself publishes that same service but (usually) with a higher priority. This allows you to dynamically add and remove aspects.</p>
+<h4 id="structure_1">Structure</h4>
+<p><img src="./diagrams/aspect.png" alt="Aspect" style="width: 190px"/></p>
+<h4 id="code-example_1">Code Example</h4>
+<div class="codehilite"><pre><span class="n">public</span> <span class="n">class</span> <span class="n">Activator</span> <span class="n">extends</span> <span class="n">DependencyActivatorBase</span> <span class="p">{</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">init</span><span class="p">(</span><span class="n">BundleContext</span> <span class="n">context</span><span class="p">,</span> <span class="n">DependencyManager</span> <span class="n">manager</span><span class="p">)</span> <span class="n">throws</span> <span class="n">Exception</span> <span class="p">{</span>
+        <span class="n">manager</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createAspectService</span><span class="p">(</span><span class="n">Manageable</span><span class="p">.</span><span class="n">class</span><span class="p">,</span> &quot;<span class="p">(</span><span class="n">monitor</span><span class="p">=</span><span class="n">true</span><span class="p">)</span>&quot;<span class="p">,</span> 50<span class="p">)</span>
+            <span class="p">.</span><span class="n">setImplementation</span><span class="p">(</span><span class="n">ManageableMonitor</span><span class="p">.</span><span class="n">class</span><span class="p">)</span>
+        <span class="p">);</span>
+    <span class="p">}</span>
+
+    <span class="n">public</span> <span class="n">void</span> <span class="n">destroy</span><span class="p">(</span><span class="n">BundleContext</span> <span class="n">context</span><span class="p">,</span> <span class="n">DependencyManager</span> <span class="n">manager</span><span class="p">)</span> <span class="n">throws</span> <span class="n">Exception</span> <span class="p">{}</span>
+<span class="p">}</span>
+
+<span class="n">public</span> <span class="n">interface</span> <span class="n">Manageable</span> <span class="p">{</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">setProperty</span><span class="p">(</span><span class="n">String</span> <span class="n">key</span><span class="p">,</span> <span class="n">String</span> <span class="n">value</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="n">public</span> <span class="n">class</span> <span class="n">ManageableMonitor</span> <span class="n">implements</span> <span class="n">Manageable</span> <span class="p">{</span>
+    <span class="n">private</span> <span class="n">volatile</span> <span class="n">Manageable</span> <span class="n">m_manageable</span><span class="p">;</span>
+
+    <span class="n">public</span> <span class="n">void</span> <span class="n">setProperty</span><span class="p">(</span><span class="n">String</span> <span class="n">key</span><span class="p">,</span> <span class="n">String</span> <span class="n">value</span><span class="p">)</span> <span class="p">{</span>
+        <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span>&quot;<span class="n">Someone</span> <span class="n">set</span> &quot; <span class="o">+</span> <span class="n">key</span> <span class="o">+</span> &quot; <span class="n">to</span> &quot; <span class="o">+</span> <span class="n">value</span><span class="p">);</span>
+        <span class="n">m_manageable</span><span class="p">.</span><span class="n">setProperty</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">);</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<h3 id="adapter-service">Adapter Service</h3>
+<p>Provides an adapter for a specific type of service.</p>
+<h4 id="motivation_2">Motivation</h4>
+<p>Like with aspects, sometimes you want to create adapters for certain services, which add certain behavior that results in the publication of (in this case) a different service. Adapters can dynamically be added and removed and allow you to keep your basic services implementations clean and simple, adding extra features on top of them in a modular way. </p>
+<h4 id="structure_2">Structure</h4>
+<p><img src="./diagrams/adapter.png" alt="Adapter" style="width: 190px"/></p>
+<h4 id="code-example_2">Code Example</h4>
+<div class="codehilite"><pre><span class="n">public</span> <span class="n">class</span> <span class="n">Activator</span> <span class="n">extends</span> <span class="n">DependencyActivatorBase</span> <span class="p">{</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">init</span><span class="p">(</span><span class="n">BundleContext</span> <span class="n">context</span><span class="p">,</span> <span class="n">DependencyManager</span> <span class="n">manager</span><span class="p">)</span> <span class="n">throws</span> <span class="n">Exception</span> <span class="p">{</span>
+        <span class="n">manager</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createAdapterService</span><span class="p">(</span><span class="n">Manageable</span><span class="p">.</span><span class="n">class</span><span class="p">,</span> &quot;<span class="p">(</span><span class="n">publish</span><span class="p">=</span><span class="n">servlet</span><span class="p">)</span>&quot;<span class="p">)</span>
+            <span class="p">.</span><span class="n">setInterface</span><span class="p">(</span><span class="n">HttpServlet</span><span class="p">.</span><span class="n">class</span><span class="p">.</span><span class="n">getName</span><span class="p">(),</span> <span class="n">null</span><span class="p">)</span>
+            <span class="p">.</span><span class="n">setImplementation</span><span class="p">(</span><span class="n">ManageableServlet</span><span class="p">.</span><span class="n">class</span><span class="p">)</span>
+        <span class="p">);</span>
+    <span class="p">}</span>
+
+    <span class="n">public</span> <span class="n">void</span> <span class="n">destroy</span><span class="p">(</span><span class="n">BundleContext</span> <span class="n">context</span><span class="p">,</span> <span class="n">DependencyManager</span> <span class="n">manager</span><span class="p">)</span> <span class="n">throws</span> <span class="n">Exception</span> <span class="p">{}</span>
+<span class="p">}</span>
+
+<span class="n">public</span> <span class="n">interface</span> <span class="n">Manageable</span> <span class="p">{</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">setProperty</span><span class="p">(</span><span class="n">String</span> <span class="n">key</span><span class="p">,</span> <span class="n">String</span> <span class="n">value</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="n">public</span> <span class="n">class</span> <span class="n">ManageableServlet</span> <span class="n">implements</span> <span class="n">HttpServlet</span> <span class="p">{</span>
+    <span class="n">private</span> <span class="n">volatile</span> <span class="n">Manageable</span> <span class="n">m_manageable</span><span class="p">;</span>
+
+    <span class="n">public</span> <span class="n">void</span> <span class="n">doPost</span><span class="p">(</span><span class="n">HttpRequest</span> <span class="n">req</span><span class="p">,</span> <span class="n">HttpResponse</span> <span class="n">response</span><span class="p">)</span> <span class="p">{</span>
+        <span class="n">String</span> <span class="n">key</span> <span class="p">=</span> <span class="n">req</span><span class="p">.</span><span class="n">getProperty</span><span class="p">(</span>&quot;<span class="n">key</span>&quot;<span class="p">);</span>
+        <span class="n">String</span> <span class="n">value</span> <span class="p">=</span> <span class="n">req</span><span class="p">.</span><span class="n">getProperty</span><span class="p">(</span>&quot;<span class="n">value</span>&quot;<span class="p">);</span>
+        <span class="n">m_manageable</span><span class="p">.</span><span class="n">setProperty</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">);</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<h3 id="resource-adapter-service">Resource Adapter Service</h3>
+<p>Provides an adapter for a specific type of resource.</p>
+<h4 id="motivation_3">Motivation</h4>
+<p>Resource adapters are similar to normal adapters, but instead of requiring a service, they require a resource and provide a service on top of it. Resources are an abstraction that is introduced by the dependency manager, represented as a URL. They can be implemented to serve resources embedded in bundles, somewhere on a file system or in a content repository or database.</p>
+<h4 id="structure_3">Structure</h4>
+<p><img src="./diagrams/resourceadapter.png" alt="Singleton" style="width: 180px"/></p>
+<h3 id="temporal-dependency">Temporal Dependency</h3>
+<p>Provides a proxy that hides the service dynamics of a dependency, even if it disappears for a short time.</p>
+<h4 id="motivation_4">Motivation</h4>
+<p>As a service consumer, you sometimes do not want to deal with the dynamics of services and the fact that they tend to go away for short periods of time whilst their hosting bundle gets updated. A temporal dependency provides you with a proxy that hides these dynamics and blocks your calls if you try to invoke a method on a service that is currently "updating". The maximum time to wait is configurable and you will get an exception if no new service becomes available before that time.</p>
+<h4 id="structure_4">Structure</h4>
+<h3 id="null-object">Null Object</h3>
+<p>Provides an implementation of an object that does nothing and can be used in the absence of the real object.</p>
+<h4 id="motivation_5">Motivation</h4>
+<p>When a component depends on a service, but the dependency is optional, it means that it will use this service when available, but it can still operate if it's not. Constantly checking in your code if a service is actually available tends to lead to code with a lot of "<code>if (service != null) service.invoke();</code>" constructions which do not help with code readability. Instead, the dependency manager offers you a mechanism where it will inject null objects for services that are currently not available so you can simply invoke methods on them that "do nothing".</p>
+<h4 id="structure_5">Structure</h4>
+<h3 id="whiteboard">Whiteboard</h3>
+<p>Handles listeners by leveraging the OSGi service registry to publish and look them up.</p>
+<h4 id="motivation_6">Motivation</h4>
+<p>The traditional model for dealing with listeners in Java needlessly complicates things in an OSGi context. Instead of having listeners registering themselves with the component that will invoke them on any change, a listener simply registers itself in the service registry and the component will do a lookup of all relevant services. This is explained in more detail on the OSGi.org wiki in the <a href="http://www.osgi.org/wiki/uploads/Links/whiteboard.pdf">"Listeners considered harmful: the 'whiteboard' pattern"</a> article.</p>
+<h4 id="structure_6">Structure</h4>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1665356 by uiterlix on Mon, 9 Mar 2015 20:52:57 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project
+        logo are trademarks of The Apache Software Foundation. All other marks mentioned
+        may be trademarks or registered trademarks of their respective owners.
+      </div>
+    </div>
+  </body>
+</html>

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/development.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/development.html (added)
+++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/development.html Tue Mar 10 21:03:25 2015
@@ -0,0 +1,125 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+  <head>
+    <title>Apache Felix - Apache Felix Dependency Manager - Development</title>
+    <link rel="icon" href="/res/favicon.ico">
+    <link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/res/codehilite.css" type="text/css" media="all">
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </head>
+  <body>
+    <div class="title">
+      <div class="logo">
+        <a href="http://felix.apache.org/">
+          <img border="0" alt="Apache Felix" src="/res/logo.png">
+        </a>
+      </div>
+      <div class="header">
+        <a href="http://www.apache.org/">
+          <img border="0" alt="Apache" src="/res/apache.png">
+        </a>
+      </div>
+    </div>
+    
+    <div class="menu"> 
+      <p><a href="/news.html">news</a>  <br />
+<a href="/license.html">license</a>  <br />
+<a href="/downloads.cgi">downloads</a>  <br />
+<a href="/documentation.html">documentation</a>  <br />
+<a href="/mailinglists.html">mailing lists</a>  <br />
+<a href="/documentation/community/contributing.html">contributing</a>  <br />
+<a href="/sitemap.html">site map</a>  <br />
+<a href="http://www.apache.org/">asf</a>  <br />
+<a href="http://www.apache.org/security/">security</a>  <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">sponsorship</a>  <br />
+<a href="http://www.apache.org/foundation/thanks.html">sponsors</a>    </p>
+<iframe
+    src="http://www.apache.org/ads/button.html"
+    style="border-width:0; float: left"
+    frameborder="0"
+    scrolling="no"
+    width="135"
+    height="135">
+</iframe>
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects.html">Apache Felix Subproject Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-dependency-manager.html">Apache Felix Dependency Manager 4</a>
+      </div>
+
+      
+      
+      <h1>Apache Felix Dependency Manager - Development</h1>
+      <p>When downloading or checking out the source code, please also consult release/resources/src/README.src for up to date instructions on how to build that particular version.</p>
+<h2 id="prerequisites">Prerequisites</h2>
+<p>If you are building a released <code>org.apache.felix.dependencymanager-r&lt;n&gt;-src.zip</code> artifact, then you also have to extract the <code>org.apache.felix.dependencymanager-r&lt;n&gt;-deps.zip</code> in the same directory where you have extracted the source archive. There is no need to do this if you have checked out from the Felix trunk in Subversion.</p>
+<h2 id="compilation-using-gradle">Compilation Using gradle:</h2>
+<ul>
+<li>
+<p>Install Java 7.</p>
+</li>
+<li>
+<p>Compile Dependendency Manager annotations bndtools plugin:</p>
+<p>$ ./gradlew org.apache.felix.dependencymanager.annotation:jar</p>
+</li>
+<li>
+<p>Compile all other bundles:</p>
+<p>$ ./gradlew jar</p>
+</li>
+<li>
+<p>Run junit tests:</p>
+<p>$ ./gradlew test</p>
+</li>
+<li>
+<p>Run integration tests:</p>
+<p>$ ./gradlew check</p>
+</li>
+</ul>
+<h2 id="compilation-using-eclipse">Compilation Using Eclipse:</h2>
+<ul>
+<li>Install either Eclipse Kepler SR2 or Eclipse Luna.</li>
+<li>Use the dependency manager folder as the root of your workspace.</li>
+<li>Configure two JREs for both Java 7 and Java 8:<ul>
+<li>Go to Windows -&gt; Preferences -&gt; Java -&gt; Installed JREs</li>
+<li>Add two JREs: one for Java 7, and the other for Java 8.</li>
+<li>Declare the Java 7 JRE as the default one. Java 8 is only used to build and run the <code>org.apache.felix.dependencymanager.benchmark</code> module, which is used to perform DM performance tests within Eclipse Bndtools.</li>
+</ul>
+</li>
+<li>Install BndTools 2.4.1, and (optionally) a subversion plugin for Eclipse.</li>
+<li>Open BndTools perspective</li>
+<li>Import Dependency Manager into Eclipse, and compile everything</li>
+<li>if it's the first time you import the project into eclipse, it may happen that some modules that requires the Dependency Manager Annotations bnd plugin don't compile: It's a know issue. To work around, restart eclipse and rebuild every modules. </li>
+<li>Click on org.apache.felix.dependencymanager project and run it as "JUnit test".</li>
+<li>Click on org.apache.felix.dependencymanager.shell and run it as "JUnit test"</li>
+<li>Click on org.apache.felix.dependencymanager.itest and run it as "Bnd OSGi Test Launcher (Junit)".</li>
+<li>Click on org.apache.felix.dependencymanager.runtime.itest and run it as ""Bnd OSGi Test Launcer (Junit)".</li>
+</ul>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1664040 by marrs on Wed, 4 Mar 2015 15:21:58 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project
+        logo are trademarks of The Apache Software Foundation. All other marks mentioned
+        may be trademarks or registered trademarks of their respective owners.
+      </div>
+    </div>
+  </body>
+</html>

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/adapter.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/adapter.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/adapter.uxf
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/adapter.uxf
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/aspect.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/aspect.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/aspect.uxf
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/aspect.uxf
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/resourceadapter.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/resourceadapter.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/resourceadapter.uxf
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/resourceadapter.uxf
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/resources.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/resources.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/resources.uxf
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/resources.uxf
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/singleton.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/singleton.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/singleton.uxf
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/diagrams/singleton.uxf
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/history.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/history.html (added)
+++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/history.html Tue Mar 10 21:03:25 2015
@@ -0,0 +1,87 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+  <head>
+    <title>Apache Felix - Apache Felix Dependency Manager - History</title>
+    <link rel="icon" href="/res/favicon.ico">
+    <link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/res/codehilite.css" type="text/css" media="all">
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </head>
+  <body>
+    <div class="title">
+      <div class="logo">
+        <a href="http://felix.apache.org/">
+          <img border="0" alt="Apache Felix" src="/res/logo.png">
+        </a>
+      </div>
+      <div class="header">
+        <a href="http://www.apache.org/">
+          <img border="0" alt="Apache" src="/res/apache.png">
+        </a>
+      </div>
+    </div>
+    
+    <div class="menu"> 
+      <p><a href="/news.html">news</a>  <br />
+<a href="/license.html">license</a>  <br />
+<a href="/downloads.cgi">downloads</a>  <br />
+<a href="/documentation.html">documentation</a>  <br />
+<a href="/mailinglists.html">mailing lists</a>  <br />
+<a href="/documentation/community/contributing.html">contributing</a>  <br />
+<a href="/sitemap.html">site map</a>  <br />
+<a href="http://www.apache.org/">asf</a>  <br />
+<a href="http://www.apache.org/security/">security</a>  <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">sponsorship</a>  <br />
+<a href="http://www.apache.org/foundation/thanks.html">sponsors</a>    </p>
+<iframe
+    src="http://www.apache.org/ads/button.html"
+    style="border-width:0; float: left"
+    frameborder="0"
+    scrolling="no"
+    width="135"
+    height="135">
+</iframe>
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects.html">Apache Felix Subproject Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-dependency-manager.html">Apache Felix Dependency Manager 4</a>
+      </div>
+
+      
+      
+      <h1>Apache Felix Dependency Manager - History</h1>
+      <h2 id="the-early-years">The early years</h2>
+<p>The first version of the Dependency Manager was created when Marcel started working on his first commercial OSGi project back in 2002. At that time, the OSGi specification was still at R2, and the only solution for managing dependencies was "service binder" which did not support the dynamics we needed at that time. Therefore, dependency manager was created, based on a fluent, declarative Java API.</p>
+<p>In 2005, after writing a white paper, dependency manager was presented at the OSGi DevCon in Paris. At that time, the project had been open sourced, but not yet at Apache. When the Oscar project finally decided to move to the incubator, where it became Felix, Dependency Manager was one of the subprojects that joined.</p>
+<h2 id="life-at-apache">Life at Apache</h2>
+<p>The move to Apache definitely gave the project a lot more visibility and, besides a larger user base, also attracted a few very talented developers. Xander did a lot of work in getting some of the higher level design patterns implemented, and Pierre added support for annotations and ensured that the code ran well on really big, multi-core systems.</p>
+<p>In 2014, after many discussions about new features and improvements we would like to add, we started experimenting with a completely new codebase, redesigning some aspects from the ground up based on all the knowledge and experience that we had gained over the years. About a year later, that lead to the release of Dependency Manager 4.</p>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1663924 by marrs on Wed, 4 Mar 2015 10:39:19 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project
+        logo are trademarks of The Apache Software Foundation. All other marks mentioned
+        may be trademarks or registered trademarks of their respective owners.
+      </div>
+    </div>
+  </body>
+</html>

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/javadocs.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/javadocs.html (added)
+++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/javadocs.html Tue Mar 10 21:03:25 2015
@@ -0,0 +1,82 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+  <head>
+    <title>Apache Felix - Apache Felix Dependency Manager - Javadocs</title>
+    <link rel="icon" href="/res/favicon.ico">
+    <link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/res/codehilite.css" type="text/css" media="all">
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </head>
+  <body>
+    <div class="title">
+      <div class="logo">
+        <a href="http://felix.apache.org/">
+          <img border="0" alt="Apache Felix" src="/res/logo.png">
+        </a>
+      </div>
+      <div class="header">
+        <a href="http://www.apache.org/">
+          <img border="0" alt="Apache" src="/res/apache.png">
+        </a>
+      </div>
+    </div>
+    
+    <div class="menu"> 
+      <p><a href="/news.html">news</a>  <br />
+<a href="/license.html">license</a>  <br />
+<a href="/downloads.cgi">downloads</a>  <br />
+<a href="/documentation.html">documentation</a>  <br />
+<a href="/mailinglists.html">mailing lists</a>  <br />
+<a href="/documentation/community/contributing.html">contributing</a>  <br />
+<a href="/sitemap.html">site map</a>  <br />
+<a href="http://www.apache.org/">asf</a>  <br />
+<a href="http://www.apache.org/security/">security</a>  <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">sponsorship</a>  <br />
+<a href="http://www.apache.org/foundation/thanks.html">sponsors</a>    </p>
+<iframe
+    src="http://www.apache.org/ads/button.html"
+    style="border-width:0; float: left"
+    frameborder="0"
+    scrolling="no"
+    width="135"
+    height="135">
+</iframe>
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects.html">Apache Felix Subproject Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-dependency-manager.html">Apache Felix Dependency Manager 4</a>
+      </div>
+
+      
+      
+      <h1>Apache Felix Dependency Manager - Javadocs</h1>
+      <p>The various Dependency Manager javadocs for the API, the Annotations, and the Runtime can be found from the <a href="http://felix.apache.org/apidocs/">main felix apidocs homepage</a>.</p>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1664757 by pderop on Fri, 6 Mar 2015 23:01:58 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project
+        logo are trademarks of The Apache Software Foundation. All other marks mentioned
+        may be trademarks or registered trademarks of their respective owners.
+      </div>
+    </div>
+  </body>
+</html>

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/migrating-from-earlier-versions.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/migrating-from-earlier-versions.html (added)
+++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/migrating-from-earlier-versions.html Tue Mar 10 21:03:25 2015
@@ -0,0 +1,147 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+  <head>
+    <title>Apache Felix - Apache Felix Dependency Manager - Migrating from earlier versions</title>
+    <link rel="icon" href="/res/favicon.ico">
+    <link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/res/codehilite.css" type="text/css" media="all">
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </head>
+  <body>
+    <div class="title">
+      <div class="logo">
+        <a href="http://felix.apache.org/">
+          <img border="0" alt="Apache Felix" src="/res/logo.png">
+        </a>
+      </div>
+      <div class="header">
+        <a href="http://www.apache.org/">
+          <img border="0" alt="Apache" src="/res/apache.png">
+        </a>
+      </div>
+    </div>
+    
+    <div class="menu"> 
+      <p><a href="/news.html">news</a>  <br />
+<a href="/license.html">license</a>  <br />
+<a href="/downloads.cgi">downloads</a>  <br />
+<a href="/documentation.html">documentation</a>  <br />
+<a href="/mailinglists.html">mailing lists</a>  <br />
+<a href="/documentation/community/contributing.html">contributing</a>  <br />
+<a href="/sitemap.html">site map</a>  <br />
+<a href="http://www.apache.org/">asf</a>  <br />
+<a href="http://www.apache.org/security/">security</a>  <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">sponsorship</a>  <br />
+<a href="http://www.apache.org/foundation/thanks.html">sponsors</a>    </p>
+<iframe
+    src="http://www.apache.org/ads/button.html"
+    style="border-width:0; float: left"
+    frameborder="0"
+    scrolling="no"
+    width="135"
+    height="135">
+</iframe>
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects.html">Apache Felix Subproject Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-dependency-manager.html">Apache Felix Dependency Manager 4</a>
+      </div>
+
+      
+      
+      <h1>Apache Felix Dependency Manager - Migrating from earlier versions</h1>
+      <h1 id="migrating-from-version-3">Migrating from version 3</h1>
+<p>DependencyManager 4.0 has some API changes that need to be taken into account when migrating from DependencyManager 3. </p>
+<ul>
+<li>A dependency can no longer be shared accross components. </li>
+<li>You no longer have to call setInstanceBound() when adding a dependency from within the init() method of a component. Therefore the setInstanceBound() method has been removed from all Dependency interfaces.</li>
+<li>in the Dependency interface, the following method have been removed: isInstanceBound, invokeAdded, invokeRemoved, createCopy.</li>
+<li>In the Component interface, the "Object Component.getService()" method has been replaced by the "<T> T getInstance()" method.</li>
+<li>In the Component interface, the "void addStateListener(ComponentStateListener listener) method" has been replaced by the "add(ComponentStateListener listener)" method.</li>
+<li>In the Component interface, the "start", "stop", "getDependencies" methods have been removed.</li>
+<li>In the Component interface and in the DependencyManager class, the createTemporalServiceDependency() method is now taking a timeout parameter: createTemporalServiceDependency(long timeout).</li>
+<li>The ComponentStateListener interface has changed: it is now providing a single "changed(Component c, ComponentState state)" method.</li>
+<li>The DependencyManager 4 Shell commands are no longer available for framework specific shell implementations, and support the gogo shell only.</li>
+<li>The TemporalServiceDependency interface has been removed.</li>
+<li>The Annotations processor is not generating anymore the Import-Service/Export Service by default (no need to specify the "build-import-export-service=false" option in the
+annotations plugin if you don't need to generate automatically the deprecated headers).</li>
+<li>The Dependency Manager metatype annotations are now deprecated and it is encouraged to use standard bnd metatypes annotation instead.
+See org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/dictionary/annot/DictionaryConfiguration.java for an example.
+You can also check http://www.aqute.biz/Bnd/MetaType for more information about the bnd metatypes annotations.</li>
+<li>Dependency Manager is now fully built using bndtools, and there is no Maven annotation plugin anymore. However, the workaround is simply the 
+use a "_plugin" option in the pom, and to declare a dependency inside the "plugin" configuration.
+Notice that in the R1 version, we are not pushing DM distribution to maven, so you have to do manually push the DM artifacts in your own nexus server. 
+We'll try to release DM artifacts to maven central in the next release (R2).</li>
+</ul>
+<p>For example:</p>
+<div class="codehilite"><pre><span class="nt">&lt;project</span> <span class="err">...</span><span class="nt">&gt;</span>
+  <span class="nt">&lt;dependencies&gt;</span>
+    ...
+    <span class="nt">&lt;dependency&gt;</span>
+      <span class="nt">&lt;groupId&gt;</span>org.apache.felix<span class="nt">&lt;/groupId&gt;</span>
+      <span class="nt">&lt;artifactId&gt;</span>org.apache.felix.dependencymanager.annotation<span class="nt">&lt;/artifactId&gt;</span>
+      <span class="nt">&lt;version&gt;</span>4.0.0<span class="nt">&lt;/version&gt;</span>
+    <span class="nt">&lt;/dependency&gt;</span>
+  <span class="nt">&lt;/dependencies&gt;</span>
+  <span class="nt">&lt;build&gt;</span>
+    <span class="nt">&lt;plugins&gt;</span>
+      ...    
+      <span class="nt">&lt;plugin&gt;</span>
+        <span class="nt">&lt;groupId&gt;</span>org.apache.felix<span class="nt">&lt;/groupId&gt;</span>
+        <span class="nt">&lt;artifactId&gt;</span>maven-bundle-plugin<span class="nt">&lt;/artifactId&gt;</span>
+        <span class="nt">&lt;version&gt;</span>2.5.0<span class="nt">&lt;/version&gt;</span>
+        <span class="nt">&lt;extensions&gt;</span>true<span class="nt">&lt;/extensions&gt;</span>
+        <span class="nt">&lt;configuration&gt;</span>
+           <span class="nt">&lt;instructions&gt;</span>
+           <span class="nt">&lt;Bundle-Name&gt;</span>Test<span class="nt">&lt;/Bundle-Name&gt;</span>
+           <span class="nt">&lt;Bundle-SymbolicName&gt;</span>test<span class="nt">&lt;/Bundle-SymbolicName&gt;</span>
+           <span class="nt">&lt;Import-Package&gt;</span>*<span class="nt">&lt;/Import-Package&gt;</span>
+           <span class="nt">&lt;Private-Package&gt;</span>test.dmannotations.withbndplugininvokedfrompom<span class="nt">&lt;/Private-Package&gt;</span>
+           <span class="nt">&lt;_plugin&gt;</span>org.apache.felix.dm.annotation.plugin.bnd.AnnotationPlugin;log=debug<span class="nt">&lt;/_plugin&gt;</span>
+           <span class="nt">&lt;/instructions&gt;</span>
+        <span class="nt">&lt;/configuration&gt;</span>
+        <span class="nt">&lt;dependencies&gt;</span>
+          <span class="nt">&lt;dependency&gt;</span>
+            <span class="nt">&lt;groupId&gt;</span>org.apache.felix<span class="nt">&lt;/groupId&gt;</span>
+            <span class="nt">&lt;artifactId&gt;</span>org.apache.felix.dependencymanager.annotation<span class="nt">&lt;/artifactId&gt;</span>
+            <span class="nt">&lt;version&gt;</span>4.0.0<span class="nt">&lt;/version&gt;</span>
+          <span class="nt">&lt;/dependency&gt;</span>
+        <span class="nt">&lt;/dependencies&gt;</span>
+      <span class="nt">&lt;/plugin&gt;</span>
+    <span class="nt">&lt;/plugins&gt;</span>
+  <span class="nt">&lt;/build&gt;</span>
+<span class="nt">&lt;/project&gt;</span>
+</pre></div>
+
+
+<h1 id="migrating-from-version-2">Migrating from version 2</h1>
+<p>...</p>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1664717 by pderop on Fri, 6 Mar 2015 20:53:54 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project
+        logo are trademarks of The Apache Software Foundation. All other marks mentioned
+        may be trademarks or registered trademarks of their respective owners.
+      </div>
+    </div>
+  </body>
+</html>

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/migrating-from-other-solutions.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/migrating-from-other-solutions.html (added)
+++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/migrating-from-other-solutions.html Tue Mar 10 21:03:25 2015
@@ -0,0 +1,86 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+  <head>
+    <title>Apache Felix - Apache Felix Dependency Manager - Migrating from other solutions</title>
+    <link rel="icon" href="/res/favicon.ico">
+    <link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/res/codehilite.css" type="text/css" media="all">
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </head>
+  <body>
+    <div class="title">
+      <div class="logo">
+        <a href="http://felix.apache.org/">
+          <img border="0" alt="Apache Felix" src="/res/logo.png">
+        </a>
+      </div>
+      <div class="header">
+        <a href="http://www.apache.org/">
+          <img border="0" alt="Apache" src="/res/apache.png">
+        </a>
+      </div>
+    </div>
+    
+    <div class="menu"> 
+      <p><a href="/news.html">news</a>  <br />
+<a href="/license.html">license</a>  <br />
+<a href="/downloads.cgi">downloads</a>  <br />
+<a href="/documentation.html">documentation</a>  <br />
+<a href="/mailinglists.html">mailing lists</a>  <br />
+<a href="/documentation/community/contributing.html">contributing</a>  <br />
+<a href="/sitemap.html">site map</a>  <br />
+<a href="http://www.apache.org/">asf</a>  <br />
+<a href="http://www.apache.org/security/">security</a>  <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">sponsorship</a>  <br />
+<a href="http://www.apache.org/foundation/thanks.html">sponsors</a>    </p>
+<iframe
+    src="http://www.apache.org/ads/button.html"
+    style="border-width:0; float: left"
+    frameborder="0"
+    scrolling="no"
+    width="135"
+    height="135">
+</iframe>
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects.html">Apache Felix Subproject Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-dependency-manager.html">Apache Felix Dependency Manager 4</a>
+      </div>
+
+      
+      
+      <h1>Apache Felix Dependency Manager - Migrating from other solutions</h1>
+      <p>TODO</p>
+<h1 id="declarative-services">Declarative Services</h1>
+<h1 id="blueprint">Blueprint</h1>
+<h1 id="ipojo">iPOJO</h1>
+<h1 id="service-binder">Service Binder</h1>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1664040 by marrs on Wed, 4 Mar 2015 15:21:58 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project
+        logo are trademarks of The Apache Software Foundation. All other marks mentioned
+        may be trademarks or registered trademarks of their respective owners.
+      </div>
+    </div>
+  </body>
+</html>

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/performance-tuning.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/performance-tuning.html (added)
+++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/performance-tuning.html Tue Mar 10 21:03:25 2015
@@ -0,0 +1,119 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+  <head>
+    <title>Apache Felix - Apache Felix Dependency Manager - Performance Tuning</title>
+    <link rel="icon" href="/res/favicon.ico">
+    <link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/res/codehilite.css" type="text/css" media="all">
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </head>
+  <body>
+    <div class="title">
+      <div class="logo">
+        <a href="http://felix.apache.org/">
+          <img border="0" alt="Apache Felix" src="/res/logo.png">
+        </a>
+      </div>
+      <div class="header">
+        <a href="http://www.apache.org/">
+          <img border="0" alt="Apache" src="/res/apache.png">
+        </a>
+      </div>
+    </div>
+    
+    <div class="menu"> 
+      <p><a href="/news.html">news</a>  <br />
+<a href="/license.html">license</a>  <br />
+<a href="/downloads.cgi">downloads</a>  <br />
+<a href="/documentation.html">documentation</a>  <br />
+<a href="/mailinglists.html">mailing lists</a>  <br />
+<a href="/documentation/community/contributing.html">contributing</a>  <br />
+<a href="/sitemap.html">site map</a>  <br />
+<a href="http://www.apache.org/">asf</a>  <br />
+<a href="http://www.apache.org/security/">security</a>  <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">sponsorship</a>  <br />
+<a href="http://www.apache.org/foundation/thanks.html">sponsors</a>    </p>
+<iframe
+    src="http://www.apache.org/ads/button.html"
+    style="border-width:0; float: left"
+    frameborder="0"
+    scrolling="no"
+    width="135"
+    height="135">
+</iframe>
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects.html">Apache Felix Subproject Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-dependency-manager.html">Apache Felix Dependency Manager 4</a>
+      </div>
+
+      
+      
+      <h1>Apache Felix Dependency Manager - Performance Tuning</h1>
+      <h3 id="filter-indices">Filter Indices</h3>
+<p>Filter indices allow you to speed up the service resolution process by skipping the services registry, in favor of a fast index on given service properties.</p>
+<p>The Dependency Manager will look for a set of filter indices in the <code>org.apache.felix.dependencymanager.filterindex</code> system property. This system property uses the following syntax,</p>
+<div class="codehilite"><pre><span class="n">property</span><span class="o">-</span><span class="n">index</span> <span class="p">::=</span> <span class="n">service</span><span class="o">-</span><span class="n">property</span> <span class="o">|</span> <span class="n">service</span><span class="o">-</span><span class="n">property</span> <span class="s">&#39;,&#39;</span> <span class="n">property</span><span class="o">-</span><span class="n">index</span>
+<span class="n">index</span> <span class="p">::=</span> <span class="s">&#39;*aspect*&#39;</span> <span class="o">|</span> <span class="s">&#39;*adapter*&#39;</span> <span class="o">|</span> <span class="n">property</span><span class="o">-</span><span class="n">index</span>
+<span class="n">indices</span> <span class="p">::=</span> <span class="n">index</span> <span class="o">|</span> <span class="n">indices</span> <span class="s">&#39;;&#39;</span> <span class="n">index</span>
+</pre></div>
+
+
+<p>The implementation ships with three kinds of index implementations.</p>
+<ul>
+<li><em>Service property indices</em> are based on a set of service properties, like a multi-column index in a database. </li>
+<li><em>Aspect indices</em> work with Dependency Manager Aspect services, and will provide indexing for the specific filters that they use.</li>
+<li><em>Adapter indices</em> work like Aspect indices, but for Adapter services.</li>
+</ul>
+<h4 id="performance">Performance</h4>
+<p>The index isn't free, but reduces the linear (and wasteful) filter-based lookup to an indexed log(n) lookup. You can expect noticeable speedup if you have at least several hundred services.</p>
+<h4 id="examples">Examples</h4>
+<div class="codehilite"><pre><span class="o">-</span><span class="n">Dorg</span><span class="p">.</span><span class="n">apache</span><span class="p">.</span><span class="n">felix</span><span class="p">.</span><span class="n">dependencymanager</span><span class="p">.</span><span class="n">filterindex</span><span class="p">=</span><span class="n">objectClass</span>
+</pre></div>
+
+
+<p>Sets an index on <code>objectClass</code>, speeding up lookups for any filter that contains an <code>objectClass</code> in its filter (all regular services do).</p>
+<div class="codehilite"><pre><span class="o">-</span><span class="n">Dorg</span><span class="p">.</span><span class="n">apache</span><span class="p">.</span><span class="n">felix</span><span class="p">.</span><span class="n">dependencymanager</span><span class="p">.</span><span class="n">filterindex</span><span class="p">=</span><span class="n">objectClass</span><span class="p">,</span><span class="n">id</span>
+</pre></div>
+
+
+<p>This filter helps if you have a lot of similar services, identified by some <code>id</code>.</p>
+<div class="codehilite"><pre><span class="o">-</span><span class="n">Dorg</span><span class="p">.</span><span class="n">apache</span><span class="p">.</span><span class="n">felix</span><span class="p">.</span><span class="n">dependencymanager</span><span class="p">.</span><span class="n">filterindex</span><span class="p">=</span><span class="n">objectClass</span><span class="p">,</span><span class="n">id</span><span class="p">;</span><span class="n">objectClass</span><span class="p">,</span><span class="n">ipAddress</span>
+</pre></div>
+
+
+<p>This is a set of two filter indices, helping when you have one set of services that has an <code>id</code>, and another set that uses an <code>ipAddress</code> for identification.</p>
+<div class="codehilite"><pre><span class="o">-</span><span class="n">Dorg</span><span class="p">.</span><span class="n">apache</span><span class="p">.</span><span class="n">felix</span><span class="p">.</span><span class="n">dependencymanager</span><span class="p">.</span><span class="n">filterindex</span><span class="p">=</span><span class="o">*</span><span class="n">aspect</span><span class="o">*</span>
+</pre></div>
+
+
+<p>Provides indexing for all Aspect services.</p>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1664040 by marrs on Wed, 4 Mar 2015 15:21:58 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project
+        logo are trademarks of The Apache Software Foundation. All other marks mentioned
+        may be trademarks or registered trademarks of their respective owners.
+      </div>
+    </div>
+  </body>
+</html>

Added: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/resources.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/resources.html (added)
+++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/resources.html Tue Mar 10 21:03:25 2015
@@ -0,0 +1,165 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+  <head>
+    <title>Apache Felix - Resource adapters</title>
+    <link rel="icon" href="/res/favicon.ico">
+    <link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/res/codehilite.css" type="text/css" media="all">
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </head>
+  <body>
+    <div class="title">
+      <div class="logo">
+        <a href="http://felix.apache.org/">
+          <img border="0" alt="Apache Felix" src="/res/logo.png">
+        </a>
+      </div>
+      <div class="header">
+        <a href="http://www.apache.org/">
+          <img border="0" alt="Apache" src="/res/apache.png">
+        </a>
+      </div>
+    </div>
+    
+    <div class="menu"> 
+      <p><a href="/news.html">news</a>  <br />
+<a href="/license.html">license</a>  <br />
+<a href="/downloads.cgi">downloads</a>  <br />
+<a href="/documentation.html">documentation</a>  <br />
+<a href="/mailinglists.html">mailing lists</a>  <br />
+<a href="/documentation/community/contributing.html">contributing</a>  <br />
+<a href="/sitemap.html">site map</a>  <br />
+<a href="http://www.apache.org/">asf</a>  <br />
+<a href="http://www.apache.org/security/">security</a>  <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">sponsorship</a>  <br />
+<a href="http://www.apache.org/foundation/thanks.html">sponsors</a>    </p>
+<iframe
+    src="http://www.apache.org/ads/button.html"
+    style="border-width:0; float: left"
+    frameborder="0"
+    scrolling="no"
+    width="135"
+    height="135">
+</iframe>
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects.html">Apache Felix Subproject Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-dependency-manager.html">Apache Felix Dependency Manager 4</a>
+      </div>
+
+      
+      
+      <h1>Resource adapters</h1>
+      <p>Resource adapters are a special type of adapters which can adapt a resource into an OSGi service. These resources can be all kinds of resources, e.g. bundle resources, files, database records, anything as long as it can be resolved though a URL.</p>
+<p>The diagram below illustrates the classes involved in the resource adapter pattern:</p>
+<p><img src="./diagrams/resources.png" alt="Resource adapters" style="width: 780px"/></p>
+<p>The yellow elements have to be implemented in order to use the pattern.</p>
+<p>A resource adapter is configured as follows:</p>
+<div class="codehilite"><pre><span class="n">manager</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createResourceAdapter</span><span class="p">(</span>&quot;<span class="o">*</span><span class="p">.</span><span class="n">MF</span>&quot;<span class="p">,</span> <span class="n">true</span><span class="p">,</span> <span class="n">null</span><span class="p">,</span> &quot;<span class="n">changed</span>&quot;<span class="p">)</span>
+            <span class="p">.</span><span class="n">setImplementation</span><span class="p">(</span><span class="n">ManifestAdapter</span><span class="p">.</span><span class="n">class</span><span class="p">));</span>
+</pre></div>
+
+
+<p>The filter semantics depend on the resource repository. In this example the resource repository will be serving bundle resources, so we're using a standard file wildcard filter. As the filter specifies in this case the resource of interest is the bundle manifest. For each MANIFEST.MF found a new instance of ManifestAdapter will be created and registered. Each instance gets access to the resource by injecting the URL of the resource into the implementation object.</p>
+<div class="codehilite"><pre><span class="n">public</span> <span class="n">class</span> <span class="n">ManifestAdapter</span> <span class="p">{</span>
+
+    <span class="n">private</span> <span class="n">volatile</span> <span class="n">URL</span> <span class="n">url</span><span class="p">;</span>
+
+    <span class="n">void</span> <span class="n">start</span><span class="p">()</span> <span class="p">{</span>
+        <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span>&quot;<span class="n">started</span><span class="p">:</span> &quot; <span class="o">+</span> <span class="n">url</span><span class="p">);</span>
+    <span class="p">}</span>
+
+<span class="p">}</span>
+</pre></div>
+
+
+<p>But how does DM know where to go looking for manifest files? We'll it does not automatically. It requires you to implement a resource repository component. For each resource adapter service DM launches a ResourceHandler service tracking the resources the resource adapter is interested in. A resource repository is responsible for tracking resources and notifying adding / changing and removal of the resources from the repository. Notifying these resource 'events' is done by invoking the corresponding method on the ResourceHandler service.</p>
+<p>We'll explain how to implement a resource repository by an example. The example resource repository is a bundle resource repository which as it's name says, is capable of serving bundle resources.</p>
+<p>A simplified bundle resource repository looks as follows:</p>
+<div class="codehilite"><pre><span class="n">public</span> <span class="n">class</span> <span class="n">BundleResourceRepositoryImpl</span> <span class="p">{</span>
+
+    <span class="n">private</span> <span class="n">Map</span><span class="o">&lt;</span><span class="n">ServiceReference</span><span class="p">,</span> <span class="n">ResourceHandler</span><span class="o">&gt;</span> <span class="n">handlers</span> <span class="p">=</span> <span class="n">new</span> <span class="n">ConcurrentHashMap</span><span class="o">&lt;&gt;</span><span class="p">();</span>
+    <span class="n">private</span> <span class="n">volatile</span> <span class="n">BundleContext</span> <span class="n">context</span><span class="p">;</span>
+
+    <span class="o">//</span> <span class="n">added</span> <span class="n">callback</span>
+    <span class="n">void</span> <span class="n">addHandler</span><span class="p">(</span><span class="n">ServiceReference</span> <span class="n">ref</span><span class="p">,</span> <span class="n">ResourceHandler</span> <span class="n">handler</span><span class="p">)</span> <span class="p">{</span>
+        <span class="n">handlers</span><span class="p">.</span><span class="n">put</span><span class="p">(</span><span class="n">ref</span><span class="p">,</span> <span class="n">handler</span><span class="p">);</span>
+        <span class="k">if</span> <span class="p">(</span><span class="n">ref</span><span class="p">.</span><span class="n">getProperty</span><span class="p">(</span><span class="n">ResourceHandler</span><span class="p">.</span><span class="n">URL</span><span class="p">)</span> !<span class="p">=</span> <span class="n">null</span><span class="p">)</span> <span class="p">{</span>
+            <span class="n">URL</span> <span class="n">url</span> <span class="p">=</span> <span class="p">(</span><span class="n">URL</span><span class="p">)</span> <span class="n">ref</span><span class="p">.</span><span class="n">getProperty</span><span class="p">(</span><span class="n">ResourceHandler</span><span class="p">.</span><span class="n">URL</span><span class="p">);</span>
+            <span class="n">notifyMatchingInitialResource</span><span class="p">(</span><span class="n">url</span><span class="p">,</span> <span class="n">handler</span><span class="p">);</span>
+        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+            <span class="n">String</span> <span class="n">filter</span> <span class="p">=</span> <span class="p">(</span><span class="n">String</span><span class="p">)</span> <span class="n">ref</span><span class="p">.</span><span class="n">getProperty</span><span class="p">(</span><span class="n">ResourceHandler</span><span class="p">.</span><span class="n">FILTER</span><span class="p">);</span>
+            <span class="n">notifyMatchingInitialResources</span><span class="p">(</span><span class="n">filter</span><span class="p">,</span> <span class="n">handler</span><span class="p">);</span>
+        <span class="p">}</span>
+    <span class="p">}</span>
+
+    <span class="o">//</span> <span class="n">removed</span> <span class="n">callback</span>
+    <span class="n">void</span> <span class="n">removeHandler</span><span class="p">(</span><span class="n">ServiceReference</span> <span class="n">ref</span><span class="p">,</span> <span class="n">ResourceHandler</span> <span class="n">handler</span><span class="p">)</span> <span class="p">{</span>
+        <span class="n">handlers</span><span class="p">.</span><span class="n">remove</span><span class="p">(</span><span class="n">ref</span><span class="p">);</span>
+    <span class="p">}</span>
+
+    <span class="n">private</span> <span class="n">void</span> <span class="n">notifyMatchingInitialResource</span><span class="p">(</span><span class="n">URL</span> <span class="n">url</span><span class="p">,</span> <span class="n">ResourceHandler</span> <span class="n">handler</span><span class="p">)</span> <span class="p">{</span>
+        <span class="k">if</span> <span class="p">(</span><span class="n">bundleContainsResource</span><span class="p">(</span><span class="n">url</span><span class="p">))</span> <span class="p">{</span>
+            <span class="n">handler</span><span class="p">.</span><span class="n">added</span><span class="p">(</span><span class="n">url</span><span class="p">,</span> <span class="n">new</span> <span class="n">Hashtable</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span> <span class="n">String</span><span class="o">&gt;</span><span class="p">());</span>
+        <span class="p">}</span>
+    <span class="p">}</span>
+
+    <span class="p">@</span><span class="n">SuppressWarnings</span><span class="p">(</span>&quot;<span class="n">unchecked</span>&quot;<span class="p">)</span>
+    <span class="n">private</span> <span class="n">void</span> <span class="n">notifyMatchingInitialResources</span><span class="p">(</span><span class="n">String</span> <span class="n">filter</span><span class="p">,</span> <span class="n">ResourceHandler</span> <span class="n">handler</span><span class="p">)</span> <span class="p">{</span>
+        <span class="n">Enumeration</span><span class="o">&lt;</span><span class="n">URL</span><span class="o">&gt;</span> <span class="n">entries</span> <span class="p">=</span> <span class="n">context</span><span class="p">.</span><span class="n">getBundle</span><span class="p">().</span><span class="n">findEntries</span><span class="p">(</span>&quot;<span class="o">/</span>&quot;<span class="p">,</span> <span class="n">filter</span><span class="p">,</span> <span class="n">true</span><span class="p">);</span>
+        <span class="k">while</span> <span class="p">(</span><span class="n">entries</span><span class="p">.</span><span class="n">hasMoreElements</span><span class="p">())</span> <span class="p">{</span>
+            <span class="n">URL</span> <span class="n">entry</span> <span class="p">=</span> <span class="n">entries</span><span class="p">.</span><span class="n">nextElement</span><span class="p">();</span>
+            <span class="n">handler</span><span class="p">.</span><span class="n">added</span><span class="p">(</span><span class="n">entry</span><span class="p">,</span> <span class="n">new</span> <span class="n">Hashtable</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span> <span class="n">String</span><span class="o">&gt;</span><span class="p">());</span>
+        <span class="p">}</span>
+    <span class="p">}</span>
+
+    <span class="n">private</span> <span class="n">boolean</span> <span class="n">bundleContainsResource</span><span class="p">(</span><span class="n">URL</span> <span class="n">url</span><span class="p">)</span> <span class="p">{</span>
+        <span class="k">return</span> <span class="n">true</span><span class="p">;</span> <span class="o">//</span> <span class="n">more</span> <span class="n">specific</span> <span class="n">checks</span> <span class="n">required</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>The resource repository is registered in the bundle activator as follows:</p>
+<div class="codehilite"><pre>    <span class="n">manager</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createComponent</span><span class="p">().</span><span class="n">setImplementation</span><span class="p">(</span><span class="n">BundleResourceRepositoryImpl</span><span class="p">.</span><span class="n">class</span><span class="p">)</span>
+            <span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="n">createServiceDependency</span><span class="p">().</span><span class="n">setService</span><span class="p">(</span><span class="n">ResourceHandler</span><span class="p">.</span><span class="n">class</span><span class="p">).</span><span class="n">setCallbacks</span><span class="p">(</span>&quot;<span class="n">addHandler</span>&quot;<span class="p">,</span> &quot;<span class="n">removeHandler</span>&quot;<span class="p">)));</span>
+</pre></div>
+
+
+<p>A resource repository implementation must have a dependency on resource handlers. The ResourceHandler service has two important service properties:</p>
+<ul>
+<li>"filter" (<code>ResourceHandler.FILTER</code>)</li>
+<li>"url" (<code>ResourceHandler.URL</code>)</li>
+</ul>
+<p>A resource handler service has either one of these properties, not both! A resource handler with a filter can match multiple resources whereas a resource handler with a url only matches a single resource. It's important the resource repository handles both situations.</p>
+<p>When a new handler is being added, the resource repository should inform the resource handler on the resources it has that match the handler's filter or url. This is done by invoking the <code>added(url, properties)</code> method on the ResourceHandler. This callback results in the ResourceAdapter's ResourceDependency being satisfied, the url being injected into the resource adapter implementation object and the resource adapter implementation component being started.</p>
+<p>Besides the added() callback the resource repository is also responsible for handling the changed() and removed() methods on change or removal of the resource from the resource repository. For a bundle resource repository that's not likely to happen, but for a filesystem resource repository this can very well be the case.</p>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1665660 by uiterlix on Tue, 10 Mar 2015 19:34:29 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project
+        logo are trademarks of The Apache Software Foundation. All other marks mentioned
+        may be trademarks or registered trademarks of their respective owners.
+      </div>
+    </div>
+  </body>
+</html>