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" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.1.xsd" />
10 <xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.1.xsd" />
13 <xsd:documentation><![CDATA[
14 Defines the configuration elements for the Spring Framework's application
15 context support. Effects the activation of various configuration styles
16 for the containing Spring ApplicationContext.
17 ]]></xsd:documentation>
20 <xsd:complexType name="propertyPlaceholder">
21 <xsd:attribute name="location" type="xsd:string">
23 <xsd:documentation><![CDATA[
24 The location of the properties file to resolve placeholders against, as a Spring
25 resource location: a URL, a "classpath:" pseudo URL, or a relative file path.
26 Multiple locations may be specified, separated by commas. If neither location nor properties-ref is
27 specified, placeholders will be resolved against system properties.
28 ]]></xsd:documentation>
31 <xsd:attribute name="properties-ref" type="xsd:string">
33 <xsd:documentation source="java:java.util.Properties"><![CDATA[
34 The bean name of a Java Properties object that will be used for property substitution.
35 If neither location nor properties-ref is specified, placeholders will be resolved against system properties.
36 ]]></xsd:documentation>
39 <xsd:attribute name="file-encoding" type="xsd:string">
41 <xsd:documentation><![CDATA[
42 Specifies the encoding to use for parsing properties files. Default is none,
43 using the java.util.Properties default encoding. Only applies to classic
44 properties files, not to XML files.
45 ]]></xsd:documentation>
48 <xsd:attribute name="order" type="xsd:integer">
50 <xsd:documentation><![CDATA[
51 Specifies the order for this placeholder configurer. If more than one is present in a context
52 the order can be important since the first one to be match a placeholder will win. Often used
54 ]]></xsd:documentation>
57 <xsd:attribute name="ignore-resource-not-found" type="xsd:boolean"
60 <xsd:documentation><![CDATA[
61 Specifies if failure to find the property resource location should be ignored. Default
62 is "false", meaning that if there is no file in the location specified an exception will
64 ]]></xsd:documentation>
67 <xsd:attribute name="ignore-unresolvable" type="xsd:boolean"
70 <xsd:documentation><![CDATA[
71 Specifies if failure to find the property value to replace a key should be ignored. Default
72 is "false", meaning that this placeholder configurer will raise an exception if it cannot resolve
73 a key. Set to "true" to allow the configurer to pass on the key to any others in
74 the context that have not yet visited the key in question.
75 ]]></xsd:documentation>
78 <xsd:attribute name="local-override" type="xsd:boolean"
81 <xsd:documentation><![CDATA[
82 Specifies whether local properties override properties from files. Default
83 is "false": Properties from files override local defaults.
84 ]]></xsd:documentation>
89 <xsd:element name="property-placeholder">
91 <xsd:documentation><![CDATA[
92 Activates replacement of ${...} placeholders by registering a
93 PropertySourcesPlaceholderConfigurer within the application context. Properties will
94 be resolved against the specified properties file or Properties object -- so called
95 "local properties", if any, and against the Spring Environment's current set of
98 Note that as of Spring 3.1 the system-properties-mode attribute has been removed in
99 favor of the more flexible PropertySources mechanism. However, Spring 3.1-based
100 applications may continue to use the 3.0 (and older) versions of the spring-context
101 schema in order to preserve system-properties-mode behavior. In this case, the
102 traditional PropertyPlaceholderConfigurer component will be registered instead of the
103 new PropertySourcesPlaceholderConfigurer.
105 See ConfigurableEnvironment Javadoc for more information on using.
106 ]]></xsd:documentation>
110 type="org.springframework.context.support.PropertySourcesPlaceholderConfigurer" />
116 <xsd:extension base="propertyPlaceholder">
117 <xsd:attribute name="system-properties-mode" default="ENVIRONMENT">
119 <xsd:documentation><![CDATA[
120 Controls how to resolve placeholders against system properties. As of Spring 3.1, this
121 attribute value defaults to "ENVIRONMENT", indicating that resolution of placeholders
122 against system properties is handled via PropertySourcesPlaceholderConfigurer and its
123 delegation to the current Spring Environment object.
125 For maximum backward compatibility, this attribute is preserved going forward with the
126 3.1 version of the context schema, and any values other than the default "ENVIRONMENT"
127 will cause a traditional PropertyPlaceholderConfigurer to be registered instead of the
128 newer PropertySourcesPlaceholderConfigurer variant. In this case, the Spring Environment
129 and its property sources are not interrogated when resolving placeholders. Users are
130 encouraged to consider this attribute deprecated, and to take advantage of
131 Environment/PropertySource mechanisms. See ConfigurableEnvironment Javadoc for examples.
133 "ENVIRONMENT" indicates placeholders should be resolved against the current Environment and against any local properties;
134 "NEVER" indicates placeholders should be resolved only against local properties and never against system properties;
135 "FALLBACK" indicates placeholders should be resolved against any local properties and then against system properties;
136 "OVERRIDE" indicates placeholders should be resolved first against system properties and then against any local properties;
137 ]]></xsd:documentation>
140 <xsd:restriction base="xsd:string">
141 <xsd:enumeration value="ENVIRONMENT"/>
142 <xsd:enumeration value="NEVER"/>
143 <xsd:enumeration value="FALLBACK"/>
144 <xsd:enumeration value="OVERRIDE"/>
149 </xsd:complexContent>
153 <xsd:element name="property-override">
155 <xsd:documentation><![CDATA[
156 Activates pushing of override values into bean properties, based on configuration
157 lines of the following format: beanName.property=value
158 ]]></xsd:documentation>
162 type="org.springframework.beans.factory.config.PropertyOverrideConfigurer" />
168 <xsd:extension base="propertyPlaceholder" />
169 </xsd:complexContent>
173 <xsd:element name="annotation-config">
175 <xsd:documentation><![CDATA[
176 Activates various annotations to be detected in bean classes: Spring's @Required and
177 @Autowired, as well as JSR 250's @PostConstruct, @PreDestroy and @Resource (if available),
178 JAX-WS's @WebServiceRef (if available), EJB3's @EJB (if available), and JPA's
179 @PersistenceContext and @PersistenceUnit (if available). Alternatively, you may
180 choose to activate the individual BeanPostProcessors for those annotations.
182 Note: This tag does not activate processing of Spring's @Transactional or EJB3's
183 @TransactionAttribute annotation. Consider the use of the <tx:annotation-driven>
184 tag for that purpose.
186 See Javadoc for org.springframework.context.annotation.AnnotationConfigApplicationContext
187 for information on code-based alternatives to bootstrapping annotation-driven support.
189 ]]></xsd:documentation>
193 <xsd:element name="component-scan">
195 <xsd:documentation><![CDATA[
196 Scans the classpath for annotated components that will be auto-registered as
197 Spring beans. By default, the Spring-provided @Component, @Repository,
198 @Service, and @Controller stereotypes will be detected.
200 Note: This tag implies the effects of the 'annotation-config' tag, activating @Required,
201 @Autowired, @PostConstruct, @PreDestroy, @Resource, @PersistenceContext and @PersistenceUnit
202 annotations in the component classes, which is usually desired for autodetected components
203 (without external configuration). Turn off the 'annotation-config' attribute to deactivate
204 this default behavior, for example in order to use custom BeanPostProcessor definitions
205 for handling those annotations.
207 Note: You may use placeholders in package paths, but only resolved against system
208 properties (analogous to resource paths). A component scan results in new bean definition
209 being registered; Spring's PropertyPlaceholderConfigurer will apply to those bean
210 definitions just like to regular bean definitions, but it won't apply to the component
211 scan settings themselves.
213 See Javadoc for org.springframework.context.annotation.ComponentScan for information
214 on code-based alternatives to bootstrapping component-scanning.
215 ]]></xsd:documentation>
219 <xsd:element name="include-filter" type="filterType"
220 minOccurs="0" maxOccurs="unbounded">
222 <xsd:documentation><![CDATA[
223 Controls which eligible types to include for component scanning.
224 ]]></xsd:documentation>
227 <xsd:element name="exclude-filter" type="filterType"
228 minOccurs="0" maxOccurs="unbounded">
230 <xsd:documentation><![CDATA[
231 Controls which eligible types to exclude for component scanning.
232 ]]></xsd:documentation>
236 <xsd:attribute name="base-package" type="xsd:string"
239 <xsd:documentation><![CDATA[
240 The comma-separated list of packages to scan for annotated components.
241 ]]></xsd:documentation>
244 <xsd:attribute name="resource-pattern" type="xsd:string">
246 <xsd:documentation><![CDATA[
247 Controls the class files eligible for component detection. Defaults to "**/*.class", the recommended value.
248 Consider use of the include-filter and exclude-filter elements for a more fine-grained approach.
249 ]]></xsd:documentation>
252 <xsd:attribute name="use-default-filters" type="xsd:boolean"
255 <xsd:documentation><![CDATA[
256 Indicates whether automatic detection of classes annotated with @Component, @Repository, @Service,
257 or @Controller should be enabled. Default is "true".
258 ]]></xsd:documentation>
261 <xsd:attribute name="annotation-config" type="xsd:boolean"
264 <xsd:documentation><![CDATA[
265 Indicates whether the implicit annotation post-processors should be enabled. Default is "true".
266 ]]></xsd:documentation>
269 <xsd:attribute name="name-generator" type="xsd:string">
271 <xsd:documentation><![CDATA[
272 The fully-qualified class name of the BeanNameGenerator to be used for naming detected components.
273 ]]></xsd:documentation>
276 <tool:expected-type type="java.lang.Class" />
278 type="org.springframework.beans.factory.support.BeanNameGenerator" />
283 <xsd:attribute name="scope-resolver" type="xsd:string">
285 <xsd:documentation><![CDATA[
286 The fully-qualified class name of the ScopeMetadataResolver to be used for resolving the scope of
288 ]]></xsd:documentation>
291 <tool:expected-type type="java.lang.Class" />
293 type="org.springframework.context.annotation.ScopeMetadataResolver" />
298 <xsd:attribute name="scoped-proxy">
300 <xsd:documentation><![CDATA[
301 Indicates whether proxies should be generated for detected components, which may be necessary
302 when using scopes in a proxy-style fashion. Default is to generate no such proxies.
303 ]]></xsd:documentation>
306 <xsd:restriction base="xsd:string">
307 <xsd:enumeration value="no" />
308 <xsd:enumeration value="interfaces" />
309 <xsd:enumeration value="targetClass" />
316 <xsd:element name="load-time-weaver">
318 <xsd:documentation><![CDATA[
319 Activates a Spring LoadTimeWeaver for this application context, available as
320 a bean with the name "loadTimeWeaver". Any bean that implements the
321 LoadTimeWeaverAware interface will then receive the LoadTimeWeaver reference
322 automatically; for example, Spring's JPA bootstrap support.
324 The default weaver is determined automatically. As of Spring 2.5: detecting
325 Sun's GlassFish, Oracle's OC4J, Spring's VM agent and any ClassLoader
326 supported by Spring's ReflectiveLoadTimeWeaver (for example, the
327 TomcatInstrumentableClassLoader).
329 The activation of AspectJ load-time weaving is specified via a simple flag
330 (the 'aspectj-weaving' attribute), with the AspectJ class transformer
331 registered through Spring's LoadTimeWeaver. AspectJ weaving will be activated
332 by default if a "META-INF/aop.xml" resource is present in the classpath.
334 This also activates the current application context for applying dependency
335 injection to non-managed classes that are instantiated outside of the Spring
336 bean factory (typically classes annotated with the @Configurable annotation).
337 This will only happen if the AnnotationBeanConfigurerAspect is on the classpath
338 (i.e. spring-aspects.jar), effectively activating "spring-configured" by default.
340 See Javadoc for org.springframework.context.annotation.EnableLoadTimeWeaving
341 for information on code-based alternatives to bootstrapping load-time weaving support.
342 ]]></xsd:documentation>
346 type="org.springframework.instrument.classloading.LoadTimeWeaver" />
351 <xsd:attribute name="weaver-class" type="xsd:string">
353 <xsd:documentation><![CDATA[
354 The fully-qualified classname of the LoadTimeWeaver that is to be activated.
355 ]]></xsd:documentation>
358 <tool:expected-type type="java.lang.Class" />
360 type="org.springframework.instrument.classloading.LoadTimeWeaver" />
365 <xsd:attribute name="aspectj-weaving" default="autodetect">
367 <xsd:restriction base="xsd:string">
368 <xsd:enumeration value="on">
370 <xsd:documentation><![CDATA[
371 Switches Spring-based AspectJ load-time weaving on.
372 ]]></xsd:documentation>
375 <xsd:enumeration value="off">
377 <xsd:documentation><![CDATA[
378 Switches Spring-based AspectJ load-time weaving off.
379 ]]></xsd:documentation>
382 <xsd:enumeration value="autodetect">
384 <xsd:documentation><![CDATA[
385 Switches AspectJ load-time weaving on if a "META-INF/aop.xml" resource
386 is present in the classpath. If there is no such resource, then AspectJ
387 load-time weaving will be switched off.
388 ]]></xsd:documentation>
397 <xsd:element name="spring-configured">
400 source="java:org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect">
402 Signals the current application context to apply dependency injection
403 to non-managed classes that are instantiated outside of the Spring bean
404 factory (typically classes annotated with the @Configurable annotation).
405 ]]></xsd:documentation>
408 <xsd:restriction base="xsd:string" />
412 <xsd:element name="mbean-export">
415 source="java:org.springframework.jmx.export.annotation.AnnotationMBeanExporter"><![CDATA[
416 Activates default exporting of MBeans by detecting standard MBeans in the Spring
417 context as well as @ManagedResource annotations on Spring-defined beans.
419 The resulting MBeanExporter bean is defined under the name "mbeanExporter".
420 Alternatively, consider defining a custom AnnotationMBeanExporter bean explicitly.
421 ]]></xsd:documentation>
425 type="org.springframework.jmx.export.annotation.AnnotationMBeanExporter" />
430 <xsd:attribute name="default-domain" type="xsd:string">
432 <xsd:documentation><![CDATA[
433 The default domain to use when generating JMX ObjectNames.
434 ]]></xsd:documentation>
437 <xsd:attribute name="server" type="xsd:string">
439 <xsd:documentation><![CDATA[
440 The bean name of the MBeanServer to which MBeans should be exported.
441 Default is to use the platform's default MBeanServer (autodetecting
442 WebLogic 9+, WebSphere 5.1+ and the JDK 1.5+ platform MBeanServer).
443 ]]></xsd:documentation>
446 <xsd:attribute name="registration">
448 <xsd:documentation><![CDATA[
449 The registration behavior, indicating how to deal with existing MBeans
450 of the same name: fail with an exception, ignore and keep the existing
451 MBean, or replace the existing one with the new MBean.
453 Default is to fail with an exception.
454 ]]></xsd:documentation>
457 <xsd:restriction base="xsd:NMTOKEN">
458 <xsd:enumeration value="failOnExisting" />
459 <xsd:enumeration value="ignoreExisting" />
460 <xsd:enumeration value="replaceExisting" />
467 <xsd:element name="mbean-server">
470 source="java:org.springframework.jmx.support.MBeanServerFactoryBean"><![CDATA[
471 Exposes a default MBeanServer for the current platform.
472 Autodetects WebLogic 9+, WebSphere 6.1+ and the JDK 1.5+ platform MBeanServer.
474 The default bean name for the exposed MBeanServer is "mbeanServer".
475 This may be customized through specifying the "id" attribute.
476 ]]></xsd:documentation>
479 <tool:exports type="javax.management.MBeanServer" />
485 <xsd:extension base="beans:identifiedType">
486 <xsd:attribute name="agent-id" type="xsd:string">
488 <xsd:documentation><![CDATA[
489 The agent id of the target MBeanServer, if any.
490 ]]></xsd:documentation>
494 </xsd:complexContent>
498 <xsd:complexType name="filterType">
499 <xsd:attribute name="type" use="required">
501 <xsd:documentation><![CDATA[
502 Controls the type of filtering to apply to the expression.
504 "annotation" indicates an annotation to be present at the type level in target components;
505 "assignable" indicates a class (or interface) that the target components are assignable to (extend/implement);
506 "aspectj" indicates an AspectJ type expression to be matched by the target components;
507 "regex" indicates a regex expression to be matched by the target components' class names;
508 "custom" indicates a custom implementation of the org.springframework.core.type.TypeFilter interface.
510 Note: This attribute will not be inherited by child bean definitions.
511 Hence, it needs to be specified per concrete bean definition.
512 ]]></xsd:documentation>
515 <xsd:restriction base="xsd:string">
516 <xsd:enumeration value="annotation" />
517 <xsd:enumeration value="assignable" />
518 <xsd:enumeration value="aspectj" />
519 <xsd:enumeration value="regex" />
520 <xsd:enumeration value="custom" />
524 <xsd:attribute name="expression" type="xsd:string" use="required">
526 <xsd:documentation><![CDATA[
527 Indicates the filter expression, the type of which is indicated by "type".
528 ]]></xsd:documentation>