Class SimpleCacheResolver
- java.lang.Object
- org.springframework.cache.interceptor.AbstractCacheResolver
- org.springframework.cache.interceptor.SimpleCacheResolver
- All Implemented Interfaces:
InitializingBean,CacheResolver
public class SimpleCacheResolver extends AbstractCacheResolver
A simpleCacheResolverthat resolves theCacheinstance(s) based on a configurableCacheManagerand the name of the cache(s) as provided bygetCacheNames().- Since:
- 4.1
- Author:
- Stephane Nicoll, Juergen Hoeller
- See Also:
BasicOperation.getCacheNames()
Constructor Summary
Constructors Constructor Description SimpleCacheResolver()Construct a newSimpleCacheResolver.SimpleCacheResolver(CacheManager cacheManager)Construct a newSimpleCacheResolverfor the givenCacheManager.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Collection<String>getCacheNames(CacheOperationInvocationContext<?> context)Provide the name of the cache(s) to resolve against the current cache manager.Methods inherited from class org.springframework.cache.interceptor.AbstractCacheResolver
afterPropertiesSet, getCacheManager, resolveCaches, setCacheManager
Constructor Detail
SimpleCacheResolver
public SimpleCacheResolver()
Construct a newSimpleCacheResolver.
SimpleCacheResolver
public SimpleCacheResolver(CacheManager cacheManager)
Construct a newSimpleCacheResolverfor the givenCacheManager.- Parameters:
cacheManager- the CacheManager to use
Method Detail
getCacheNames
protected 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:
getCacheNamesin classAbstractCacheResolver- Parameters:
context- the context of the particular invocation- Returns:
- the cache name(s) to resolve, or
nullif no cache should be resolved