Top Description Fields Constructors Methods
org.springframework.cache.jcache.interceptor

pack-priv abstract Class AbstractCacheInterceptor<O extends AbstractJCacheOperation<A>, A extends Annotation>

extends AbstractCacheInvoker
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Known Direct Subclasses
org.springframework.cache.jcache.interceptor.AbstractKeyCacheInterceptor, org.springframework.cache.jcache.interceptor.CacheRemoveAllInterceptor
Annotations
@SuppressWarnings:serial
Type Parameters
<O>
the operation type
<A>
the annotation type
Imports
java.io.Serializable, java.lang.annotation.Annotation, java.util.Collection, org.apache.commons.logging.Log, .LogFactory, org.springframework.cache.Cache, org.springframework.cache.interceptor.AbstractCacheInvoker, .CacheErrorHandler, .CacheOperationInvocationContext, .CacheOperationInvoker, org.springframework.lang.Nullable, org.springframework.util.CollectionUtils

A base interceptor for JSR-107 cache annotations.
Author
Stephane Nicoll
Since
4.1

Field Summary

Modifier and TypeField and Description
protected final Log
Inherited from org.springframework.cache.interceptor.AbstractCacheInvoker:
errorHandler

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
pack-priv static Cache

Returns:

the single element, or null if the collection is empty
extractFrom
(Collection<? extends Cache> caches)

Convert the collection of caches in a single expected element.

protected abstract Object
protected Cache

Returns:

the cache to use (never null)
resolveCache
(CacheOperationInvocationContext<O>
the invocation context
context
)

Resolve the cache to use.

Inherited from org.springframework.cache.interceptor.AbstractCacheInvoker:
doCleardoEvictdoGetdoPutgetErrorHandlersetErrorHandler

Field Detail

loggerback to summary
protected final Log logger

Constructor Detail

AbstractCacheInterceptorback to summary
protected AbstractCacheInterceptor(CacheErrorHandler errorHandler)

Method Detail

extractFromback to summary
pack-priv static Cache extractFrom(Collection<? extends Cache> caches)

Convert the collection of caches in a single expected element.

Throw an IllegalStateException if the collection holds more than one element

Returns:Cache

the single element, or null if the collection is empty

Annotations
@Nullable
invokeback to summary
protected abstract Object invoke(CacheOperationInvocationContext<O> context, CacheOperationInvoker invoker) throws Throwable
Annotations
@Nullable
resolveCacheback to summary
protected Cache resolveCache(CacheOperationInvocationContext<O> context)

Resolve the cache to use.

Parameters
context:CacheOperationInvocationContext<O>

the invocation context

Returns:Cache

the cache to use (never null)