Browse Source

Polishing

pull/934/head
Juergen Hoeller 9 years ago
parent
commit
76f84b914f
  1. 14
      spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java
  2. 17
      spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java
  3. 20
      spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java

14
spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java vendored

@ -26,8 +26,8 @@ import java.lang.annotation.Target; @@ -26,8 +26,8 @@ import java.lang.annotation.Target;
import org.springframework.core.annotation.AliasFor;
/**
* Annotation indicating that a method (or all methods on a class) triggers
* a cache eviction operation.
* Annotation indicating that a method (or all methods on a class) triggers a
* {@link org.springframework.cache.Cache#evict(Object) cache evict} operation.
*
* @author Costin Leau
* @author Stephane Nicoll
@ -60,8 +60,8 @@ public @interface CacheEvict { @@ -60,8 +60,8 @@ public @interface CacheEvict {
/**
* Spring Expression Language (SpEL) expression for computing the key dynamically.
* <p>Default is {@code ""}, meaning all method parameters are considered as a key, unless
* a custom {@link #keyGenerator} has been set.
* <p>Default is {@code ""}, meaning all method parameters are considered as a key,
* unless a custom {@link #keyGenerator} has been set.
* <p>The SpEL expression evaluates again a dedicated context that provides the
* following meta-data:
* <ul>
@ -80,7 +80,8 @@ public @interface CacheEvict { @@ -80,7 +80,8 @@ public @interface CacheEvict {
String key() default "";
/**
* The bean name of the custom {@link org.springframework.cache.interceptor.KeyGenerator} to use.
* The bean name of the custom {@link org.springframework.cache.interceptor.KeyGenerator}
* to use.
* <p>Mutually exclusive with the {@link #key} attribute.
* @see CacheConfig#keyGenerator
*/
@ -97,7 +98,8 @@ public @interface CacheEvict { @@ -97,7 +98,8 @@ public @interface CacheEvict {
String cacheManager() default "";
/**
* The bean name of the custom {@link org.springframework.cache.interceptor.CacheResolver} to use.
* The bean name of the custom {@link org.springframework.cache.interceptor.CacheResolver}
* to use.
* @see CacheConfig#cacheResolver
*/
String cacheResolver() default "";

17
spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java vendored

@ -23,16 +23,15 @@ import java.lang.annotation.Retention; @@ -23,16 +23,15 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.cache.Cache;
import org.springframework.core.annotation.AliasFor;
/**
* Annotation indicating that a method (or all methods on a class) triggers
* a {@linkplain Cache#put(Object, Object) cache put} operation.
* Annotation indicating that a method (or all methods on a class) triggers a
* {@link org.springframework.cache.Cache#put(Object, Object) cache put} operation.
*
* <p>In contrast to the {@link Cacheable @Cacheable} annotation, this annotation
* does not cause the advised method to be skipped. Rather, it always causes the
* method to be invoked and its result to be stored in a cache.
* method to be invoked and its result to be stored in the associated cache.
*
* @author Costin Leau
* @author Phillip Webb
@ -66,8 +65,8 @@ public @interface CachePut { @@ -66,8 +65,8 @@ public @interface CachePut {
/**
* Spring Expression Language (SpEL) expression for computing the key dynamically.
* <p>Default is {@code ""}, meaning all method parameters are considered as a key, unless
* a custom {@link #keyGenerator} has been set.
* <p>Default is {@code ""}, meaning all method parameters are considered as a key,
* unless a custom {@link #keyGenerator} has been set.
* <p>The SpEL expression evaluates again a dedicated context that provides the
* following meta-data:
* <ul>
@ -85,7 +84,8 @@ public @interface CachePut { @@ -85,7 +84,8 @@ public @interface CachePut {
String key() default "";
/**
* The bean name of the custom {@link org.springframework.cache.interceptor.KeyGenerator} to use.
* The bean name of the custom {@link org.springframework.cache.interceptor.KeyGenerator}
* to use.
* <p>Mutually exclusive with the {@link #key} attribute.
* @see CacheConfig#keyGenerator
*/
@ -102,7 +102,8 @@ public @interface CachePut { @@ -102,7 +102,8 @@ public @interface CachePut {
String cacheManager() default "";
/**
* The bean name of the custom {@link org.springframework.cache.interceptor.CacheResolver} to use.
* The bean name of the custom {@link org.springframework.cache.interceptor.CacheResolver}
* to use.
* @see CacheConfig#cacheResolver
*/
String cacheResolver() default "";

20
spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java vendored

@ -30,14 +30,14 @@ import org.springframework.core.annotation.AliasFor; @@ -30,14 +30,14 @@ import org.springframework.core.annotation.AliasFor;
* in a class) can be cached.
*
* <p>Each time an advised method is invoked, caching behavior will be applied,
* checking whether the method has been already invoked for the given arguments. A
* sensible default simply uses the method parameters to compute the key, but a SpEL
* expression can be provided via the {@link #key} attribute, or a custom
* {@link org.springframework.cache.interceptor.KeyGenerator KeyGenerator} implementation
* can replace the default one (see {@link #keyGenerator}).
* checking whether the method has been already invoked for the given arguments.
* A sensible default simply uses the method parameters to compute the key, but
* a SpEL expression can be provided via the {@link #key} attribute, or a custom
* {@link org.springframework.cache.interceptor.KeyGenerator} implementation can
* replace the default one (see {@link #keyGenerator}).
*
* <p>If no value is found in the cache for the computed key, the method is invoked
* and the returned value is used as the cache value.
* <p>If no value is found in the cache for the computed key, the target method
* will be invoked and the returned value stored in the associated cache.
*
* @author Costin Leau
* @author Phillip Webb
@ -89,7 +89,8 @@ public @interface Cacheable { @@ -89,7 +89,8 @@ public @interface Cacheable {
String key() default "";
/**
* The bean name of the custom {@link org.springframework.cache.interceptor.KeyGenerator} to use.
* The bean name of the custom {@link org.springframework.cache.interceptor.KeyGenerator}
* to use.
* <p>Mutually exclusive with the {@link #key} attribute.
* @see CacheConfig#keyGenerator
*/
@ -106,7 +107,8 @@ public @interface Cacheable { @@ -106,7 +107,8 @@ public @interface Cacheable {
String cacheManager() default "";
/**
* The bean name of the custom {@link org.springframework.cache.interceptor.CacheResolver} to use.
* The bean name of the custom {@link org.springframework.cache.interceptor.CacheResolver}
* to use.
* @see CacheConfig#cacheResolver
*/
String cacheResolver() default "";

Loading…
Cancel
Save