类 DefaultJCacheOperationSource
- java.lang.Object
- org.springframework.cache.jcache.interceptor.AbstractFallbackJCacheOperationSource
- org.springframework.cache.jcache.interceptor.AnnotationJCacheOperationSource
- org.springframework.cache.jcache.interceptor.DefaultJCacheOperationSource
- 所有已实现的接口:
Aware
,BeanFactoryAware
,InitializingBean
,SmartInitializingSingleton
,JCacheOperationSource
public class DefaultJCacheOperationSource extends AnnotationJCacheOperationSource implements BeanFactoryAware, InitializingBean, SmartInitializingSingleton
The defaultJCacheOperationSource
implementation delegating default operations to configurable services with sensible defaults when not present.- 从以下版本开始:
- 4.1
- 作者:
- Stephane Nicoll
字段概要
从类继承的字段 org.springframework.cache.jcache.interceptor.AbstractFallbackJCacheOperationSource
logger
构造器概要
构造器 构造器 说明 DefaultJCacheOperationSource()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.void
afterSingletonsInstantiated()
Invoked right at the end of the singleton pre-instantiation phase, with a guarantee that all regular singleton beans have been created already.protected <T> T
getBean(Class<T> type)
Locate or create an instance of the specified cache strategytype
.CacheManager
getCacheManager()
Return the specified cache manager to use, if any.CacheResolver
getCacheResolver()
Return the specified cache resolver to use, if any.protected CacheManager
getDefaultCacheManager()
protected CacheResolver
getDefaultCacheResolver()
Return the defaultCacheResolver
if none is set.protected CacheResolver
getDefaultExceptionCacheResolver()
Return the default exceptionCacheResolver
if none is set.protected KeyGenerator
getDefaultKeyGenerator()
Return the defaultKeyGenerator
if none is set.CacheResolver
getExceptionCacheResolver()
Return the specified exception cache resolver to use, if any.KeyGenerator
getKeyGenerator()
Return the specified key generator to use, if any.void
setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.void
setCacheManager(CacheManager cacheManager)
Set the defaultCacheManager
to use to lookup cache by name.void
setCacheResolver(CacheResolver cacheResolver)
Set theCacheResolver
to resolve regular caches.void
setExceptionCacheResolver(CacheResolver exceptionCacheResolver)
Set theCacheResolver
to resolve exception caches.void
setKeyGenerator(KeyGenerator keyGenerator)
Set the defaultKeyGenerator
.从类继承的方法 org.springframework.cache.jcache.interceptor.AnnotationJCacheOperationSource
createCachePutOperation, createCacheRemoveAllOperation, createCacheRemoveOperation, createCacheResultOperation, determineCacheName, determineCacheResolverFactory, determineKeyGenerator, findCacheOperation, generateDefaultCacheName, getCacheDefaults, getCacheResolver, getExceptionCacheResolver
从类继承的方法 org.springframework.cache.jcache.interceptor.AbstractFallbackJCacheOperationSource
allowPublicMethodsOnly, getCacheOperation
构造器详细资料
DefaultJCacheOperationSource
public DefaultJCacheOperationSource()
方法详细资料
setCacheManager
public void setCacheManager(CacheManager cacheManager)
Set the defaultCacheManager
to use to lookup cache by name. Only mandatory if the cache resolvers have not been set.
getCacheManager
public CacheManager getCacheManager()
Return the specified cache manager to use, if any.
setCacheResolver
public void setCacheResolver(CacheResolver cacheResolver)
Set theCacheResolver
to resolve regular caches. If none is set, a default implementation using the specified cache manager will be used.
getCacheResolver
public CacheResolver getCacheResolver()
Return the specified cache resolver to use, if any.
setExceptionCacheResolver
public void setExceptionCacheResolver(CacheResolver exceptionCacheResolver)
Set theCacheResolver
to resolve exception caches. If none is set, a default implementation using the specified cache manager will be used.
getExceptionCacheResolver
public CacheResolver getExceptionCacheResolver()
Return the specified exception cache resolver to use, if any.
setKeyGenerator
public void setKeyGenerator(KeyGenerator keyGenerator)
Set the defaultKeyGenerator
. If none is set, aSimpleKeyGenerator
honoring the JSR-107CacheKey
andCacheValue
will be used.
getKeyGenerator
public KeyGenerator getKeyGenerator()
Return the specified key generator to use, if any.
setBeanFactory
public void setBeanFactory(BeanFactory beanFactory)
从接口复制的说明:BeanFactoryAware
Callback that supplies the owning factory to a bean instance.Invoked after the population of normal bean properties but before an initialization callback such as
InitializingBean.afterPropertiesSet()
or a custom init-method.- 指定者:
setBeanFactory
在接口中BeanFactoryAware
- 参数:
beanFactory
- owning BeanFactory (nevernull
). The bean can immediately call methods on the factory.- 另请参阅:
BeanInitializationException
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
afterSingletonsInstantiated
public void afterSingletonsInstantiated()
从接口复制的说明:SmartInitializingSingleton
Invoked right at the end of the singleton pre-instantiation phase, with a guarantee that all regular singleton beans have been created already.ListableBeanFactory.getBeansOfType(java.lang.Class<T>)
calls within this method won't trigger accidental side effects during bootstrap.NOTE: This callback won't be triggered for singleton beans lazily initialized on demand after
BeanFactory
bootstrap, and not for any other bean scope either. Carefully use it for beans with the intended bootstrap semantics only.
getBean
protected <T> T getBean(Class<T> type)
从类复制的说明:AnnotationJCacheOperationSource
Locate or create an instance of the specified cache strategytype
.- 指定者:
getBean
在类中AnnotationJCacheOperationSource
- 参数:
type
- the type of the bean to manage- 返回:
- the required bean
getDefaultCacheManager
protected CacheManager getDefaultCacheManager()
getDefaultCacheResolver
protected CacheResolver getDefaultCacheResolver()
从类复制的说明:AnnotationJCacheOperationSource
Return the defaultCacheResolver
if none is set.
getDefaultExceptionCacheResolver
protected CacheResolver getDefaultExceptionCacheResolver()
从类复制的说明:AnnotationJCacheOperationSource
Return the default exceptionCacheResolver
if none is set.
getDefaultKeyGenerator
protected KeyGenerator getDefaultKeyGenerator()
从类复制的说明:AnnotationJCacheOperationSource
Return the defaultKeyGenerator
if none is set.