public class JCacheAspectSupport
extends org.springframework.cache.interceptor.AbstractCacheInvoker
implements org.springframework.beans.factory.InitializingBean
JCacheInterceptor
or an AspectJ aspect.
Use the Spring caching abstraction for cache-related operations. No JSR-107
Cache
or CacheManager
are required to
process standard JSR-107 cache annotations.
The JCacheOperationSource
is used for determining caching operations
A cache aspect is serializable if its JCacheOperationSource
is serializable.
CacheAspectSupport
,
KeyGeneratorAdapter
,
CacheResolverAdapter
Constructor and Description |
---|
JCacheAspectSupport() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected java.lang.Object |
execute(org.springframework.cache.interceptor.CacheOperationInvoker invoker,
java.lang.Object target,
java.lang.reflect.Method method,
java.lang.Object[] args) |
JCacheOperationSource |
getCacheOperationSource()
Return the CacheOperationSource for this cache aspect.
|
protected java.lang.Object |
invokeOperation(org.springframework.cache.interceptor.CacheOperationInvoker invoker)
Execute the underlying operation (typically in case of cache miss) and return
the result of the invocation.
|
void |
setCacheOperationSource(JCacheOperationSource cacheOperationSource) |
protected final Log logger
public void setCacheOperationSource(JCacheOperationSource cacheOperationSource)
public JCacheOperationSource getCacheOperationSource()
public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
protected java.lang.Object execute(org.springframework.cache.interceptor.CacheOperationInvoker invoker, java.lang.Object target, java.lang.reflect.Method method, java.lang.Object[] args)
protected java.lang.Object invokeOperation(org.springframework.cache.interceptor.CacheOperationInvoker invoker)
ThrowableWrapper
: the exception can be handled or modified but it
must be wrapped in a ThrowableWrapper
as well.invoker
- the invoker handling the operation being cachedCacheOperationInvoker.invoke()