1 <?xml version="1.0" encoding="UTF-8"?>
3 <xsd:schema xmlns="http://www.springframework.org/schema/context"
4 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:beans="http://www.springframework.org/schema/beans"
5 xmlns:tool="http://www.springframework.org/schema/tool"
6 targetNamespace="http://www.springframework.org/schema/context"
7 elementFormDefault="qualified" attributeFormDefault="unqualified">
9 <xsd:import namespace="http://www.springframework.org/schema/beans"
10 schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.0.xsd" />
11 <xsd:import namespace="http://www.springframework.org/schema/tool"
12 schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.0.xsd" />
15 <xsd:documentation><![CDATA[
16 Defines the configuration elements for the Spring Framework's application
17 context support. Effects the activation of various configuration styles
18 for the containing Spring ApplicationContext.
19 ]]></xsd:documentation>
22 <xsd:complexType name="propertyPlaceholder">
23 <xsd:attribute name="location" type="xsd:string">
25 <xsd:documentation><![CDATA[
26 The location of the properties file to resolve placeholders against, as a Spring
27 resource location: a URL, a "classpath:" pseudo URL, or a relative file path.
28 Multiple locations may be specified, separated by commas. If neither location nor properties-ref is
29 specified, placeholders will be resolved against system properties.
30 ]]></xsd:documentation>
33 <xsd:attribute name="properties-ref" type="xsd:string">
35 <xsd:documentation source="java:java.util.Properties"><![CDATA[
36 The bean name of a Java Properties object that will be used for property substitution.
37 If neither location nor properties-ref is specified, placeholders will be resolved against system properties.
38 ]]></xsd:documentation>
41 <xsd:attribute name="file-encoding" type="xsd:string">
43 <xsd:documentation><![CDATA[
44 Specifies the encoding to use for parsing properties files. Default is none,
45 using the java.util.Properties default encoding. Only applies to classic
46 properties files, not to XML files.
47 ]]></xsd:documentation>
50 <xsd:attribute name="order" type="xsd:integer">
52 <xsd:documentation><![CDATA[
53 Specifies the order for this placeholder configurer. If more than one is present in a context
54 the order can be important since the first one to be match a placeholder will win. Often used
56 ]]></xsd:documentation>
59 <xsd:attribute name="ignore-resource-not-found" type="xsd:boolean"
62 <xsd:documentation><![CDATA[
63 Specifies if failure to find the property resource location should be ignored. Default
64 is "false", meaning that if there is no file in the location specified an exception will
66 ]]></xsd:documentation>
69 <xsd:attribute name="ignore-unresolvable" type="xsd:boolean"
72 <xsd:documentation><![CDATA[
73 Specifies if failure to find the property value to replace a key should be ignored. Default
74 is "false", meaning that this placeholder configurer will raise an exception if it cannot resolve
75 a key. Set to "true" to allow the configurer to pass on the key to any others in
76 the context that have not yet visited the key in question.
77 ]]></xsd:documentation>
80 <xsd:attribute name="local-override" type="xsd:boolean"
83 <xsd:documentation><![CDATA[
84 Specifies whether local properties override properties from files. Default
85 is "false": Properties from files override local defaults.
86 ]]></xsd:documentation>
91 <xsd:element name="property-placeholder">
93 <xsd:documentation><![CDATA[
94 Activates replacement of ${...} placeholders, resolved against the specified properties file or
95 Properties object (if any). Falls back to resolving placeholders against JVM system properties.
96 Alternatively, define a parameterized PropertyPlaceholderConfigurer bean in the context.
97 ]]></xsd:documentation>
101 type="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />
107 <xsd:extension base="propertyPlaceholder">
108 <xsd:attribute name="system-properties-mode" default="FALLBACK">
110 <xsd:restriction base="xsd:string">
111 <xsd:enumeration value="NEVER"/>
112 <xsd:enumeration value="FALLBACK"/>
113 <xsd:enumeration value="OVERRIDE"/>
118 </xsd:complexContent>
122 <xsd:element name="property-override">
124 <xsd:documentation><![CDATA[
125 Activates pushing of override values into bean properties, based on configuration
126 lines of the following format: beanName.property=value
127 ]]></xsd:documentation>
131 type="org.springframework.beans.factory.config.PropertyOverrideConfigurer" />
137 <xsd:extension base="propertyPlaceholder" />
138 </xsd:complexContent>
142 <xsd:element name="annotation-config">
144 <xsd:documentation><![CDATA[
145 Activates various annotations to be detected in bean classes: Spring's @Required and
146 @Autowired, as well as JSR 250's @PostConstruct, @PreDestroy and @Resource (if available),
147 JAX-WS's @WebServiceRef (if available), EJB3's @EJB (if available), and JPA's
148 @PersistenceContext and @PersistenceUnit (if available). Alternatively, you may
149 choose to activate the individual BeanPostProcessors for those annotations.
151 Note: This tag does not activate processing of Spring's @Transactional or EJB3's
152 @TransactionAttribute annotation. Consider the use of the <tx:annotation-driven>
153 tag for that purpose.
154 ]]></xsd:documentation>
158 <xsd:element name="component-scan">
160 <xsd:documentation><![CDATA[
161 Scans the classpath for annotated components that will be auto-registered as
162 Spring beans. By default, the Spring-provided @Component, @Repository,
163 @Service, and @Controller stereotypes will be detected.
165 Note: This tag implies the effects of the 'annotation-config' tag, activating @Required,
166 @Autowired, @PostConstruct, @PreDestroy, @Resource, @PersistenceContext and @PersistenceUnit
167 annotations in the component classes, which is usually desired for autodetected components
168 (without external configuration). Turn off the 'annotation-config' attribute to deactivate
169 this default behavior, for example in order to use custom BeanPostProcessor definitions
170 for handling those annotations.
172 Note: You may use placeholders in package paths, but only resolved against system
173 properties (analogous to resource paths). A component scan results in new bean definition
174 being registered; Spring's PropertyPlaceholderConfigurer will apply to those bean
175 definitions just like to regular bean definitions, but it won't apply to the component
176 scan settings themselves.
177 ]]></xsd:documentation>
181 <xsd:element name="include-filter" type="filterType"
182 minOccurs="0" maxOccurs="unbounded">
184 <xsd:documentation><![CDATA[
185 Controls which eligible types to include for component scanning.
186 ]]></xsd:documentation>
189 <xsd:element name="exclude-filter" type="filterType"
190 minOccurs="0" maxOccurs="unbounded">
192 <xsd:documentation><![CDATA[
193 Controls which eligible types to exclude for component scanning.
194 ]]></xsd:documentation>
198 <xsd:attribute name="base-package" type="xsd:string"
201 <xsd:documentation><![CDATA[
202 The comma-separated list of packages to scan for annotated components.
203 ]]></xsd:documentation>
206 <xsd:attribute name="resource-pattern" type="xsd:string">
208 <xsd:documentation><![CDATA[
209 Controls the class files eligible for component detection. Defaults to "**/*.class", the recommended value.
210 ]]></xsd:documentation>
213 <xsd:attribute name="use-default-filters" type="xsd:boolean"
216 <xsd:documentation><![CDATA[
217 Indicates whether automatic detection of classes annotated with @Component, @Repository, @Service,
218 or @Controller should be enabled. Default is "true".
219 ]]></xsd:documentation>
222 <xsd:attribute name="annotation-config" type="xsd:boolean"
225 <xsd:documentation><![CDATA[
226 Indicates whether the implicit annotation post-processors should be enabled. Default is "true".
227 ]]></xsd:documentation>
230 <xsd:attribute name="name-generator" type="xsd:string">
232 <xsd:documentation><![CDATA[
233 The fully-qualified class name of the BeanNameGenerator to be used for naming detected components.
234 ]]></xsd:documentation>
237 <tool:expected-type type="java.lang.Class" />
239 type="org.springframework.beans.factory.support.BeanNameGenerator" />
244 <xsd:attribute name="scope-resolver" type="xsd:string">
246 <xsd:documentation><![CDATA[
247 The fully-qualified class name of the ScopeMetadataResolver to be used for resolving the scope of
249 ]]></xsd:documentation>
252 <tool:expected-type type="java.lang.Class" />
254 type="org.springframework.context.annotation.ScopeMetadataResolver" />
259 <xsd:attribute name="scoped-proxy">
261 <xsd:documentation><![CDATA[
262 Indicates whether proxies should be generated for detected components, which may be necessary
263 when using scopes in a proxy-style fashion. Default is to generate no such proxies.
264 ]]></xsd:documentation>
267 <xsd:restriction base="xsd:string">
268 <xsd:enumeration value="no" />
269 <xsd:enumeration value="interfaces" />
270 <xsd:enumeration value="targetClass" />
277 <xsd:element name="load-time-weaver">
279 <xsd:documentation><![CDATA[
280 Activates a Spring LoadTimeWeaver for this application context, available as
281 a bean with the name "loadTimeWeaver". Any bean that implements the
282 LoadTimeWeaverAware interface will then receive the LoadTimeWeaver reference
283 automatically; for example, Spring's JPA bootstrap support.
285 The default weaver is determined automatically. As of Spring 2.5: detecting
286 Sun's GlassFish, Oracle's OC4J, Spring's VM agent and any ClassLoader
287 supported by Spring's ReflectiveLoadTimeWeaver (for example, the
288 TomcatInstrumentableClassLoader).
290 The activation of AspectJ load-time weaving is specified via a simple flag
291 (the 'aspectj-weaving' attribute), with the AspectJ class transformer
292 registered through Spring's LoadTimeWeaver. AspectJ weaving will be activated
293 by default if a "META-INF/aop.xml" resource is present in the classpath.
295 This also activates the current application context for applying dependency
296 injection to non-managed classes that are instantiated outside of the Spring
297 bean factory (typically classes annotated with the @Configurable annotation).
298 This will only happen if the AnnotationBeanConfigurerAspect is on the classpath
299 (i.e. spring-aspects.jar), effectively activating "spring-configured" by default.
300 ]]></xsd:documentation>
304 type="org.springframework.instrument.classloading.LoadTimeWeaver" />
309 <xsd:attribute name="weaver-class" type="xsd:string">
311 <xsd:documentation><![CDATA[
312 The fully-qualified classname of the LoadTimeWeaver that is to be activated.
313 ]]></xsd:documentation>
316 <tool:expected-type type="java.lang.Class" />
318 type="org.springframework.instrument.classloading.LoadTimeWeaver" />
323 <xsd:attribute name="aspectj-weaving" default="autodetect">
325 <xsd:restriction base="xsd:string">
326 <xsd:enumeration value="on">
328 <xsd:documentation><![CDATA[
329 Switches Spring-based AspectJ load-time weaving on.
330 ]]></xsd:documentation>
333 <xsd:enumeration value="off">
335 <xsd:documentation><![CDATA[
336 Switches Spring-based AspectJ load-time weaving off.
337 ]]></xsd:documentation>
340 <xsd:enumeration value="autodetect">
342 <xsd:documentation><![CDATA[
343 Switches AspectJ load-time weaving on if a "META-INF/aop.xml" resource
344 is present in the classpath. If there is no such resource, then AspectJ
345 load-time weaving will be switched off.
346 ]]></xsd:documentation>
355 <xsd:element name="spring-configured">
358 source="java:org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect">
360 Signals the current application context to apply dependency injection
361 to non-managed classes that are instantiated outside of the Spring bean
362 factory (typically classes annotated with the @Configurable annotation).
363 ]]></xsd:documentation>
366 <xsd:restriction base="xsd:string" />
370 <xsd:element name="mbean-export">
373 source="java:org.springframework.jmx.export.annotation.AnnotationMBeanExporter"><![CDATA[
374 Activates default exporting of MBeans by detecting standard MBeans in the Spring
375 context as well as @ManagedResource annotations on Spring-defined beans.
377 The resulting MBeanExporter bean is defined under the name "mbeanExporter".
378 Alternatively, consider defining a custom AnnotationMBeanExporter bean explicitly.
379 ]]></xsd:documentation>
383 type="org.springframework.jmx.export.annotation.AnnotationMBeanExporter" />
388 <xsd:attribute name="default-domain" type="xsd:string">
390 <xsd:documentation><![CDATA[
391 The default domain to use when generating JMX ObjectNames.
392 ]]></xsd:documentation>
395 <xsd:attribute name="server" type="xsd:string">
397 <xsd:documentation><![CDATA[
398 The bean name of the MBeanServer to which MBeans should be exported.
399 Default is to use the platform's default MBeanServer (autodetecting
400 WebLogic 9+, WebSphere 5.1+ and the JDK 1.5+ platform MBeanServer).
401 ]]></xsd:documentation>
404 <xsd:attribute name="registration">
406 <xsd:documentation><![CDATA[
407 The registration behavior, indicating how to deal with existing MBeans
408 of the same name: fail with an exception, ignore and keep the existing
409 MBean, or replace the existing one with the new MBean.
411 Default is to fail with an exception.
412 ]]></xsd:documentation>
415 <xsd:restriction base="xsd:NMTOKEN">
416 <xsd:enumeration value="failOnExisting" />
417 <xsd:enumeration value="ignoreExisting" />
418 <xsd:enumeration value="replaceExisting" />
425 <xsd:element name="mbean-server">
428 source="java:org.springframework.jmx.support.MBeanServerFactoryBean"><![CDATA[
429 Exposes a default MBeanServer for the current platform.
430 Autodetects WebLogic 9+, WebSphere 6.1+ and the JDK 1.5+ platform MBeanServer.
432 The default bean name for the exposed MBeanServer is "mbeanServer".
433 This may be customized through specifying the "id" attribute.
434 ]]></xsd:documentation>
437 <tool:exports type="javax.management.MBeanServer" />
443 <xsd:extension base="beans:identifiedType">
444 <xsd:attribute name="agent-id" type="xsd:string">
446 <xsd:documentation><![CDATA[
447 The agent id of the target MBeanServer, if any.
448 ]]></xsd:documentation>
452 </xsd:complexContent>
456 <xsd:complexType name="filterType">
457 <xsd:attribute name="type" use="required">
459 <xsd:documentation><![CDATA[
460 Controls the type of filtering to apply to the expression.
462 "annotation" indicates an annotation to be present at the type level in target components;
463 "assignable" indicates a class (or interface) that the target components are assignable to (extend/implement);
464 "aspectj" indicates an AspectJ type expression to be matched by the target components;
465 "regex" indicates a regex expression to be matched by the target components' class names;
466 "custom" indicates a custom implementation of the org.springframework.core.type.TypeFilter interface.
468 Note: This attribute will not be inherited by child bean definitions.
469 Hence, it needs to be specified per concrete bean definition.
470 ]]></xsd:documentation>
473 <xsd:restriction base="xsd:string">
474 <xsd:enumeration value="annotation" />
475 <xsd:enumeration value="assignable" />
476 <xsd:enumeration value="aspectj" />
477 <xsd:enumeration value="regex" />
478 <xsd:enumeration value="custom" />
482 <xsd:attribute name="expression" type="xsd:string" use="required">
484 <xsd:documentation><![CDATA[
485 Indicates the filter expression, the type of which is indicated by "type".
486 ]]></xsd:documentation>