title: How to declare a requirement on the SCR extender capability?
body: <p>The OSGi Enterprise Release 5 Specification introduces the <code>osgi.extender</code> namespace. This namespace makes it possible for bundles that assume extenders such as Blueprint or Declarative Services are installed in the framework to model this dependency using the <code>Require-Capability</code> header.</p>
  
  <p>Chapter 135.2 <em>osgi.extender Namespace</em> tells us that the value of the capability for each specific extender should be specified in the corresponding specification. An example is given for Blueprint:</p>
  
  <pre><code>Provide-Capability: osgi.extender;
    osgi.extender="osgi.blueprint";
    uses:="org.osgi.service.blueprint.container,org.osgi.service.blueprint.reflect"
    version:Version="1.0"
  </code></pre>
  
  <p>However, chapter 112 <em>Declarative Services Specification</em> does not specify the capability that an SCR implementation provides.</p>
  
  <p>Peter Kriens gives an example in a <a href="http://blog.osgi.org/2012/03/requirements-and-capabilities.html" rel="noreferrer">blog post on Requirements and Capabilities</a> that suggests the capability for SCR is <code>osgi.component</code>. I assume that eventually this value will be properly defined in the specs. But until then I cannot use it.</p>
  
  <p>Since the <code>Require-Capability</code> and <code>Provide-Capability</code> headers were introduced in OSGi Core Release 4.3 the mechanism is already available in framework implementations. So, I want my bundles to express a requirement on SCR so that an SCR implementation can be resolved from an OBR repository.</p>
  
  <p>I can imagine one solution where I create an empty bundle that on one hand provides a custom capability and on the other hand require an implementation bundle. For example:</p>
  
  <pre><code>Provide-Capability: com.example.extender; extender=scr
  Require-Bundle: org.apache.felix.scr; bundle-version=1.6.0
  </code></pre>
  
  <p>Any bundles that include declarative services can then express a requirement to this capability. For example:</p>
  
  <pre><code>Require-Capability: com.example.extender; filter:="(extender=scr)"
  </code></pre>
  
  <p>Is this a good way of making sure SCR is resolved when I deploy bundles that contain declarative services? Is there any other way?</p>
  
  <p>A good solution to this problem would be a solution that can also be applied to other legacy bundles that don't provide capabilities.</p>