类 AbstractCacheResolver
- java.lang.Object
- org.springframework.cache.interceptor.AbstractCacheResolver
- 所有已实现的接口:
InitializingBean,CacheResolver
public abstract class AbstractCacheResolver extends Object implements CacheResolver, InitializingBean
A baseCacheResolverimplementation that requires the concrete implementation to provide the collection of cache name(s) based on the invocation context.- 从以下版本开始:
- 4.1
- 作者:
- Stephane Nicoll, Juergen Hoeller
构造器概要
构造器 限定符 构造器 说明 protectedAbstractCacheResolver()Construct a newAbstractCacheResolver.protectedAbstractCacheResolver(CacheManager cacheManager)Construct a newAbstractCacheResolverfor the givenCacheManager.
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 voidafterPropertiesSet()Invoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.CacheManagergetCacheManager()Return theCacheManagerthat this instance uses.protected abstract Collection<String>getCacheNames(CacheOperationInvocationContext<?> context)Provide the name of the cache(s) to resolve against the current cache manager.Collection<? extends Cache>resolveCaches(CacheOperationInvocationContext<?> context)Return the cache(s) to use for the specified invocation.voidsetCacheManager(CacheManager cacheManager)Set theCacheManagerthat this instance should use.
构造器详细资料
AbstractCacheResolver
protected AbstractCacheResolver()
Construct a newAbstractCacheResolver.
AbstractCacheResolver
protected AbstractCacheResolver(CacheManager cacheManager)
Construct a newAbstractCacheResolverfor the givenCacheManager.- 参数:
cacheManager- the CacheManager to use
方法详细资料
setCacheManager
public void setCacheManager(CacheManager cacheManager)
Set theCacheManagerthat this instance should use.
getCacheManager
public CacheManager getCacheManager()
Return theCacheManagerthat this instance uses.
afterPropertiesSet
public void afterPropertiesSet()
从接口复制的说明:InitializingBeanInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- 指定者:
afterPropertiesSet在接口中InitializingBean
resolveCaches
public Collection<? extends Cache> resolveCaches(CacheOperationInvocationContext<?> context)
从接口复制的说明:CacheResolverReturn the cache(s) to use for the specified invocation.- 指定者:
resolveCaches在接口中CacheResolver- 参数:
context- the context of the particular invocation- 返回:
- the cache(s) to use (never
null)
getCacheNames
protected abstract Collection<String> getCacheNames(CacheOperationInvocationContext<?> context)
Provide 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.- 参数:
context- the context of the particular invocation- 返回:
- the cache name(s) to resolve, or
nullif no cache should be resolved