@Target(value={METHOD,TYPE}) @Retention(value=RUNTIME) @Inherited @Documented @CacheConfig @Type(value=CacheInterceptor.class) @Repeatable(value=PutOperations.class) public @interface CachePut
An annotation that can be applied at the type or method level to indicate that the annotated operation should
cause the return value to be cached within the given cache name. Unlike Cacheable
this annotation will never
skip the original invocation.
Modifier and Type | Optional Element and Description |
---|---|
boolean |
async
Whether the
CachePut operation should be performed asynchronously and not block the returning value |
String[] |
cacheNames
Alias for
CacheConfig.cacheNames() . |
Class<? extends CacheKeyGenerator> |
keyGenerator
Alias for
CacheConfig.keyGenerator() . |
String[] |
parameters
Limit the automatic
CacheKeyGenerator to the given parameter names. |
String[] |
value
Alias for
CacheConfig.cacheNames() . |
@AliasFor(member="cacheNames") public abstract String[] value
CacheConfig.cacheNames()
.@AliasFor(annotation=CacheConfig.class, member="cacheNames") public abstract String[] cacheNames
CacheConfig.cacheNames()
.@AliasFor(annotation=CacheConfig.class, member="keyGenerator") public abstract Class<? extends CacheKeyGenerator> keyGenerator
CacheConfig.keyGenerator()
.public abstract String[] parameters
CacheKeyGenerator
to the given parameter names. Mutually exclusive with
keyGenerator()
public abstract boolean async
Whether the CachePut
operation should be performed asynchronously and not block the returning value
The value if async impacts behaviour in the following ways:
AsyncCacheErrorHandler
.CompletableFuture
and the value is false
the future will not complete until the CachePut
operation is complete.CompletableFuture
and the value is true
the future will complete prior to any CachePut
operations completing and the operations will be
executing asynchronously with errors logged by AsyncCacheErrorHandler
.