|
|
@ -23,16 +23,15 @@ import java.lang.annotation.Retention; |
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
import java.lang.annotation.Target; |
|
|
|
import java.lang.annotation.Target; |
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.cache.Cache; |
|
|
|
|
|
|
|
import org.springframework.core.annotation.AliasFor; |
|
|
|
import org.springframework.core.annotation.AliasFor; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Annotation indicating that a method (or all methods on a class) triggers |
|
|
|
* Annotation indicating that a method (or all methods on a class) triggers a |
|
|
|
* a {@linkplain Cache#put(Object, Object) cache put} operation. |
|
|
|
* {@link org.springframework.cache.Cache#put(Object, Object) cache put} operation. |
|
|
|
* |
|
|
|
* |
|
|
|
* <p>In contrast to the {@link Cacheable @Cacheable} annotation, this annotation |
|
|
|
* <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 |
|
|
|
* 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 Costin Leau |
|
|
|
* @author Phillip Webb |
|
|
|
* @author Phillip Webb |
|
|
@ -41,7 +40,7 @@ import org.springframework.core.annotation.AliasFor; |
|
|
|
* @since 3.1 |
|
|
|
* @since 3.1 |
|
|
|
* @see CacheConfig |
|
|
|
* @see CacheConfig |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Target({ ElementType.METHOD, ElementType.TYPE }) |
|
|
|
@Target({ElementType.METHOD, ElementType.TYPE}) |
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@Inherited |
|
|
|
@Inherited |
|
|
|
@Documented |
|
|
|
@Documented |
|
|
@ -66,8 +65,8 @@ public @interface CachePut { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Spring Expression Language (SpEL) expression for computing the key dynamically. |
|
|
|
* Spring Expression Language (SpEL) expression for computing the key dynamically. |
|
|
|
* <p>Default is {@code ""}, meaning all method parameters are considered as a key, unless |
|
|
|
* <p>Default is {@code ""}, meaning all method parameters are considered as a key, |
|
|
|
* a custom {@link #keyGenerator} has been set. |
|
|
|
* unless a custom {@link #keyGenerator} has been set. |
|
|
|
* <p>The SpEL expression evaluates again a dedicated context that provides the |
|
|
|
* <p>The SpEL expression evaluates again a dedicated context that provides the |
|
|
|
* following meta-data: |
|
|
|
* following meta-data: |
|
|
|
* <ul> |
|
|
|
* <ul> |
|
|
@ -85,7 +84,8 @@ public @interface CachePut { |
|
|
|
String key() default ""; |
|
|
|
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. |
|
|
|
* <p>Mutually exclusive with the {@link #key} attribute. |
|
|
|
* @see CacheConfig#keyGenerator |
|
|
|
* @see CacheConfig#keyGenerator |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -102,7 +102,8 @@ public @interface CachePut { |
|
|
|
String cacheManager() default ""; |
|
|
|
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 |
|
|
|
* @see CacheConfig#cacheResolver |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
String cacheResolver() default ""; |
|
|
|
String cacheResolver() default ""; |
|
|
|