blob: fd3c636d7a1dab3d2122d2b218b555b9485c1cfe [file] [log] [blame]
Clement Escoffierf58887c2008-09-09 14:21:15 +00001<!--
2 Licensed to the Apache Software Foundation (ASF) under one
3 or more contributor license agreements. See the NOTICE file
4 distributed with this work for additional information
5 regarding copyright ownership. The ASF licenses this file
6 to you under the Apache License, Version 2.0 (the
7 "License"); you may not use this file except in compliance
8 with the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied. See the License for the
16 specific language governing permissions and limitations
17 under the License.
18-->
19<xs:schema elementFormDefault="qualified" targetNamespace="org.apache.felix.ipojo"
20 xmlns="org.apache.felix.ipojo" xmlns:xs="http://www.w3.org/2001/XMLSchema">
21 <xs:annotation>
22 <xs:documentation>iPOJO Core XML-Schema. This grammars models iPOJO descriptor using core features. It provides several extensibility mechanism in order to compose this schema with external handlers and other component implementation type such as compositions.</xs:documentation></xs:annotation>
23 <xs:element name="ipojo">
24 <xs:complexType>
25 <xs:choice minOccurs="0" maxOccurs="unbounded">
26 <xs:element ref="handler" minOccurs="0" maxOccurs="unbounded">
27 </xs:element>
28 <xs:element ref="instance" minOccurs="0" maxOccurs="unbounded">
29 </xs:element>
30 <xs:element ref="component" minOccurs="0" maxOccurs="unbounded">
31 </xs:element>
32 <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
33 </xs:any>
34 </xs:choice>
35 </xs:complexType>
36 </xs:element>
37 <xs:complexType name="HandlerType">
38 <xs:complexContent>
39 <xs:extension base="RootElementType">
40 <xs:sequence maxOccurs="unbounded" minOccurs="0">
41 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##any"
42 processContents="skip">
43 </xs:any>
44 </xs:sequence>
45 <xs:attribute name="classname" type="xs:string" use="required">
46 </xs:attribute>
47 <xs:attribute name="name" type="xs:string" use="required">
48 </xs:attribute>
49 <xs:attribute name="namespace" type="xs:string" use="optional">
50 </xs:attribute>
51 <xs:attribute name="architecture" type="xs:boolean"
52 use="optional" fixed="false">
53 </xs:attribute>
54 <xs:attribute name="level" type="xs:int" use="optional">
55 </xs:attribute>
56 </xs:extension>
57 </xs:complexContent>
58 </xs:complexType>
59 <xs:complexType name="InstanceType">
60 <xs:complexContent>
61 <xs:extension base="RootElementType">
62 <xs:sequence minOccurs="0" maxOccurs="unbounded">
63 <xs:element name="property" type="InstancePropertyType"></xs:element>
64 </xs:sequence>
65 <xs:attribute name="component" type="xs:string"></xs:attribute>
66 <xs:attribute name="name" type="xs:string" use="optional">
67 </xs:attribute>
68 </xs:extension>
69 </xs:complexContent>
70 </xs:complexType>
71 <xs:complexType name="InstancePropertyType">
72 <xs:sequence>
73 <xs:element name="property" type="InstancePropertyType" minOccurs="0" maxOccurs="unbounded"></xs:element>
74 </xs:sequence>
75 <xs:attribute name="name" type="xs:string" use="optional"></xs:attribute>
76 <xs:attribute name="value" type="xs:string" use="optional"></xs:attribute>
77 <xs:attribute name="type" type="xs:string" use="optional"></xs:attribute>
78 </xs:complexType>
79 <xs:complexType name="RootElementType"></xs:complexType>
80 <xs:complexType name="ComponentType">
81 <xs:annotation>
82 <xs:documentation>
83 Declares an atomic (i.e. primitive) component type
84 </xs:documentation>
85 </xs:annotation>
86 <xs:choice minOccurs="0" maxOccurs="unbounded">
87 <xs:element ref="callback" minOccurs="0"
88 maxOccurs="unbounded">
89 </xs:element>
90 <xs:element ref="provides" minOccurs="0"
91 maxOccurs="unbounded">
92 </xs:element>
93 <xs:element ref="requires" minOccurs="0"
94 maxOccurs="unbounded">
95 </xs:element>
96 <xs:element ref="properties" minOccurs="0"
97 maxOccurs="unbounded">
98 </xs:element>
99 <xs:element ref="controller" minOccurs="0" maxOccurs="1"></xs:element>
100 <xs:any namespace="##other" processContents="lax"
101 minOccurs="0" maxOccurs="unbounded">
102 </xs:any>
103 </xs:choice>
104 <xs:attribute name="name" type="xs:string" use="optional">
105 <xs:annotation>
106 <xs:documentation>
107 Specifies the name of the component type. This name
108 is used to identify the factory attached to this
109 type. If not specified, the factory name is the
110 implementation class name.
111 </xs:documentation>
112 </xs:annotation>
113 </xs:attribute>
114 <xs:attribute name="public" type="xs:boolean" use="optional">
115 <xs:annotation>
116 <xs:documentation>
117 Determines if the component type is public or
118 private. A public factory (default) can be used from
119 any bundles.
120 </xs:documentation>
121 </xs:annotation>
122 </xs:attribute>
123 <xs:attribute name="classname" type="xs:string"
124 use="required">
125 <xs:annotation>
126 <xs:documentation>
127 Specifies the implementation class of the component
128 type.
129 </xs:documentation>
130 </xs:annotation>
131 </xs:attribute>
132 <xs:attribute name="architecture" type="xs:boolean"
133 use="optional">
134 <xs:annotation>
135 <xs:documentation>
136 Enable or disable the architecture exposition. By
137 default, the architecture is exposed. This allows
138 instance introspection.
139 </xs:documentation>
140 </xs:annotation>
141 </xs:attribute>
142 <xs:attribute name="immediate" type="xs:boolean"
143 use="optional">
144 </xs:attribute>
145 <xs:attribute name="factory-method" type="xs:string" use="optional"></xs:attribute>
146 </xs:complexType>
147 <xs:complexType name="RequiresType">
148 <xs:complexContent>
149 <xs:extension base="ServiceDependencyType">
150 <xs:sequence minOccurs="0" maxOccurs="unbounded">
151 <xs:element name="callback"
152 type="DependencyCallbackType">
153 </xs:element>
154 </xs:sequence>
155
156 <xs:attribute name="interface" type="xs:string"
157 use="optional">
158 </xs:attribute>
159
160 <xs:attribute name="field" type="xs:string"
161 use="optional">
162 </xs:attribute>
163
164 <xs:attribute name="nullable" type="xs:boolean"
165 use="optional">
166 </xs:attribute>
167
168 <xs:attribute name="default-implementation"
169 type="xs:string" use="optional">
170 </xs:attribute>
171
172 <xs:attribute name="from" type="xs:string"
173 use="optional">
174 </xs:attribute>
175
176 <xs:attribute name="scope" use="optional">
177 <xs:simpleType>
178 <xs:restriction base="xs:string">
179 <xs:enumeration value="global"></xs:enumeration>
180 <xs:enumeration value="composite"></xs:enumeration>
181 <xs:enumeration value="composite+global"></xs:enumeration>
182 </xs:restriction>
183 </xs:simpleType>
184 </xs:attribute>
185
186 </xs:extension>
187 </xs:complexContent>
188 </xs:complexType>
189 <xs:complexType name="DependencyCallbackType">
190 <xs:attribute name="method" type="xs:string" use="required"></xs:attribute>
191 <xs:attribute name="type" use="required">
192 <xs:simpleType>
193 <xs:restriction base="xs:string">
194 <xs:enumeration value="bind"></xs:enumeration>
195 <xs:enumeration value="unbind"></xs:enumeration>
196 </xs:restriction>
197 </xs:simpleType>
198 </xs:attribute>
199 </xs:complexType>
200 <xs:complexType name="CallbackType">
201 <xs:annotation>
202 <xs:documentation>Lifecycle Callback. Allows a POJO to be notified when the instance becomes valid or invalid.</xs:documentation>
203 </xs:annotation>
204 <xs:attribute name="method" type="xs:string" use="required">
205 <xs:annotation>
206 <xs:documentation>Specifies the method to call on the transition</xs:documentation>
207 </xs:annotation></xs:attribute>
208 <xs:attribute name="transition" use="required">
209 <xs:annotation>
210 <xs:documentation>Specifies the transition when the callback needs to be invoked.</xs:documentation>
211 </xs:annotation>
212 <xs:simpleType>
213 <xs:restriction base="xs:string">
214 <xs:enumeration value="validate"></xs:enumeration>
215 <xs:enumeration value="invalidate"></xs:enumeration>
216 </xs:restriction>
217 </xs:simpleType>
218 </xs:attribute>
219 </xs:complexType>
220 <xs:element name="provides" type="ProvidesType" id="provides"></xs:element>
221 <xs:complexType name="ProvidesType">
222 <xs:sequence minOccurs="0" maxOccurs="unbounded">
223 <xs:element name="property" type="PropertyType"></xs:element>
224 </xs:sequence>
225 <xs:attribute name="interface" type="xs:string" use="optional"></xs:attribute>
226 <xs:attribute name="factory" type="xs:string" use="optional"></xs:attribute>
227 </xs:complexType>
228 <xs:complexType name="PropertyType">
229 <xs:attribute name="field" type="xs:string" use="optional"></xs:attribute>
230 <xs:attribute name="method" type="xs:string" use="optional"></xs:attribute>
231 <xs:attribute name="name" type="xs:string" use="optional"></xs:attribute>
232 <xs:attribute name="value" type="xs:string" use="optional"></xs:attribute>
233 <xs:attribute name="type" type="xs:string" use="optional"></xs:attribute>
234 </xs:complexType>
235 <xs:element name="callback" type="CallbackType" id="callback"></xs:element>
236 <xs:element name="controller" type="ControllerType" id="controller"></xs:element>
237 <xs:element name="requires" type="RequiresType" id="requires"></xs:element>
238 <xs:element name="component" type="ComponentType" id="component"></xs:element>
239 <xs:element name="handler" type="HandlerType" id="handler"></xs:element>
240 <xs:element name="instance" type="InstanceType" id="instance"></xs:element>
241
242 <xs:element name="properties" type="PropertiesType" id="properties"></xs:element>
243 <xs:complexType name="PropertiesType">
244 <xs:sequence minOccurs="0" maxOccurs="unbounded">
245 <xs:element name="property" type="PropertyType"></xs:element>
246 </xs:sequence>
247 <xs:attribute name="propagation" type="xs:boolean" use="optional"></xs:attribute>
248 <xs:attribute name="pid" type="xs:string" use="optional"></xs:attribute>
249 </xs:complexType>
250
251 <xs:complexType name="ServiceDependencyType">
252 <xs:attribute name="optional" type="xs:boolean" use="optional">
253 </xs:attribute>
254 <xs:attribute name="aggregate" type="xs:boolean" use="optional">
255 </xs:attribute>
256 <xs:attribute name="policy" use="optional">
257 <xs:simpleType>
258 <xs:restriction base="xs:string">
259 <xs:enumeration value="dynamic"></xs:enumeration>
260 <xs:enumeration value="static"></xs:enumeration>
261 <xs:enumeration value="dynamic-priority"></xs:enumeration>
262 </xs:restriction>
263 </xs:simpleType>
264 </xs:attribute>
265 <xs:attribute name="comparator" type="xs:string" use="optional">
266 </xs:attribute>
267 <xs:attribute name="filter" type="xs:string" use="optional"></xs:attribute>
268 <xs:attribute name="id" type="xs:string" use="optional"></xs:attribute>
269 </xs:complexType>
270
271 <xs:complexType name="ControllerType">
272 <xs:attribute name="field" type="xs:string" use="required">
273 </xs:attribute>
274 </xs:complexType>
275</xs:schema>