1 <?xml version="1.0" encoding="UTF-8"?>
3 <xsd:schema xmlns="http://www.springframework.org/schema/context" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
4 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" elementFormDefault="qualified"
7 attributeFormDefault="unqualified">
9 <xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"/>
10 <xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-2.5.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:element name="property-placeholder">
22 <xsd:documentation><![CDATA[
23 Activates replacement of ${...} placeholders, resolved against the specified properties file or
24 Properties object (if any). Falls back to resolving placeholders against JVM system properties.
25 Alternatively, define a parameterized PropertyPlaceholderConfigurer bean in the context.
26 ]]></xsd:documentation>
29 <tool:exports type="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
34 <xsd:attribute name="location" type="xsd:string">
36 <xsd:documentation><![CDATA[
37 The location of the properties file to resolve placeholders against, as a Spring
38 resource location: a URL, a "classpath:" pseudo URL, or a relative file path.
39 Multiple locations may be specified, separated by commas. If neither location nor properties-ref is
40 specified, placeholders will be resolved against system properties.
41 ]]></xsd:documentation>
44 <xsd:attribute name="properties-ref" type="xsd:string">
46 <xsd:documentation source="java:java.util.Properties"><![CDATA[
47 The bean name of a Java Properties object that will be used for property substitution.
48 If neither location nor properties-ref is specified, placeholders will be resolved against system properties.
49 ]]></xsd:documentation>
55 <xsd:element name="property-override">
57 <xsd:documentation><![CDATA[
58 Activates pushing of override values into bean properties, based on configuration
59 lines of the following format: beanName.property=value
60 ]]></xsd:documentation>
63 <tool:exports type="org.springframework.beans.factory.config.PropertyOverrideConfigurer"/>
68 <xsd:attribute name="location" type="xsd:string">
70 <xsd:documentation><![CDATA[
71 The location of the properties file to read property overrides from, as a Spring
72 resource location: a URL, a "classpath:" pseudo URL, or a relative file path.
73 Multiple locations may be specified, separated by commas.
74 ]]></xsd:documentation>
77 <xsd:attribute name="properties-ref" type="xsd:string">
79 <xsd:documentation source="java:java.util.Properties"><![CDATA[
80 The bean name of a Java Properties object that will be used for property overrides.
81 ]]></xsd:documentation>
87 <xsd:element name="annotation-config">
89 <xsd:documentation><![CDATA[
90 Activates various annotations to be detected in bean classes: Spring's @Required and
91 @Autowired, as well as JSR 250's @PostConstruct, @PreDestroy and @Resource (if available),
92 JAX-WS's @WebServiceRef (if available), EJB3's @EJB (if available), and JPA's
93 @PersistenceContext and @PersistenceUnit (if available). Alternatively, you may
94 choose to activate the individual BeanPostProcessors for those annotations.
96 Note: This tag does not activate processing of Spring's @Transactional or EJB3's
97 @TransactionAttribute annotation. Consider the use of the <tx:annotation-driven>
99 ]]></xsd:documentation>
103 <xsd:element name="component-scan">
105 <xsd:documentation><![CDATA[
106 Scans the classpath for annotated components that will be auto-registered as
107 Spring beans. By default, the Spring-provided @Component, @Repository,
108 @Service, and @Controller stereotypes will be detected.
110 Note: This tag implies the effects of the 'annotation-config' tag, activating @Required,
111 @Autowired, @PostConstruct, @PreDestroy, @Resource, @PersistenceContext and @PersistenceUnit
112 annotations in the component classes, which is usually desired for autodetected components
113 (without external configuration). Turn off the 'annotation-config' attribute to deactivate
114 this default behavior, for example in order to use custom BeanPostProcessor definitions
115 for handling those annotations.
117 Note: You may use placeholders in package paths, but only resolved against system
118 properties (analogous to resource paths). A component scan results in new bean definition
119 being registered; Spring's PropertyPlaceholderConfigurer will apply to those bean
120 definitions just like to regular bean definitions, but it won't apply to the component
121 scan settings themselves.
122 ]]></xsd:documentation>
126 <xsd:element name="include-filter" type="filterType" minOccurs="0" maxOccurs="unbounded">
128 <xsd:documentation><![CDATA[
129 Controls which eligible types to include for component scanning.
130 ]]></xsd:documentation>
133 <xsd:element name="exclude-filter" type="filterType" minOccurs="0" maxOccurs="unbounded">
135 <xsd:documentation><![CDATA[
136 Controls which eligible types to exclude for component scanning.
137 ]]></xsd:documentation>
141 <xsd:attribute name="base-package" type="xsd:string" use="required">
143 <xsd:documentation><![CDATA[
144 The comma-separated list of packages to scan for annotated components.
145 ]]></xsd:documentation>
148 <xsd:attribute name="resource-pattern" type="xsd:string">
150 <xsd:documentation><![CDATA[
151 Controls the class files eligible for component detection. Defaults to "**/*.class", the recommended value.
152 ]]></xsd:documentation>
155 <xsd:attribute name="use-default-filters" type="xsd:boolean" default="true">
157 <xsd:documentation><![CDATA[
158 Indicates whether automatic detection of classes annotated with @Component, @Repository, @Service,
159 or @Controller should be enabled. Default is "true".
160 ]]></xsd:documentation>
163 <xsd:attribute name="annotation-config" type="xsd:boolean" default="true">
165 <xsd:documentation><![CDATA[
166 Indicates whether the implicit annotation post-processors should be enabled. Default is "true".
167 ]]></xsd:documentation>
170 <xsd:attribute name="name-generator" type="xsd:string">
172 <xsd:documentation><![CDATA[
173 The fully-qualified class name of the BeanNameGenerator to be used for naming detected components.
174 ]]></xsd:documentation>
177 <tool:expected-type type="java.lang.Class"/>
178 <tool:assignable-to type="org.springframework.beans.factory.support.BeanNameGenerator"/>
183 <xsd:attribute name="scope-resolver" type="xsd:string">
185 <xsd:documentation><![CDATA[
186 The fully-qualified class name of the ScopeMetadataResolver to be used for resolving the scope of
188 ]]></xsd:documentation>
191 <tool:expected-type type="java.lang.Class"/>
192 <tool:assignable-to type="org.springframework.context.annotation.ScopeMetadataResolver"/>
197 <xsd:attribute name="scoped-proxy">
199 <xsd:documentation><![CDATA[
200 Indicates whether proxies should be generated for detected components, which may be necessary
201 when using scopes in a proxy-style fashion. Default is to generate no such proxies.
202 ]]></xsd:documentation>
205 <xsd:restriction base="xsd:string">
206 <xsd:enumeration value="no"/>
207 <xsd:enumeration value="interfaces"/>
208 <xsd:enumeration value="targetClass"/>
215 <xsd:element name="load-time-weaver">
217 <xsd:documentation><![CDATA[
218 Activates a Spring LoadTimeWeaver for this application context, available as
219 a bean with the name "loadTimeWeaver". Any bean that implements the
220 LoadTimeWeaverAware interface will then receive the LoadTimeWeaver reference
221 automatically; for example, Spring's JPA bootstrap support.
223 The default weaver is determined automatically. As of Spring 2.5: detecting
224 Sun's GlassFish, Oracle's OC4J, Spring's VM agent and any ClassLoader
225 supported by Spring's ReflectiveLoadTimeWeaver (for example, the
226 TomcatInstrumentableClassLoader).
228 The activation of AspectJ load-time weaving is specified via a simple flag
229 (the 'aspectj-weaving' attribute), with the AspectJ class transformer
230 registered through Spring's LoadTimeWeaver. AspectJ weaving will be activated
231 by default if a "META-INF/aop.xml" resource is present in the classpath.
233 This also activates the current application context for applying dependency
234 injection to non-managed classes that are instantiated outside of the Spring
235 bean factory (typically classes annotated with the @Configurable annotation).
236 This will only happen if the AnnotationBeanConfigurerAspect is on the classpath
237 (i.e. spring-aspects.jar), effectively activating "spring-configured" by default.
238 ]]></xsd:documentation>
241 <tool:exports type="org.springframework.instrument.classloading.LoadTimeWeaver"/>
246 <xsd:attribute name="weaver-class" type="xsd:string">
248 <xsd:documentation><![CDATA[
249 The fully-qualified classname of the LoadTimeWeaver that is to be activated.
250 ]]></xsd:documentation>
253 <tool:expected-type type="java.lang.Class"/>
254 <tool:assignable-to type="org.springframework.instrument.classloading.LoadTimeWeaver"/>
259 <xsd:attribute name="aspectj-weaving" default="autodetect">
261 <xsd:restriction base="xsd:string">
262 <xsd:enumeration value="on">
264 <xsd:documentation><![CDATA[
265 Switches Spring-based AspectJ load-time weaving on.
266 ]]></xsd:documentation>
269 <xsd:enumeration value="off">
271 <xsd:documentation><![CDATA[
272 Switches Spring-based AspectJ load-time weaving off.
273 ]]></xsd:documentation>
276 <xsd:enumeration value="autodetect">
278 <xsd:documentation><![CDATA[
279 Switches AspectJ load-time weaving on if a "META-INF/aop.xml" resource
280 is present in the classpath. If there is no such resource, then AspectJ
281 load-time weaving will be switched off.
282 ]]></xsd:documentation>
291 <xsd:element name="spring-configured">
293 <xsd:documentation source="java:org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect">
295 Signals the current application context to apply dependency injection
296 to non-managed classes that are instantiated outside of the Spring bean
297 factory (typically classes annotated with the @Configurable annotation).
298 ]]></xsd:documentation>
301 <xsd:restriction base="xsd:string"/>
305 <xsd:element name="mbean-export">
307 <xsd:documentation source="java:org.springframework.jmx.export.annotation.AnnotationMBeanExporter"><![CDATA[
308 Activates default exporting of MBeans by detecting standard MBeans in the Spring
309 context as well as @ManagedResource annotations on Spring-defined beans.
311 The resulting MBeanExporter bean is defined under the name "mbeanExporter".
312 Alternatively, consider defining a custom AnnotationMBeanExporter bean explicitly.
313 ]]></xsd:documentation>
316 <tool:exports type="org.springframework.jmx.export.annotation.AnnotationMBeanExporter"/>
321 <xsd:attribute name="default-domain" type="xsd:string">
323 <xsd:documentation><![CDATA[
324 The default domain to use when generating JMX ObjectNames.
325 ]]></xsd:documentation>
328 <xsd:attribute name="server" type="xsd:string">
330 <xsd:documentation><![CDATA[
331 The bean name of the MBeanServer to which MBeans should be exported.
332 Default is to use the platform's default MBeanServer (autodetecting
333 WebLogic 9+, WebSphere 5.1+ and the JDK 1.5+ platform MBeanServer).
334 ]]></xsd:documentation>
337 <xsd:attribute name="registration">
339 <xsd:documentation><![CDATA[
340 The registration behavior, indicating how to deal with existing MBeans
341 of the same name: fail with an exception, ignore and keep the existing
342 MBean, or replace the existing one with the new MBean.
344 Default is to fail with an exception.
345 ]]></xsd:documentation>
348 <xsd:restriction base="xsd:NMTOKEN">
349 <xsd:enumeration value="failOnExisting"/>
350 <xsd:enumeration value="ignoreExisting"/>
351 <xsd:enumeration value="replaceExisting"/>
358 <xsd:element name="mbean-server">
360 <xsd:documentation source="java:org.springframework.jmx.support.MBeanServerFactoryBean"><![CDATA[
361 Exposes a default MBeanServer for the current platform.
362 Autodetects WebLogic 9+, WebSphere 5.1+ and the JDK 1.5+ platform MBeanServer.
364 The default bean name for the exposed MBeanServer is "mbeanServer".
365 This may be customized through specifying the "id" attribute.
366 ]]></xsd:documentation>
369 <tool:exports type="javax.management.MBeanServer"/>
375 <xsd:extension base="beans:identifiedType">
376 <xsd:attribute name="agent-id" type="xsd:string">
378 <xsd:documentation><![CDATA[
379 The agent id of the target MBeanServer, if any.
380 ]]></xsd:documentation>
384 </xsd:complexContent>
388 <xsd:complexType name="filterType">
389 <xsd:attribute name="type" use="required">
391 <xsd:documentation><![CDATA[
392 Controls the type of filtering to apply to the expression.
394 "annotation" indicates an annotation to be present at the type level in target components;
395 "assignable" indicates a class (or interface) that the target components are assignable to (extend/implement);
396 "aspectj" indicates an AspectJ type expression to be matched by the target components;
397 "regex" indicates a regex expression to be matched by the target components' class names;
398 "custom" indicates a custom implementation of the org.springframework.core.type.TypeFilter interface.
400 Note: This attribute will not be inherited by child bean definitions.
401 Hence, it needs to be specified per concrete bean definition.
402 ]]></xsd:documentation>
405 <xsd:restriction base="xsd:string">
406 <xsd:enumeration value="annotation"/>
407 <xsd:enumeration value="assignable"/>
408 <xsd:enumeration value="aspectj"/>
409 <xsd:enumeration value="regex"/>
410 <xsd:enumeration value="custom"/>
414 <xsd:attribute name="expression" type="xsd:string" use="required">
416 <xsd:documentation><![CDATA[
417 Indicates the filter expression, the type of which is indicated by "type".
418 ]]></xsd:documentation>