类 AbstractCacheResolver
- java.lang.Object
- org.springframework.cache.interceptor.AbstractCacheResolver
- 所有已实现的接口:
InitializingBean
,CacheResolver
public abstract class AbstractCacheResolver extends Object implements CacheResolver, InitializingBean
A baseCacheResolver
implementation that requires the concrete implementation to provide the collection of cache name(s) based on the invocation context.- 从以下版本开始:
- 4.1
- 作者:
- Stephane Nicoll, Juergen Hoeller
构造器概要
构造器 限定符 构造器 说明 protected
AbstractCacheResolver()
Construct a newAbstractCacheResolver
.protected
AbstractCacheResolver(CacheManager cacheManager)
Construct a newAbstractCacheResolver
for the givenCacheManager
.
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.CacheManager
getCacheManager()
Return theCacheManager
that 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.void
setCacheManager(CacheManager cacheManager)
Set theCacheManager
that this instance should use.
构造器详细资料
AbstractCacheResolver
protected AbstractCacheResolver()
Construct a newAbstractCacheResolver
.
AbstractCacheResolver
protected AbstractCacheResolver(CacheManager cacheManager)
Construct a newAbstractCacheResolver
for the givenCacheManager
.- 参数:
cacheManager
- the CacheManager to use
方法详细资料
setCacheManager
public void setCacheManager(CacheManager cacheManager)
Set theCacheManager
that this instance should use.
getCacheManager
public CacheManager getCacheManager()
Return theCacheManager
that this instance uses.
afterPropertiesSet
public void afterPropertiesSet()
从接口复制的说明:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.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)
从接口复制的说明:CacheResolver
Return 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
@Nullable 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
null
to indicate that no cache could be resolved for this invocation.- 参数:
context
- the context of the particular invocation- 返回:
- the cache name(s) to resolve, or
null
if no cache should be resolved