类 JCacheAspectSupport
- java.lang.Object
- org.springframework.cache.interceptor.AbstractCacheInvoker
- org.springframework.cache.jcache.interceptor.JCacheAspectSupport
- 所有已实现的接口:
InitializingBean
- 直接已知子类:
JCacheInterceptor
public class JCacheAspectSupport extends AbstractCacheInvoker implements InitializingBean
Base class for JSR-107 caching aspects, such as theJCacheInterceptor
or an AspectJ aspect.Use the Spring caching abstraction for cache-related operations. No JSR-107
Cache
orCacheManager
are required to process standard JSR-107 cache annotations.The
JCacheOperationSource
is used for determining caching operationsA cache aspect is serializable if its
JCacheOperationSource
is serializable.- 从以下版本开始:
- 4.1
- 作者:
- Stephane Nicoll
- 另请参阅:
CacheAspectSupport
,KeyGeneratorAdapter
,CacheResolverAdapter
构造器概要
构造器 构造器 说明 JCacheAspectSupport()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.protected Object
execute(CacheOperationInvoker invoker, Object target, Method method, Object[] args)
JCacheOperationSource
getCacheOperationSource()
Return the CacheOperationSource for this cache aspect.protected Object
invokeOperation(CacheOperationInvoker invoker)
Execute the underlying operation (typically in case of cache miss) and return the result of the invocation.void
setCacheOperationSource(JCacheOperationSource cacheOperationSource)
从类继承的方法 org.springframework.cache.interceptor.AbstractCacheInvoker
doClear, doEvict, doGet, doPut, getErrorHandler, setErrorHandler
构造器详细资料
JCacheAspectSupport
public JCacheAspectSupport()
方法详细资料
setCacheOperationSource
public void setCacheOperationSource(JCacheOperationSource cacheOperationSource)
getCacheOperationSource
public JCacheOperationSource getCacheOperationSource()
Return the CacheOperationSource for this cache aspect.
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
execute
protected Object execute(CacheOperationInvoker invoker, Object target, Method method, Object[] args)
invokeOperation
protected Object invokeOperation(CacheOperationInvoker invoker)
Execute the underlying operation (typically in case of cache miss) and return the result of the invocation. If an exception occurs it will be wrapped in aThrowableWrapper
: the exception can be handled or modified but it must be wrapped in aThrowableWrapper
as well.- 参数:
invoker
- the invoker handling the operation being cached- 返回:
- the result of the invocation
- 另请参阅:
CacheOperationInvoker.invoke()