Package io.quarkus.cache
Annotation Interface CachedResults
@Experimental("This API is experimental and may change in the future")
@Qualifier
@Retention(RUNTIME)
@Target({TYPE,FIELD,PARAMETER})
public @interface CachedResults
This qualifier may be applied to injection points to instruct the container to inject a generated wrapper bean that
delegates method invocations to the original bean but the return values of selected business methods are cached.
By default, all non-void non-private non-static business methods declared on the injected class or its superclasses are
included. However, it is possible to exclude methods whose names match the regular expression defined by exclude().
The injected class must be either an interface or declare a no-args constructor.
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe cache name.This regular expressions is used to match the method names that should be excluded, i.e. the results should not be cached.Class<? extends CacheKeyGenerator> The generator is used for all cached business methods.longThe timeout is used for all cached business methods. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstant value forcacheName()indicating that the name should be derived for each relevant business method.
-
Field Details
-
DEFAULT
Constant value forcacheName()indicating that the name should be derived for each relevant business method.The name consist of the binary name of the declaring class, the method name, and binary names of all parameters.
- See Also:
-
-
Element Details
-
cacheName
String cacheNameThe cache name.By default, the cache name is derived for each business method.
- See Also:
- Default:
"<<default>>"
-
lockTimeout
long lockTimeoutThe timeout is used for all cached business methods.- See Also:
- Default:
0L
-
keyGenerator
Class<? extends CacheKeyGenerator> keyGeneratorThe generator is used for all cached business methods.- See Also:
- Default:
io.quarkus.cache.runtime.UndefinedCacheKeyGenerator.class
-
exclude
String excludeThis regular expressions is used to match the method names that should be excluded, i.e. the results should not be cached.- Default:
""
-