Pierre De Rop wrote:
oups, I missed that point ! you are right: multi-components can be specified in two ways:

1/

<?xml version="1.0" encoding="UTF-8"?>
<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0";>
   <scr:component enabled="true" name="Component1">
       <scr:implementation class="test.ds.hello.HelloComponent"/>
<scr:reference name="logService" interface="org.osgi.service.log.LogService" ...
   </scr:component>

   <scr:component enabled="true" name="Component2">
       <scr:implementation class="test.ds.hello.HelloComponent"/>
<scr:reference name="logService" interface="org.osgi.service.log.LogService" ...
   </scr:component>
</components>


as well as:


2/

<?xml version='1.0' encoding='utf-8'?>
 <component name="Component1">
   <implementation class="test.ds.hello.HelloComponent"/>
   <reference name="LOG" interface="org.osgi.service.log.LogService" ...
 </component>

 <component name=""Component2">
   <implementation class="test.ds.hello.HelloComponent"/>
   <reference name="LOG" interface="org.osgi.service.log.LogService" ...
 </component>


I did not know the case 1/ and always used the case 2/
No problem :) I'm actually not sure if case 2 is really allowed. Our scr
implementation is able to read this xml, but it's not a valid xml document, so I guess it's safer to use case 1. Please note that actually
the name of the root element can be anything. So even
<foo xmlns:scr=".."/>
   <scr:component...>
</foo>
should work.

Carsten

--
Carsten Ziegeler
[EMAIL PROTECTED]

Reply via email to