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 Elements
    Modifier and Type
    Optional Element
    Description
    The cache name.
    This regular expressions is used to match the method names that should be excluded, i.e. the results should not be cached.
    The generator is used for all cached business methods.
    long
    The timeout is used for all cached business methods.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Constant value for cacheName() indicating that the name should be derived for each relevant business method.
  • Field Details

    • DEFAULT

      static final String DEFAULT
      Constant value for cacheName() 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 cacheName
      The cache name.

      By default, the cache name is derived for each business method.

      See Also:
      Default:
      "<<default>>"
    • lockTimeout

      long lockTimeout
      The timeout is used for all cached business methods.
      See Also:
      Default:
      0L
    • keyGenerator

      Class<? extends CacheKeyGenerator> keyGenerator
      The generator is used for all cached business methods.
      See Also:
      Default:
      io.quarkus.cache.runtime.UndefinedCacheKeyGenerator.class
    • exclude

      String exclude
      This regular expressions is used to match the method names that should be excluded, i.e. the results should not be cached.
      Default:
      ""