From ea09e578b9b276fa01c1e49c3676fa82386d9f76 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 29 Mar 2016 20:01:45 +0200 Subject: [PATCH] Document support for @Cache* as merged composed annotations Issue: SPR-13475 --- .../org/springframework/cache/annotation/CacheEvict.java | 5 ++++- .../java/org/springframework/cache/annotation/CachePut.java | 5 ++++- .../java/org/springframework/cache/annotation/Cacheable.java | 5 ++++- .../java/org/springframework/cache/annotation/Caching.java | 5 ++++- src/asciidoc/whats-new.adoc | 4 ++-- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java b/spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java index d00fbd0a03..f12d2119ad 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,9 @@ import org.springframework.core.annotation.AliasFor; * Annotation indicating that a method (or all methods on a class) triggers a * {@link org.springframework.cache.Cache#evict(Object) cache evict} operation. * + *

This annotation may be used as a meta-annotation to create custom + * composed annotations with attribute overrides. + * * @author Costin Leau * @author Stephane Nicoll * @author Sam Brannen diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java b/spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java index baf9934a67..cd48e41090 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,9 @@ import org.springframework.core.annotation.AliasFor; * 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 the associated cache. * + *

This annotation may be used as a meta-annotation to create custom + * composed annotations with attribute overrides. + * * @author Costin Leau * @author Phillip Webb * @author Stephane Nicoll diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java b/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java index c258fab647..225ada51eb 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,6 +40,9 @@ import org.springframework.core.annotation.AliasFor; *

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. * + *

This annotation may be used as a meta-annotation to create custom + * composed annotations with attribute overrides. + * * @author Costin Leau * @author Phillip Webb * @author Stephane Nicoll diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/Caching.java b/spring-context/src/main/java/org/springframework/cache/annotation/Caching.java index 6802fd5d96..08a4482f8f 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/Caching.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/Caching.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,9 @@ import java.lang.annotation.Target; /** * Group annotation for multiple cache annotations (of different or the same type). * + *

This annotation may be used as a meta-annotation to create custom + * composed annotations with attribute overrides. + * * @author Costin Leau * @author Chris Beams * @since 3.1 diff --git a/src/asciidoc/whats-new.adoc b/src/asciidoc/whats-new.adoc index 59513fab8a..15643ccb26 100644 --- a/src/asciidoc/whats-new.adoc +++ b/src/asciidoc/whats-new.adoc @@ -641,7 +641,6 @@ public @interface MyTestConfig { * `@Scheduled` and `@Schedules` may now be used as _meta-annotations_ to create custom _composed annotations_ with attribute overrides. - === Data Access Improvements * `jdbc:initialize-database` and `jdbc:embedded-database` support a configurable @@ -661,6 +660,8 @@ Spring 4.3 also improves the caching abstraction as follows: `@beanName.method()`). * `ConcurrentMapCacheManager` and `ConcurrentMapCache` now support the serialization of cache entries via a new `storeByValue` attribute. +* `@Cacheable`, `@CacheEvict`, `@CachePut`, and `@Caching` may now be used as + _meta-annotations_ to create custom _composed annotations_ with attribute overrides. === JMS Improvements @@ -706,4 +707,3 @@ Spring 4.3 also improves the caching abstraction as follows: * Client-side REST test support allows indicating how many times a request is expected and whether the order of declaration for expectations should be ignored (see <>). * Client-side REST Test supports expectations for form data in the request body. -