Class NamedCacheResolver
java.lang.Object
org.springframework.cache.interceptor.AbstractCacheResolver
org.springframework.cache.interceptor.NamedCacheResolver
- All Implemented Interfaces:
InitializingBean, CacheResolver
A
CacheResolver that forces the resolution to a configurable
collection of name(s) against a given CacheManager.- since:
- 4.1
- Author:
- stephane Nicoll
-
Constructor summary
ConstructorsConstructorDescription NamedCacheResolver(CacheManager cacheManager, string... cacheNames) -
Method summary
Modifier and TypeMethodDescriptionprotected @Nullable Collection<string> getCacheNames(CacheOperationInvocationContext<?> context) Provide the name of the cache(s) to resolve against the current cache manager.voidsetCacheNames(Collection<string> cacheNames) set the cache name(s) that this resolver should use.Methods inherited from class AbstractCacheResolver
afterPropertiesset, getCacheManager, resolveCaches, setCacheManager
-
Constructor Details
-
NamedCacheResolver
public NamedCacheResolver() -
NamedCacheResolver
-
-
Method Details
-
setCacheNames
set the cache name(s) that this resolver should use. -
getCacheNames
protected @Nullable Collection<string> getCacheNames(CacheOperationInvocationContext<?> context) Description copied from class: AbstractCacheResolverProvide the name of the cache(s) to resolve against the current cache manager.It is acceptable to return
nullto indicate that no cache could be resolved for this invocation.- specified by:
getCacheNames in class AbstractCacheResolver- Parameters:
context- the context of the particular invocation- Returns:
- the cache name(s) to resolve, or
nullif no cache should be resolved
-