1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
3 <xsd:schema xmlns="http://www.springframework.org/schema/lang"
4 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
5 xmlns:beans="http://www.springframework.org/schema/beans"
6 xmlns:tool="http://www.springframework.org/schema/tool"
7 targetNamespace="http://www.springframework.org/schema/lang"
8 elementFormDefault="qualified"
9 attributeFormDefault="unqualified">
12 <xsd:documentation><![CDATA[
13 Defines the elements used in the Spring Framework's dynamic language
14 support, which allows bean definitions that are backed by classes
15 written in a language other than Java.
16 ]]></xsd:documentation>
19 <xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"/>
20 <xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.1.xsd"/>
22 <xsd:element name="defaults">
24 <xsd:documentation><![CDATA[
25 Default settings for any scripted beans registered within this context.
26 ]]></xsd:documentation>
29 <xsd:attributeGroup ref="defaultableAttributes"/>
33 <xsd:element name="groovy">
35 <xsd:documentation><![CDATA[
36 A Spring bean backed by a Groovy class definition.
37 ]]></xsd:documentation>
41 <xsd:extension base="customizableScriptType">
42 <xsd:attributeGroup ref="defaultableAttributes"/>
48 <xsd:element name="jruby">
50 <xsd:documentation><![CDATA[
51 A Spring bean backed by a JRuby class definition.
52 ]]></xsd:documentation>
56 <xsd:extension base="dynamicScriptType">
57 <xsd:attributeGroup ref="vanillaScriptAttributes"/>
63 <xsd:element name="bsh">
65 <xsd:documentation><![CDATA[
66 A Spring bean backed by a BeanShell script.
67 ]]></xsd:documentation>
71 <xsd:extension base="dynamicScriptType">
72 <xsd:attributeGroup ref="vanillaScriptAttributes"/>
79 <xsd:complexType name="simpleScriptType">
81 <xsd:extension base="beans:identifiedType">
83 <xsd:element name="inline-script" minOccurs="0" maxOccurs="1">
85 <xsd:documentation><![CDATA[
86 The source code for the dynamic language-backed bean.
87 ]]></xsd:documentation>
90 <xsd:element name="property" type="beans:propertyType" minOccurs="0" maxOccurs="unbounded">
92 <xsd:documentation><![CDATA[
93 Dynamic language-backed bean definitions can have zero or more properties.
94 Property elements correspond to JavaBean setter methods exposed
95 by the bean classes. Spring supports primitives, references to other
96 beans in the same or related factories, lists, maps and properties.
97 ]]></xsd:documentation>
101 <xsd:attribute name="script-source" type="xsd:string">
103 <xsd:documentation source="java:org.springframework.core.io.Resource"><![CDATA[
104 The resource containing the script for the dynamic language-backed bean.
106 Examples might be '/WEB-INF/scripts/Anais.groovy', 'classpath:Nin.bsh', etc.
107 ]]></xsd:documentation>
110 <xsd:attribute name="name" type="xsd:string">
112 <xsd:documentation><![CDATA[
113 The name of this scripted bean as an alias or replacement for the id.
114 ]]></xsd:documentation>
117 <xsd:attribute name="scope" type="xsd:string">
119 <xsd:documentation><![CDATA[
120 The scope of this scripted bean: typically "singleton" (one shared instance,
121 which will be returned by all calls to getBean with the given id), or
122 "prototype" (independent instance resulting from each call to getBean).
123 Default is "singleton".
125 Singletons are most commonly used, and are ideal for multi-threaded
126 service objects. Further scopes, such as "request" or "session", might
127 be supported by extended bean factories (e.g. in a web environment).
128 ]]></xsd:documentation>
131 <xsd:attribute name="autowire" default="default">
133 <xsd:documentation><![CDATA[
134 The autowire mode for the scripted bean.
135 Analogous to the 'autowire' attribute on a standard bean definition.
136 ]]></xsd:documentation>
139 <xsd:restriction base="xsd:NMTOKEN">
140 <xsd:enumeration value="default"/>
141 <xsd:enumeration value="no"/>
142 <xsd:enumeration value="byName"/>
143 <xsd:enumeration value="byType"/>
147 <xsd:attribute name="depends-on" type="xsd:string">
149 <xsd:documentation><![CDATA[
150 The names of the beans that this bean depends on being initialized.
151 The bean factory will guarantee that these beans get initialized
154 Note that dependencies are normally expressed through bean properties.
155 This property should just be necessary other kinds of dependencies
156 like statics (*ugh*) or database preparation on startup.
157 ]]></xsd:documentation>
160 <xsd:attribute name="init-method" type="xsd:string">
162 <xsd:documentation><![CDATA[
163 The name of an initialization method defined on the scripted bean.
164 Analogous to the 'init-method' attribute on a standard bean definition.
165 ]]></xsd:documentation>
168 <xsd:attribute name="destroy-method" type="xsd:string">
170 <xsd:documentation><![CDATA[
171 The name of a destruction method defined on the scripted bean.
172 Analogous to the 'destroy-method' attribute on a standard bean definition.
173 ]]></xsd:documentation>
177 </xsd:complexContent>
180 <xsd:complexType name="dynamicScriptType">
182 <xsd:extension base="simpleScriptType">
183 <xsd:attribute name="script-interfaces">
185 <xsd:documentation source="java:java.lang.Class"><![CDATA[
186 The Java interfaces that the dynamic language-backed object is to expose; comma-delimited.
187 ]]></xsd:documentation>
191 </xsd:complexContent>
194 <xsd:complexType name="customizableScriptType">
196 <xsd:extension base="simpleScriptType">
197 <xsd:attribute name="customizer-ref">
199 <xsd:documentation><![CDATA[
200 Reference to a GroovyObjectCustomizer or similar customizer bean.
201 ]]></xsd:documentation>
205 </xsd:complexContent>
208 <xsd:attributeGroup name="vanillaScriptAttributes">
209 <xsd:attribute name="refresh-check-delay" type="xsd:long">
211 <xsd:documentation><![CDATA[
212 The delay (in milliseconds) between checks for updated sources when
213 using the refreshable beans feature.
214 ]]></xsd:documentation>
217 </xsd:attributeGroup>
219 <xsd:attributeGroup name="defaultableAttributes">
220 <xsd:attribute name="proxy-target-class" type="xsd:boolean">
222 <xsd:documentation><![CDATA[
223 Flag to tell the bean factory that if this bean is proxied it should be done using the target class type,
224 not its interfaces. A refreshable script is normally proxied, so often this is useful in conjunction with
225 refresh-check-delay. Defaults to false requiring no additional library dependencies, but hiding behaviour in the
226 bean that is not defined in an interface.
227 ]]></xsd:documentation>
230 <xsd:attributeGroup ref="vanillaScriptAttributes"></xsd:attributeGroup>
231 </xsd:attributeGroup>