1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
3 <xsd:schema xmlns="http://www.springframework.org/schema/cache"
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/cache"
8 elementFormDefault="qualified"
9 attributeFormDefault="unqualified">
11 <xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"/>
12 <xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.1.xsd"/>
15 <xsd:documentation><![CDATA[
16 Defines the elements used in the Spring Framework's declarative
17 cache management infrastructure.
18 ]]></xsd:documentation>
21 <xsd:element name="annotation-driven">
24 <xsd:documentation source="java:org.springframework.cache.annotation.AnnotationCacheOperationDefinitionSource"><![CDATA[
25 Indicates that cache configuration is defined by Java 5
26 annotations on bean classes, and that proxies are automatically
27 to be created for the relevant annotated beans.
29 The default annotations supported are Spring's @Cacheable and @CacheEvict.
31 See org.springframework.cache.annotation.EnableCaching Javadoc
32 for information on code-based alternatives to this XML element.
33 ]]></xsd:documentation>
35 <xsd:attribute name="cache-manager" type="xsd:string" default="cacheManager">
37 <xsd:documentation source="java:org.springframework.cache.CacheManager"><![CDATA[
38 The bean name of the CacheManager that is to be used to retrieve the backing caches.
40 This attribute is not required, and only needs to be specified
41 explicitly if the bean name of the desired CacheManager
42 is not 'cacheManager'.
43 ]]></xsd:documentation>
45 <tool:annotation kind="ref">
46 <tool:expected-type type="org.springframework.cache.CacheManager"/>
51 <xsd:attribute name="key-generator" type="xsd:string">
53 <xsd:documentation source="java:org.springframework.cache.interceptor.KeyGenerator"><![CDATA[
54 The bean name of the KeyGenerator that is to be used to retrieve the backing caches.
56 This attribute is not required, and only needs to be specified
57 explicitly if the default strategy (DefaultKeyGenerator) is not sufficient.
58 ]]></xsd:documentation>
60 <tool:annotation kind="ref">
61 <tool:expected-type type="org.springframework.cache.interceptor.KeyGenerator"/>
66 <xsd:attribute name="mode" default="proxy">
68 <xsd:documentation><![CDATA[
69 Should annotated beans be proxied using Spring's AOP framework,
70 or should they rather be weaved with an AspectJ transaction aspect?
72 AspectJ weaving requires spring-aspects.jar on the classpath,
73 as well as load-time weaving (or compile-time weaving) enabled.
75 Note: The weaving-based aspect requires the @Cacheable and @CacheInvalidate
76 annotations to be defined on the concrete class. Annotations in interfaces
77 will not work in that case (they will rather only work with interface-based proxies)!
78 ]]></xsd:documentation>
81 <xsd:restriction base="xsd:string">
82 <xsd:enumeration value="proxy"/>
83 <xsd:enumeration value="aspectj"/>
87 <xsd:attribute name="proxy-target-class" type="xsd:boolean" default="false">
89 <xsd:documentation><![CDATA[
90 Are class-based (CGLIB) proxies to be created? By default, standard
91 Java interface-based proxies are created.
93 Note: Class-based proxies require the @Cacheable and @CacheInvalidate annotations
94 to be defined on the concrete class. Annotations in interfaces will not work
95 in that case (they will rather only work with interface-based proxies)!
96 ]]></xsd:documentation>
99 <xsd:attribute name="order" type="xsd:int">
101 <xsd:documentation source="java:org.springframework.core.Ordered"><![CDATA[
102 Controls the ordering of the execution of the cache advisor
103 when multiple advice executes at a specific joinpoint.
104 ]]></xsd:documentation>
110 <xsd:element name="advice">
113 <xsd:documentation source="java:org.springframework.cache.interceptor.CacheInterceptor"><![CDATA[
114 Defines the cache semantics of the AOP advice that is to be
117 That is, this advice element is where the cacheable semantics of
118 any number of methods are defined (where cacheable semantics
119 includes the backing cache(s), the key, cache condition rules, and suchlike).
120 ]]></xsd:documentation>
123 <tool:exports type="java:org.springframework.cache.interceptor.CacheInterceptor"/>
128 <xsd:extension base="beans:identifiedType">
130 <xsd:element name="caching" type="definitionsType" minOccurs="0" maxOccurs="unbounded"/>
132 <xsd:attribute name="cache-manager" type="xsd:string" default="cacheManager">
134 <xsd:documentation source="java:org.springframework.cache.CacheManager"><![CDATA[
135 The bean name of the CacheManager that is to be used
136 for storing and retrieving data.
138 This attribute is not required, and only needs to be specified
139 explicitly if the bean name of the desired CacheManager
140 is not 'cacheManager'.
141 ]]></xsd:documentation>
143 <tool:annotation kind="ref">
144 <tool:expected-type type="org.springframework.cache.CacheManager"/>
149 <xsd:attribute name="key-generator" type="xsd:string">
151 <xsd:documentation source="java:org.springframework.cache.interceptor.KeyGenerator"><![CDATA[
152 The bean name of the KeyGenerator that is to be used to retrieve the backing caches.
154 This attribute is not required, and only needs to be specified
155 explicitly if the default strategy (DefaultKeyGenerator) is not sufficient.
156 ]]></xsd:documentation>
158 <tool:annotation kind="ref">
159 <tool:expected-type type="org.springframework.cache.interceptor.KeyGenerator"/>
165 </xsd:complexContent>
169 <xsd:complexType name="basedefinitionType">
170 <xsd:attribute name="cache" type="xsd:string" use="optional">
172 <xsd:documentation><![CDATA[
173 The name of the backing cache(s). Multiple caches can be specified by separating them using comma: 'orders, books']]></xsd:documentation>
176 <xsd:attribute name="key" type="xsd:string" use="optional">
178 <xsd:documentation><![CDATA[
179 The SpEL expression used for computing the cache key.]]></xsd:documentation>
182 <xsd:attribute name="condition" type="xsd:string" use="optional">
184 <xsd:documentation><![CDATA[
185 The SpEL expression used for conditioning the method caching.]]></xsd:documentation>
188 <xsd:attribute name="method" type="xsd:string" use="optional">
190 <xsd:documentation><![CDATA[
191 The method name(s) with which the cache attributes are to be
192 associated. The wildcard (*) character can be used to associate the
193 same cache attribute settings with a number of methods; for
194 example, 'get*', 'handle*', '*Order', 'on*Event', etc.]]></xsd:documentation>
200 <xsd:complexType name="definitionsType">
202 <xsd:extension base="basedefinitionType">
204 <xsd:choice minOccurs="0" maxOccurs="unbounded">
205 <xsd:element name="cacheable" minOccurs="0" maxOccurs="unbounded" type="basedefinitionType"/>
206 <xsd:element name="cache-put" minOccurs="0" maxOccurs="unbounded" type="basedefinitionType"/>
207 <xsd:element name="cache-evict" minOccurs="0" maxOccurs="unbounded">
210 <xsd:extension base="basedefinitionType">
211 <xsd:attribute name="all-entries" type="xsd:boolean" use="optional">
213 <xsd:documentation><![CDATA[
214 Whether all the entries should be evicted.]]></xsd:documentation>
217 <xsd:attribute name="before-invocation" type="xsd:boolean" use="optional">
219 <xsd:documentation><![CDATA[
220 Whether the eviction should occur after the method is successfully
221 invoked (default) or before.]]></xsd:documentation>
226 </xsd:complexContent>
232 </xsd:complexContent>