Custom cache annotations and AspectJ

This commit clarifies what should be done in order to use custom cache
annotations with AspectJ.

Issue: SPR-11503
This commit is contained in:
Stephane Nicoll 2014-08-04 17:26:01 +02:00
parent 3c72849ee4
commit d6b1cdc55f
1 changed files with 11 additions and 0 deletions

View File

@ -47844,6 +47844,17 @@ using the aspectj mode in this case.
[[cache-annotation-stereotype]] [[cache-annotation-stereotype]]
==== Using custom annotations ==== Using custom annotations
.Custom annotation and AspectJ
****
This feature only works out-of-the-box with the proxy-based approach but can be enabled
with a bit of extra effort using AspectJ.
The `spring-aspects` module defines an aspect for the standard annotations only. If you
have defined your own annotations, you also need to define an aspect for those. Check
`AnnotationCacheAspect` for an example.
****
The caching abstraction allows you to use your own annotations to identify what method The caching abstraction allows you to use your own annotations to identify what method
triggers cache population or eviction. This is quite handy as a template mechanism as it triggers cache population or eviction. This is quite handy as a template mechanism as it
eliminates the need to duplicate cache annotation declarations (especially useful if the eliminates the need to duplicate cache annotation declarations (especially useful if the