blob: a02adccb5d35655ee829c46008f257af3d1b08a3 [file] [log] [blame]
Michael E. Rodriguez86f57b02006-03-29 21:05:08 +00001<?xml version="1.0" encoding="UTF-8"?>
2<!--
3/*
Christian van Spaandonk569a4c52008-08-02 09:56:01 +00004 * $Header: /cvshome/build/xmlns/scr/scr.xsd,v 1.12 2006/07/11 13:27:46 hargrave Exp $
Michael E. Rodriguez86f57b02006-03-29 21:05:08 +00005 *
Christian van Spaandonk569a4c52008-08-02 09:56:01 +00006 * Copyright (c) OSGi Alliance (2005, 2006). All Rights Reserved.
Michael E. Rodriguez86f57b02006-03-29 21:05:08 +00007 *
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" targetNamespace="http://www.osgi.org/xmlns/scr/v1.0.0" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
22 <annotation>
23 <documentation xml:lang="en">
24This is the XML Schema for component descriptions used by the Service Component Runtime (SCR).
25Component description documents may be embedded in other XML documents. The SCR will
26process all XML documents listed in the Service-Component manifest header of a bundle.
27XML documents containing component descriptions may contain a single, root component
28element or one or more component elements embedded in a larger document. Use of the
29namespace is optional if the document only contains a root component element. In this
30case, the scr namespace is assumed. Otherwise the namespace must be used.
31 </documentation>
32 </annotation>
33
34 <element name="component" type="scr:Tcomponent"/>
35
36 <complexType name="Tcomponent">
37 <annotation>
38 <documentation xml:lang="en">
39 Implementations of SCR must not require component descriptions to specify the subelements
40 of the component element in the order as required by the schema. SCR implementations must
41 allow other orderings since arbitrary orderings do not affect the meaning of the component
42 description. Only the relative ordering of property and properties element have meaning.
43 </documentation>
44 </annotation>
45 <sequence>
46 <element name="implementation" type="scr:Timplementation" minOccurs="1" maxOccurs="1"/>
47 <choice minOccurs="0" maxOccurs="unbounded">
48 <element name="property" type="scr:Tproperty"/>
49 <element name="properties" type="scr:Tproperties"/>
50 </choice>
51 <element name="service" type="scr:Tservice" minOccurs="0" maxOccurs="1"/>
52 <element name="reference" type="scr:Treference" minOccurs="0" maxOccurs="unbounded"/>
53 </sequence>
54 <attribute name="enabled" type="boolean" default="true" use="optional"/>
55 <attribute name="name" type="token" use="required"/>
56 <attribute name="factory" type="string" use="optional"/>
57 <attribute name="immediate" type="boolean" use="optional"/>
58 </complexType>
59
60 <complexType name="Timplementation">
61 <attribute name="class" type="token" use="required"/>
62 </complexType>
63
64 <complexType name="Tproperty">
65 <simpleContent>
66 <extension base="string">
67 <attribute name="name" type="string" use="required"/>
68 <attribute name="value" type="string" use="optional"/>
69 <attribute name="type" type="scr:TjavaTypes" default="String" use="optional"/>
70 </extension>
71 </simpleContent>
72 </complexType>
73
74 <complexType name="Tproperties">
75 <attribute name="entry" type="string" use="required"/>
76 </complexType>
77
78 <complexType name="Tservice">
79 <sequence>
80 <element name="provide" type="scr:Tprovide" minOccurs="1" maxOccurs="unbounded"/>
81 </sequence>
82 <attribute name="servicefactory" type="boolean" default="false" use="optional"/>
83 </complexType>
84
85 <complexType name="Tprovide">
86 <attribute name="interface" type="token" use="required"/>
87 </complexType>
88
89 <complexType name="Treference">
90 <attribute name="name" type="NMTOKEN" use="required"/>
91 <attribute name="interface" type="token" use="required"/>
92 <attribute name="cardinality" type="scr:Tcardinality" default="1..1" use="optional"/>
93 <attribute name="policy" type="scr:Tpolicy" default="static" use="optional"/>
94 <attribute name="target" type="string" use="optional"/>
95 <attribute name="bind" type="token" use="optional"/>
96 <attribute name="unbind" type="token" use="optional"/>
97 </complexType>
98
99 <simpleType name="TjavaTypes">
100 <restriction base="string">
101 <enumeration value="String"/>
102 <enumeration value="Long"/>
103 <enumeration value="Double"/>
104 <enumeration value="Float"/>
105 <enumeration value="Integer"/>
106 <enumeration value="Byte"/>
107 <enumeration value="Char"/>
108 <enumeration value="Boolean"/>
109 <enumeration value="Short"/>
110 </restriction>
111 </simpleType>
112
113 <simpleType name="Tcardinality">
114 <restriction base="string">
115 <enumeration value="0..1"/>
116 <enumeration value="0..n"/>
117 <enumeration value="1..1"/>
118 <enumeration value="1..n"/>
119 </restriction>
120 </simpleType>
121
122 <simpleType name="Tpolicy">
123 <restriction base="string">
124 <enumeration value="static"/>
125 <enumeration value="dynamic"/>
126 </restriction>
127 </simpleType>
128
129</schema>