类 AbstractCacheResolver
java.lang.Object
cn.taketoday.cache.interceptor.AbstractCacheResolver
- 所有已实现的接口:
InitializingBean,CacheResolver
- 直接已知子类:
NamedCacheResolver,SimpleCacheResolver
public abstract class AbstractCacheResolver
extends Object
implements CacheResolver, InitializingBean
A base
CacheResolver implementation that requires the concrete
implementation to provide the collection of cache name(s) based on the
invocation context.- 从以下版本开始:
- 4.0
- 作者:
- Stephane Nicoll, Juergen Hoeller
-
构造器概要
构造器限定符构造器说明protectedConstruct a newAbstractCacheResolver.protectedAbstractCacheResolver(CacheManager cacheManager) Construct a newAbstractCacheResolverfor the givenCacheManager. -
方法概要
修饰符和类型方法说明voidReturn 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
Construct a newAbstractCacheResolverfor the givenCacheManager.- 参数:
cacheManager- the CacheManager to use
-
-
方法详细资料
-
setCacheManager
Set theCacheManagerthat this instance should use. -
getCacheManager
Return theCacheManagerthat this instance uses. -
afterPropertiesSet
public void afterPropertiesSet()- 指定者:
afterPropertiesSet在接口中InitializingBean
-
resolveCaches
从接口复制的说明: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
@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
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
-