Interface CacheKeyGenerator

All Known Implementing Classes:
UndefinedCacheKeyGenerator

public interface CacheKeyGenerator
Implement this interface to generate a cache key based on the cached method, its parameters or any data available from within the generator.

The class must either represent a CDI bean or declare a public no-args constructor. In case of CDI, there must be exactly one bean that has the class in its set of bean types, otherwise the build fails. The context associated with the scope of the bean must be active when the generate(Method, Object...) method is invoked. If the scope is Dependent then the bean instance is destroyed when the generate(Method, Object...) method completes.

  • Method Summary

    Modifier and Type
    Method
    Description
    generate(Method method, Object... methodParams)
    Generates a cache key.
  • Method Details

    • generate

      Object generate(Method method, Object... methodParams)
      Generates a cache key.
      Parameters:
      method - the cached method
      methodParams - the method parameters
      Returns:
      cache key