Fix issue Felix-716
Provides XML-Schemas for core features (core handler, component, handler, instance), compositions, external handlers.
Modifies the manipulator in order to check schema when specified in the XML descriptor.
Tests suites now use schemas.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@693468 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/tests/composite/composite-runtime/src/main/resources/metadata.xml b/ipojo/tests/composite/composite-runtime/src/main/resources/metadata.xml
index eecf974..5f65200 100644
--- a/ipojo/tests/composite/composite-runtime/src/main/resources/metadata.xml
+++ b/ipojo/tests/composite/composite-runtime/src/main/resources/metadata.xml
@@ -1,12 +1,18 @@
-<ipojo xmlns:cs="org.apache.felix.ipojo.test.composite.handler.CheckServiceHandler">
+<ipojo
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="org.apache.felix.ipojo http://people.apache.org/~clement/ipojo/schemas/core.xsd
+ org.apache.felix.composite http://people.apache.org/~clement/ipojo/schemas/composite.xsd"
+ xmlns="org.apache.felix.ipojo"
+ xmlns:comp="org.apache.felix.ipojo.composite"
+ xmlns:cs="org.apache.felix.ipojo.test.composite.handler.CheckServiceHandler">
<!-- Used component type -->
<component
- className="org.apache.felix.ipojo.test.composite.component.FooProviderType1"
+ classname="org.apache.felix.ipojo.test.composite.component.FooProviderType1"
name="COMPO-FooProviderType-1" architecture="true">
<provides />
</component>
<component
- className="org.apache.felix.ipojo.test.composite.component.FooProviderType1"
+ classname="org.apache.felix.ipojo.test.composite.component.FooProviderType1"
name="COMPO-FooProviderType-2" architecture="true">
<provides>
<property name="int" type="int" value="2" />
@@ -18,7 +24,7 @@
</provides>
</component>
<component
- className="org.apache.felix.ipojo.test.composite.component.FooProviderTypeDyn"
+ classname="org.apache.felix.ipojo.test.composite.component.FooProviderTypeDyn"
name="COMPO-FooProviderType-Dyn" architecture="true">
<provides>
<property name="int" field="intProp" value="2" />
@@ -30,7 +36,7 @@
</provides>
</component>
<component
- className="org.apache.felix.ipojo.test.composite.component.FooProviderTypeDyn2"
+ classname="org.apache.felix.ipojo.test.composite.component.FooProviderTypeDyn2"
name="COMPO-FooProviderType-Dyn2" architecture="true">
<provides>
<property name="int" field="intProp" value="4" />
@@ -42,24 +48,24 @@
</provides>
</component>
<component
- className="org.apache.felix.ipojo.test.composite.component.CheckServiceProvider"
+ classname="org.apache.felix.ipojo.test.composite.component.CheckServiceProvider"
name="COMPO-SimpleCheckServiceProvider" architecture="true">
<requires field="fs" />
<provides />
</component>
<component
- className="org.apache.felix.ipojo.test.composite.component.FooBarProviderType1"
+ classname="org.apache.felix.ipojo.test.composite.component.FooBarProviderType1"
name="COMPO-FooBarProviderType-1" architecture="true">
<provides />
</component>
<component
- className="org.apache.felix.ipojo.test.composite.component.FooBarProviderType1"
+ classname="org.apache.felix.ipojo.test.composite.component.FooBarProviderType1"
name="COMPO-FooBarProviderType-2" architecture="true">
<provides
interface="{org.apache.felix.ipojo.test.composite.service.FooService, org.apache.felix.ipojo.test.composite.service.BarService }" />
</component>
<component
- className="org.apache.felix.ipojo.test.composite.component.FooBarProviderType1"
+ classname="org.apache.felix.ipojo.test.composite.component.FooBarProviderType1"
name="COMPO-FooBarProviderType-3" architecture="true">
<provides
interface="{org.apache.felix.ipojo.test.composite.service.FooService}">
@@ -72,8 +78,8 @@
</component>
<component
- className="org.apache.felix.ipojo.test.composite.component.BazProviderType1"
- name="BazProviderType" scope="composite">
+ classname="org.apache.felix.ipojo.test.composite.component.BazProviderType1"
+ name="BazProviderType">
<provides />
</component>
@@ -96,10 +102,10 @@
</component>
<!-- Composite -->
- <composite name="composite.empty" architecture="true">
- </composite>
+ <comp:composite name="composite.empty" architecture="true">
+ </comp:composite>
- <component className="org.apache.felix.ipojo.test.composite.component.Baz2CheckProvider" name="Baz2CheckProvider" architecture="true">
+ <component classname="org.apache.felix.ipojo.test.composite.component.Baz2CheckProvider" name="Baz2CheckProvider" architecture="true">
<requires field="fs" scope="composite"/>
<provides/>
</component>
diff --git a/ipojo/tests/composite/import-export/src/main/resources/metadata.xml b/ipojo/tests/composite/import-export/src/main/resources/metadata.xml
index cb1e07f..2cce16c 100644
--- a/ipojo/tests/composite/import-export/src/main/resources/metadata.xml
+++ b/ipojo/tests/composite/import-export/src/main/resources/metadata.xml
@@ -1,82 +1,87 @@
<ipojo
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="org.apache.felix.ipojo http://people.apache.org/~clement/ipojo/schemas/core.xsd
+ org.apache.felix.composite http://people.apache.org/~clement/ipojo/schemas/composite.xsd"
+ xmlns="org.apache.felix.ipojo"
+ xmlns:comp="org.apache.felix.ipojo.composite"
xmlns:cs="org.apache.felix.ipojo.test.composite.handler.CheckServiceHandler">
- <composite name="composite.requires.1" architecture="true">
+ <comp:composite name="composite.requires.1" architecture="true">
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.FooService"
- scope="composite" />
- </composite>
+ scope="comp:composite" />
+ </comp:composite>
- <composite name="composite.requires.2" architecture="true">
+ <comp:composite name="composite.requires.2" architecture="true">
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.FooService"
- aggregate="true" scope="composite" />
- </composite>
+ aggregate="true" scope="comp:composite" />
+ </comp:composite>
- <composite name="composite.requires.3" architecture="true">
+ <comp:composite name="composite.requires.3" architecture="true">
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.FooService"
- optional="true" scope="composite" />
- </composite>
+ optional="true" scope="comp:composite" />
+ </comp:composite>
- <composite name="composite.requires.4" architecture="true">
+ <comp:composite name="composite.requires.4" architecture="true">
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.FooService"
- optional="true" aggregate="true" scope="composite" />
- </composite>
+ optional="true" aggregate="true" scope="comp:composite" />
+ </comp:composite>
- <composite name="composite.requires.5" architecture="true">
+ <comp:composite name="composite.requires.5" architecture="true">
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.FooService"
- filter="(&(int=2)(long=40))" scope="composite" />
- </composite>
+ filter="(&(int=2)(long=40))" scope="comp:composite" />
+ </comp:composite>
- <composite name="composite.export.1" architecture="true">
+ <comp:composite name="composite.export.1" architecture="true">
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.BazService"
aggregate="true" optional="true" filter="(!(instance.name=export))"
- scope="composite" />
- <provides action="export"
+ scope="comp:composite" />
+ <comp:provides action="export"
specification="org.apache.felix.ipojo.test.composite.service.BazService" />
- </composite>
+ </comp:composite>
- <composite name="composite.export.2" architecture="true">
+ <comp:composite name="composite.export.2" architecture="true">
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.BazService"
- scope="composite" aggregate="true" optional="true"
+ scope="comp:composite" aggregate="true" optional="true"
filter="(!(instance.name=export))" />
- <provides action="export"
+ <comp:provides action="export"
specification="org.apache.felix.ipojo.test.composite.service.BazService"
optional="true" />
- </composite>
+ </comp:composite>
- <composite name="composite.export.3" architecture="true">
+ <comp:composite name="composite.export.3" architecture="true">
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.BazService"
- scope="composite" aggregate="true" optional="true"
+ scope="comp:composite" aggregate="true" optional="true"
filter="(!(instance.name=export))" />
- <provides action="export"
+ <comp:provides action="export"
specification="org.apache.felix.ipojo.test.composite.service.BazService"
aggregate="true" />
- </composite>
+ </comp:composite>
- <composite name="composite.export.4" architecture="true">
+ <comp:composite name="composite.export.4" architecture="true">
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.BazService"
aggregate="true" optional="true" filter="(!(instance.name=export))"
scope="composite" />
- <provides action="export"
+ <comp:provides action="export"
specification="org.apache.felix.ipojo.test.composite.service.BazService"
aggregate="true" optional="true" />
- </composite>
+ </comp:composite>
- <composite name="composite.export.5" architecture="true">
+ <comp:composite name="composite.export.5" architecture="true">
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.BazService"
aggregate="true" optional="true" filter="(!(instance.name=export))"
scope="composite" />
- <provides action="export"
+ <comp:provides action="export"
specification="org.apache.felix.ipojo.test.composite.service.BazService"
filter="(instance.name=foo1)" />
- </composite>
+ </comp:composite>
</ipojo>
diff --git a/ipojo/tests/composite/service-instance/src/main/resources/metadata.xml b/ipojo/tests/composite/service-instance/src/main/resources/metadata.xml
index 4e383dc..ff00ef1 100644
--- a/ipojo/tests/composite/service-instance/src/main/resources/metadata.xml
+++ b/ipojo/tests/composite/service-instance/src/main/resources/metadata.xml
@@ -1,30 +1,36 @@
-<ipojo xmlns:cs="org.apache.felix.ipojo.test.composite.handler.CheckServiceHandler">
- <composite name="composite.bar.1" architecture="true">
+<ipojo
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="org.apache.felix.ipojo http://people.apache.org/~clement/ipojo/schemas/core.xsd
+ org.apache.felix.composite http://people.apache.org/~clement/ipojo/schemas/composite.xsd"
+ xmlns="org.apache.felix.ipojo"
+ xmlns:comp="org.apache.felix.ipojo.composite"
+ xmlns:cs="org.apache.felix.ipojo.test.composite.handler.CheckServiceHandler">
+ <comp:composite name="composite.bar.1" architecture="true">
<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService"/>
- </composite>
+ </comp:composite>
- <composite name="composite.bar.2" architecture="true">
+ <comp:composite name="composite.bar.2" architecture="true">
<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService" aggregate="true"/>
- </composite>
+ </comp:composite>
- <composite name="composite.bar.3" architecture="true">
+ <comp:composite name="composite.bar.3" architecture="true">
<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService" optional="true"/>
- </composite>
+ </comp:composite>
- <composite name="composite.bar.4" architecture="true">
+ <comp:composite name="composite.bar.4" architecture="true">
<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.FooService" aggregate="true" optional="true"/>
- </composite>
+ </comp:composite>
- <composite name="composite.bar.5-accept" architecture="true">
+ <comp:composite name="composite.bar.5-accept" architecture="true">
<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.FooService">
<property name="boolean" value="true"/>
<property name="string" value="foo"/>
<property name="strAprop" value="{foo, bar, baz}"/>
<property name="int" value="5"/>
</subservice>
- </composite>
+ </comp:composite>
- <composite name="composite.bar.5-refuse1" architecture="true">
+ <comp:composite name="composite.bar.5-refuse1" architecture="true">
<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService">
<property name="foo" value="bar"/>
<property name="boolean" value="true"/>
@@ -32,23 +38,23 @@
<property name="strAprop" value="{foo, bar, baz}"/>
<property name="int" value="5"/>
</subservice>
- </composite>
+ </comp:composite>
- <composite name="composite.bar.5-refuse2" architecture="true">
+ <comp:composite name="composite.bar.5-refuse2" architecture="true">
<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService">
<property name="string" value="foo"/>
<property name="strAprop" value="{foo, bar, baz}"/>
</subservice>
- </composite>
+ </comp:composite>
<!-- Instance of a specified component -->
- <composite name="composite.inst.1" architecture="true">
+ <comp:composite name="composite.inst.1" architecture="true">
<instance component="COMPO-FooProviderType-1" /> <!-- name="FooProv" -->
<instance component="COMPO-FooProviderType-Dyn2">
<property name="boolean" value="true"/>
<property name="string" value="foo"/>
<property name="strAProp" value="{a,b,c}"/>
</instance>
- </composite>
+ </comp:composite>
</ipojo>
diff --git a/ipojo/tests/composite/service-providing/src/main/resources/metadata.xml b/ipojo/tests/composite/service-providing/src/main/resources/metadata.xml
index e544b1c..05d4154 100644
--- a/ipojo/tests/composite/service-providing/src/main/resources/metadata.xml
+++ b/ipojo/tests/composite/service-providing/src/main/resources/metadata.xml
@@ -1,150 +1,155 @@
-<ipojo>
- <composite name="composite.test.3" architecture="true">
+<ipojo
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="org.apache.felix.ipojo http://people.apache.org/~clement/ipojo/schemas/core.xsd
+ org.apache.felix.composite http://people.apache.org/~clement/ipojo/schemas/composite.xsd"
+ xmlns="org.apache.felix.ipojo"
+ xmlns:comp="org.apache.felix.ipojo.composite">
+ <comp:composite name="composite.test.3" architecture="true">
<subservice action="instantiate"
specification="org.apache.felix.ipojo.test.composite.service.BazService"
aggregate="true" filter="(factory.name=BazProviderType)" />
- <provides action="export"
+ <comp:provides action="export"
specification="org.apache.felix.ipojo.test.composite.service.BazService" />
- </composite>
+ </comp:composite>
- <composite name="composite.test.2" architecture="true">
+ <comp:composite name="composite.test.2" architecture="true">
<subservice action="instantiate"
specification="org.apache.felix.ipojo.test.composite.service.CheckService"
filter="(factory.name=Baz2CheckProvider)" />
- <provides action="export"
+ <comp:provides action="export"
specification="org.apache.felix.ipojo.test.composite.service.CheckService" />
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.BazService"
scope="composite" />
- </composite>
+ </comp:composite>
- <composite name="composite.test.1" architecture="true">
+ <comp:composite name="composite.test.1" architecture="true">
<subservice action="instantiate"
specification="org.apache.felix.ipojo.test.composite.service.BazService"
filter="(factory.name=composite.test.3)" />
<subservice action="instantiate"
specification="org.apache.felix.ipojo.test.composite.service.CheckService"
filter="(factory.name=composite.test.2)" />
- <provides action="export"
+ <comp:provides action="export"
specification="org.apache.felix.ipojo.test.composite.service.CheckService" />
- </composite>
+ </comp:composite>
- <composite name="composite.instantiator" architecture="true">
+ <comp:composite name="composite.instantiator" architecture="true">
<subservice action="instantiate"
specification="org.apache.felix.ipojo.test.composite.service.BazService"
filter="(factory.name=composite.test.3)" />
<subservice action="instantiate"
specification="org.apache.felix.ipojo.test.composite.service.FooService" />
- <provides action="export"
+ <comp:provides action="export"
specification="org.apache.felix.ipojo.test.composite.service.BazService" />
- <provides action="export"
+ <comp:provides action="export"
specification="org.apache.felix.ipojo.test.composite.service.FooService" />
- </composite>
+ </comp:composite>
<!-- Test composition provides -->
- <composite name="comp-0" architecture="true">
+ <comp:composite name="comp-0" architecture="true">
<subservice action="instantiate"
specification="org.apache.felix.ipojo.test.composite.service.Tata" />
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.Toto" />
- <provides action="implement"
+ <comp:provides action="implement"
specification="org.apache.felix.ipojo.test.composite.service.Tota" />
- </composite>
+ </comp:composite>
- <composite name="comp-1" architecture="true">
+ <comp:composite name="comp-1" architecture="true">
<subservice action="instantiate"
specification="org.apache.felix.ipojo.test.composite.service.Tata" />
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.Toto" />
- <provides action="implement"
+ <comp:provides action="implement"
specification="org.apache.felix.ipojo.test.composite.service.Tota">
<delegation method="tataInt" policy="One" />
<delegation method="toto1" policy="All" />
- </provides>
- </composite>
+ </comp:provides>
+ </comp:composite>
- <composite name="comp-2" architecture="true">
+ <comp:composite name="comp-2" architecture="true">
<subservice action="instantiate"
specification="org.apache.felix.ipojo.test.composite.service.Tata"
aggregate="true" />
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.Toto"
aggregate="true" />
- <provides action="implement"
+ <comp:provides action="implement"
specification="org.apache.felix.ipojo.test.composite.service.Tota">
<delegation method="tataInt" policy="One" />
<delegation method="toto1" policy="All" />
- </provides>
- </composite>
+ </comp:provides>
+ </comp:composite>
- <composite name="comp-3" architecture="true">
+ <comp:composite name="comp-3" architecture="true">
<subservice action="instantiate"
specification="org.apache.felix.ipojo.test.composite.service.Tata" />
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.Toto"
optional="true" />
- <provides action="implement"
+ <comp:provides action="implement"
specification="org.apache.felix.ipojo.test.composite.service.Tota">
- </provides>
- </composite>
+ </comp:provides>
+ </comp:composite>
- <composite name="comp-4" architecture="true">
+ <comp:composite name="comp-4" architecture="true">
<subservice action="instantiate"
specification="org.apache.felix.ipojo.test.composite.service.Tata" />
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.Toto"
optional="true" />
- <provides action="implement"
+ <comp:provides action="implement"
specification="org.apache.felix.ipojo.test.composite.service.Tota">
<delegation method="tataInt" policy="One" />
<delegation method="toto1" policy="All" />
- </provides>
- </composite>
+ </comp:provides>
+ </comp:composite>
- <composite name="comp-5" architecture="true">
+ <comp:composite name="comp-5" architecture="true">
<subservice action="instantiate"
specification="org.apache.felix.ipojo.test.composite.service.Tata"
aggregate="true" />
- <!-- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto" aggregate ="true" optional="true"/> -->
- <provides action="implement"
+ <!-- <subservice action="import" specification="org.apache.felix.ipojo.test.comp:composite.service.Toto" aggregate ="true" optional="true"/> -->
+ <comp:provides action="implement"
specification="org.apache.felix.ipojo.test.composite.service.Tota">
<delegation method="tataInt" policy="One" />
<delegation method="toto1" policy="All" />
- </provides>
- </composite>
+ </comp:provides>
+ </comp:composite>
- <composite name="comp-6" architecture="true">
+ <comp:composite name="comp-6" architecture="true">
<subservice action="instantiate"
specification="org.apache.felix.ipojo.test.composite.service.Tata"
aggregate="true" />
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.Toto"
aggregate="true" optional="true" />
- <provides action="implement"
+ <comp:provides action="implement"
specification="org.apache.felix.ipojo.test.composite.service.Toto">
<delegation method="toto1" policy="All" />
- </provides>
- <provides action="implement"
+ </comp:provides>
+ <comp:provides action="implement"
specification="org.apache.felix.ipojo.test.composite.service.Tata">
<delegation method="tataInt" policy="One" />
- </provides>
- </composite>
+ </comp:provides>
+ </comp:composite>
- <composite name="comp-7" architecture="true">
+ <comp:composite name="comp-7" architecture="true">
<instance component="tata" />
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.Toto" />
- <provides action="implement"
+ <comp:provides action="implement"
specification="org.apache.felix.ipojo.test.composite.service.Tota" />
- </composite>
+ </comp:composite>
- <composite name="comp-8" architecture="true">
+ <comp:composite name="comp-8" architecture="true">
<instance component="tata" />
<instance component="totoglue" />
<subservice action="import"
specification="org.apache.felix.ipojo.test.composite.service.Toto" />
- <provides action="implement"
+ <comp:provides action="implement"
specification="org.apache.felix.ipojo.test.composite.service.Tota" />
- </composite>
+ </comp:composite>
</ipojo>