|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Target(value={METHOD,TYPE})
@Retention(value=RUNTIME)
@InterceptorBinding
public @interface CacheResult
When a method annotated with CacheResult is invoked a CacheKey will be generated and
Cache.get(Object) is called before the invoked method actually executes. If a value is found in the
cache it is returned and the annotated method is never actually executed. If no value is found the
annotated method is invoked and the returned value is stored in the cache with the generated key.
| Optional Element Summary | |
|---|---|
Class<? extends CacheKeyGenerator> |
cacheKeyGenerator
(Optional) The CacheKeyGenerator to use to generate the cache key used to call Cache.get(Object)
Cache.put(Object, Object)
Defaults to CacheKeyGenerator |
String |
cacheName
(Optional) name of the cache. |
Class<? extends CacheResolver> |
cacheResolver
(Optional) The CacheResolver to use to find the Cache the intercepter will interact with. |
boolean |
skipGet
(Optional) If set to true the pre-invocation get is skipped and the annotated method is always executed with the returned value being cached as normal. |
public abstract String cacheName
public abstract boolean skipGet
public abstract Class<? extends CacheResolver> cacheResolver
CacheResolver to use to find the Cache the intercepter will interact with.
Defaults to resolving the cache by name from the default CacheManager
public abstract Class<? extends CacheKeyGenerator> cacheKeyGenerator
CacheKeyGenerator to use to generate the cache key used to call Cache.get(Object)
Cache.put(Object, Object)
Defaults to CacheKeyGenerator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||