Interface CacheStateConfigurer
-
- All Superinterfaces:
org.springframework.core.Ordered
public interface CacheStateConfigurer extends org.springframework.core.Ordered
Declaring beans contribute behavior to theCacheStateManager
. 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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default int
getOrder()
default boolean
isEnabled()
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 Detail
-
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 toCacheable.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 interfaceorg.springframework.core.Ordered
-
-