Interface Interceptor<T,R>

Type Parameters:
T - The intercepted type
R - The result type
All Superinterfaces:
Ordered
All Known Subinterfaces:
ConstructorInterceptor<T>, MethodInterceptor<T,R>
All Known Implementing Classes:
AsyncInterceptor, ClientWebSocketInterceptor, ConfigurationIntroductionAdvice, DefaultRetryInterceptor, FunctionClientAdvice, HttpClientIntroductionAdvice, RecoveryInterceptor, RefreshInterceptor

@Indexed(Interceptor.class) public interface Interceptor<T,R> extends Ordered

An Interceptor intercepts the execution of a method allowing cross cutting behaviour to be applied to a method's execution.

All implementations should be thread safe beans

In the case of Around advice the interceptor should invoke InvocationContext.proceed() to proceed with the method invocation

In the case of Introduction advice the interceptor should invoke InvocationContext.proceed() if it is unable to implement the method. The last call to InvocationContext.proceed() will produce a UnsupportedOperationException indicating the method cannot be implemented. This mechanism allows multiple possible interceptors to participate in method implementation.

Since:
1.0
Author:
Graeme Rocher