Interface CacheStateConfigurer

All Superinterfaces:
org.springframework.core.Ordered

public interface CacheStateConfigurer extends org.springframework.core.Ordered
Declaring beans contribute behavior to the CacheStateManager. Provides a vehicle for enabling/disabling cache at a granular, cache-by-cache level based on robust information about the candidate cached calling method. This allows for override of caches declared in Broadleaf with programmatic access to calling information. Furthermore, more advanced logic can disable cache per-call so that some calls are cached, while others are not. Finally, CacheStateConfigurer instances are evaluated in an ordered fashion, with the highest precedence match winning.
Author:
Jeff Fischer
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
     
    default boolean
    Whether or not the cache should be enabled for this call.
    default boolean
    isEnabled(Object... params)
    Whether or not the cache should be enabled for this call.
    boolean
    isFor(List<String> cacheNames)
    Evaluate if the configurer is a match for the passed caches.
  • Method Details

    • isFor

      boolean isFor(List<String> cacheNames)
      Evaluate if the configurer is a match for the passed caches.
      Parameters:
      cacheNames - The names of the caches being evaluated for this call. Relates to Cacheable.cacheNames().
      Returns:
      whether or not this configurer is a match.
    • isEnabled

      default boolean isEnabled()
      Whether or not the cache should be enabled for this call.
      Returns:
      Whether or not the cache should be enabled for this call.
    • isEnabled

      default boolean isEnabled(Object... params)
      Whether or not the cache should be enabled for this call.
      Parameters:
      params - The params passed to that method.
      Returns:
      Whether or not the cache should be enabled for this call.
    • getOrder

      default int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered