类 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 theJCacheInterceptoror an AspectJ aspect.Use the Spring caching abstraction for cache-related operations. No JSR-107
CacheorCacheManagerare required to process standard JSR-107 cache annotations.The
JCacheOperationSourceis used for determining caching operationsA cache aspect is serializable if its
JCacheOperationSourceis serializable.- 从以下版本开始:
- 4.1
- 作者:
- Stephane Nicoll
- 另请参阅:
CacheAspectSupport,KeyGeneratorAdapter,CacheResolverAdapter
字段概要
从类继承的字段 org.springframework.cache.interceptor.AbstractCacheInvoker
errorHandler
构造器概要
构造器 构造器 说明 JCacheAspectSupport()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidafterPropertiesSet()Invoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.protected Objectexecute(CacheOperationInvoker invoker, Object target, Method method, Object[] args)JCacheOperationSourcegetCacheOperationSource()Return the CacheOperationSource for this cache aspect.protected ObjectinvokeOperation(CacheOperationInvoker invoker)Execute the underlying operation (typically in case of cache miss) and return the result of the invocation.voidsetCacheOperationSource(JCacheOperationSource cacheOperationSource)Set the CacheOperationSource for this cache aspect.从类继承的方法 org.springframework.cache.interceptor.AbstractCacheInvoker
doClear, doEvict, doGet, doPut, getErrorHandler, setErrorHandler
构造器详细资料
JCacheAspectSupport
public JCacheAspectSupport()
方法详细资料
setCacheOperationSource
public void setCacheOperationSource(JCacheOperationSource cacheOperationSource)
Set the CacheOperationSource for this cache aspect.
getCacheOperationSource
public JCacheOperationSource getCacheOperationSource()
Return the CacheOperationSource for this cache aspect.
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
execute
@Nullable 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 aThrowableWrapperas well.- 参数:
invoker- the invoker handling the operation being cached- 返回:
- the result of the invocation
- 另请参阅:
CacheOperationInvoker.invoke()