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

public Class CacheInterceptor

extends CacheAspectSupport
implements MethodInterceptor, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.aopalliance.intercept.MethodInterceptor, org.aopalliance.intercept.Interceptor, org.aopalliance.aop.Advice
Annotations
@SuppressWarnings:serial
Imports
java.io.Serializable, java.lang.reflect.Method, kotlin.coroutines.Continuation, kotlin.coroutines.CoroutineContext, kotlinx.coroutines.Job, org.aopalliance.intercept.MethodInterceptor, .MethodInvocation, org.reactivestreams.Publisher, org.springframework.core.CoroutinesUtils, .KotlinDetector, org.springframework.lang.Nullable, org.springframework.util.Assert

AOP Alliance MethodInterceptor for declarative cache management using the common Spring caching infrastructure (org.springframework.cache.Cache).

Derives from the CacheAspectSupport class which contains the integration with Spring's underlying caching API. CacheInterceptor simply calls the relevant superclass methods in the correct order.

CacheInterceptors are thread-safe.

Authors
Costin Leau, Juergen Hoeller, Sebastien Deleuze
Since
3.1

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
CacheInterceptor.KotlinDelegate

Inner class to avoid a hard dependency on Kotlin at runtime.

Field Summary

Inherited from org.springframework.cache.interceptor.CacheAspectSupport:
IGNORE_REACTIVESTREAMS_PROPERTY_NAMElogger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
invoke(final MethodInvocation
the method invocation joinpoint
invocation
)

Implements org.aopalliance.intercept.MethodInterceptor.invoke.

Implement this method to perform extra treatments before and after the invocation.
Inherited from org.springframework.cache.interceptor.CacheAspectSupport:
afterPropertiesSetafterSingletonsInstantiatedclearMetadataCacheconfigureexecutegetBeangetCacheOperationMetadatagetCacheOperationSourcegetCacheResolvergetCachesgetKeyGeneratorgetOperationContextinvokeOperationmethodIdentificationsetBeanFactorysetCacheManagersetCacheOperationSourcesetCacheOperationSourcessetCacheResolversetKeyGenerator

Constructor Detail

CacheInterceptorback to summary
public CacheInterceptor()

Method Detail

invokeback to summary
public Object invoke(final MethodInvocation invocation) throws Throwable

Implements org.aopalliance.intercept.MethodInterceptor.invoke.

Doc from org.aopalliance.intercept.MethodInterceptor.invoke.

Implement this method to perform extra treatments before and after the invocation. Polite implementations would certainly like to invoke Joinpoint#proceed().

Parameters
invocation:MethodInvocation

the method invocation joinpoint

Returns:Object

the result of the call to Joinpoint#proceed(); might be intercepted by the interceptor

Annotations
@Override
@Nullable
Exceptions
Throwable:
if the interceptors or the target object throws an exception
org.springframework.cache.interceptor back to summary

private Class CacheInterceptor.KotlinDelegate

extends Object
Class Inheritance
  • java.lang.Object
  • org.springframework.cache.interceptor.CacheInterceptor.KotlinDelegate

Inner class to avoid a hard dependency on Kotlin at runtime.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Publisher<?>
invokeSuspendingFunction(Method method, Object target, Object... args)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

KotlinDelegateback to summary
private KotlinDelegate()

Method Detail

invokeSuspendingFunctionback to summary
public static Publisher<?> invokeSuspendingFunction(Method method, Object target, Object... args)