Annotation Interface Cache


@Target(METHOD) @Retention(RUNTIME) public @interface Cache
When annotated on a zero argument public/protected/package-private method in a Guice-constructed object this annotation will automatically cache the result of the method
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The name of the (global) cache that will be used (if not specified a global cache name based on the fully qualified class/method name will be used)
    long
    The time after which cached results will have been considered stale and in need of a refresh
  • Element Details

    • timeout

      long timeout
      The time after which cached results will have been considered stale and in need of a refresh
      Returns:
      Default:
      60000L
    • name

      String name
      The name of the (global) cache that will be used (if not specified a global cache name based on the fully qualified class/method name will be used)
      Returns:
      Default:
      ""