blob: 8ada1db6c658f905ef6538d8193629dd8f614d6f [file] [log] [blame]
Richard S. Hall8df9ab12009-07-24 17:06:37 +00001<?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 /*
4 * $Revision: 7533 $
5 *
6 * Copyright (c) OSGi Alliance (2005, 2009). All Rights Reserved.
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20 -->
21<schema xmlns="http://www.w3.org/2001/XMLSchema"
22 xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
23 targetNamespace="http://www.osgi.org/xmlns/scr/v1.1.0"
24 elementFormDefault="unqualified"
25 attributeFormDefault="unqualified"
26 version="1.1.0">
27
28 <annotation>
29 <documentation xml:lang="en">
30 This is the XML Schema for component descriptions used by
31 the Service Component Runtime (SCR). Component description
32 documents may be embedded in other XML documents. SCR will
33 process all XML documents listed in the Service-Component
34 manifest header of a bundle. XML documents containing
35 component descriptions may contain a single, root component
36 element or one or more component elements embedded in a
37 larger document. Use of the namespace for component
38 descriptions is mandatory. The attributes and subelements
39 of a component element are always unqualified.
40 </documentation>
41 </annotation>
42 <element name="component" type="scr:Tcomponent" />
43 <complexType name="Tcomponent">
44 <sequence>
45 <annotation>
46 <documentation xml:lang="en">
47 Implementations of SCR must not require component
48 descriptions to specify the subelements of the component
49 element in the order as required by the schema. SCR
50 implementations must allow other orderings since
51 arbitrary orderings do not affect the meaning of the
52 component description. Only the relative ordering of
53 property and properties element have meaning.
54 </documentation>
55 </annotation>
56 <choice minOccurs="0" maxOccurs="unbounded">
57 <element name="property" type="scr:Tproperty" />
58 <element name="properties" type="scr:Tproperties" />
59 </choice>
60 <element name="service" type="scr:Tservice" minOccurs="0"
61 maxOccurs="1" />
62 <element name="reference" type="scr:Treference"
63 minOccurs="0" maxOccurs="unbounded" />
64 <element name="implementation" type="scr:Timplementation"
65 minOccurs="1" maxOccurs="1" />
66 <any namespace="##any" processContents="lax" minOccurs="0"
67 maxOccurs="unbounded" />
68 </sequence>
69 <attribute name="enabled" type="boolean" default="true"
70 use="optional" />
71 <attribute name="name" type="token" use="optional">
72 <annotation>
73 <documentation xml:lang="en">
74 The default value of this attribute is the value of
75 the class attribute of the nested implementation
76 element. If multiple component elements use the same
77 value for the class attribute of their nested
78 implementation element, then using the default value
79 for this attribute will result in duplicate names.
80 In this case, this attribute must be specified with
81 a unique value.
82 </documentation>
83 </annotation>
84 </attribute>
85 <attribute name="factory" type="string" use="optional" />
86 <attribute name="immediate" type="boolean" use="optional" />
87 <attribute name="configuration-policy"
88 type="scr:Tconfiguration-policy" default="optional" use="optional" />
89 <attribute name="activate" type="token" use="optional"
90 default="activate" />
91 <attribute name="deactivate" type="token" use="optional"
92 default="deactivate" />
93 <attribute name="modified" type="token" use="optional" />
94 <anyAttribute />
95 </complexType>
96 <complexType name="Timplementation">
97 <sequence>
98 <any namespace="##any" processContents="lax" minOccurs="0"
99 maxOccurs="unbounded" />
100 </sequence>
101 <attribute name="class" type="token" use="required" />
102 <anyAttribute />
103 </complexType>
104 <complexType name="Tproperty">
105 <simpleContent>
106 <extension base="string">
107 <attribute name="name" type="string" use="required" />
108 <attribute name="value" type="string" use="optional" />
109 <attribute name="type" type="scr:Tjava-types"
110 default="String" use="optional" />
111 <anyAttribute />
112 </extension>
113 </simpleContent>
114 </complexType>
115 <complexType name="Tproperties">
116 <sequence>
117 <any namespace="##any" processContents="lax" minOccurs="0"
118 maxOccurs="unbounded" />
119 </sequence>
120 <attribute name="entry" type="string" use="required" />
121 <anyAttribute />
122 </complexType>
123 <complexType name="Tservice">
124 <sequence>
125 <element name="provide" type="scr:Tprovide" minOccurs="1"
126 maxOccurs="unbounded" />
127 <!-- It is non-deterministic, per W3C XML Schema 1.0:
128 http://www.w3.org/TR/xmlschema-1/#cos-nonambig
129 to use name space="##any" below. -->
130 <any namespace="##other" processContents="lax" minOccurs="0"
131 maxOccurs="unbounded" />
132 </sequence>
133 <attribute name="servicefactory" type="boolean" default="false"
134 use="optional" />
135 <anyAttribute />
136 </complexType>
137 <complexType name="Tprovide">
138 <sequence>
139 <any namespace="##any" processContents="lax" minOccurs="0"
140 maxOccurs="unbounded" />
141 </sequence>
142 <attribute name="interface" type="token" use="required" />
143 <anyAttribute />
144 </complexType>
145 <complexType name="Treference">
146 <sequence>
147 <any namespace="##any" processContents="lax" minOccurs="0"
148 maxOccurs="unbounded" />
149 </sequence>
150 <attribute name="name" type="token" use="optional">
151 <annotation>
152 <documentation xml:lang="en">
153 The default value of this attribute is the value of
154 the interface attribute of this element. If multiple
155 instances of this element within a component element
156 use the same value for the interface attribute, then
157 using the default value for this attribute will result
158 in duplicate names. In this case, this attribute
159 must be specified with a unique value.
160 </documentation>
161 </annotation>
162 </attribute>
163 <attribute name="interface" type="token" use="required" />
164 <attribute name="cardinality" type="scr:Tcardinality"
165 default="1..1" use="optional" />
166 <attribute name="policy" type="scr:Tpolicy" default="static"
167 use="optional" />
168 <attribute name="target" type="string" use="optional" />
169 <attribute name="bind" type="token" use="optional" />
170 <attribute name="unbind" type="token" use="optional" />
171 <anyAttribute />
172 </complexType>
173 <simpleType name="Tjava-types">
174 <restriction base="string">
175 <enumeration value="String" />
176 <enumeration value="Long" />
177 <enumeration value="Double" />
178 <enumeration value="Float" />
179 <enumeration value="Integer" />
180 <enumeration value="Byte" />
181 <enumeration value="Character" />
182 <enumeration value="Boolean" />
183 <enumeration value="Short" />
184 </restriction>
185 </simpleType>
186 <simpleType name="Tcardinality">
187 <restriction base="string">
188 <enumeration value="0..1" />
189 <enumeration value="0..n" />
190 <enumeration value="1..1" />
191 <enumeration value="1..n" />
192 </restriction>
193 </simpleType>
194 <simpleType name="Tpolicy">
195 <restriction base="string">
196 <enumeration value="static" />
197 <enumeration value="dynamic" />
198 </restriction>
199 </simpleType>
200 <simpleType name="Tconfiguration-policy">
201 <restriction base="string">
202 <enumeration value="optional" />
203 <enumeration value="require" />
204 <enumeration value="ignore" />
205 </restriction>
206 </simpleType>
207 <attribute name="must-understand" type="boolean">
208 <annotation>
209 <documentation xml:lang="en">
210 This attribute should be used by extensions to documents
211 to require that the document consumer understand the
212 extension. This attribute must be qualified when used.
213 </documentation>
214 </annotation>
215 </attribute>
216</schema>