Package io.micronaut.cache.annotation
Annotation Type CacheInvalidate
-
@Target({METHOD,TYPE}) @Retention(RUNTIME) @Inherited @Documented @CacheConfig @CacheAnnotation @Repeatable(InvalidateOperations.class) public @interface CacheInvalidate
An annotation that can be applied at the type or method level to indicate that the annotated operation should cause the eviction of the given caches.
- Since:
- 1.0
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
all
boolean
async
Whether the cache operation should be performed asynchronously and not block the returning value.java.lang.String[]
cacheNames
Alias forCacheConfig.cacheNames()
.java.lang.Class<? extends CacheKeyGenerator>
keyGenerator
Alias forCacheConfig.keyGenerator()
.java.lang.String[]
parameters
Limit the automaticCacheKeyGenerator
to the given parameter names.java.lang.String[]
value
Alias forCacheConfig.cacheNames()
.
-
-
-
Element Detail
-
value
@AliasFor(member="cacheNames") java.lang.String[] value
Alias forCacheConfig.cacheNames()
.- Returns:
- Cache names
- Default:
- {}
-
-
-
cacheNames
@AliasFor(annotation=CacheConfig.class, member="cacheNames") java.lang.String[] cacheNames
Alias forCacheConfig.cacheNames()
.- Returns:
- Cache names
- Default:
- {}
-
-
-
keyGenerator
@AliasFor(annotation=CacheConfig.class, member="keyGenerator") java.lang.Class<? extends CacheKeyGenerator> keyGenerator
Alias forCacheConfig.keyGenerator()
.- Returns:
- The key generator class
- Default:
- io.micronaut.cache.interceptor.DefaultCacheKeyGenerator.class
-
-
-
parameters
java.lang.String[] parameters
Limit the automaticCacheKeyGenerator
to the given parameter names. Mutually exclusive withkeyGenerator()
- Returns:
- The parameter names that make up the key.
- Default:
- {}
-
-
-
async
boolean async
Whether the cache operation should be performed asynchronously and not block the returning value. Note that when set totrue
then any cache errors will not be propagated back to the client and will simply be logged by default unless the return value itself is a non-blocking type such asCompletableFuture
.- Returns:
- True if should be done asynchronously
- Default:
- false
-
-