Package io.micronaut.aop
Interface Interceptor<T,R>
- Type Parameters:
T
- The intercepted typeR
- 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
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
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Argument<Interceptor<?,
?>> static final CharSequence
TheAround.cacheableLazyTarget()
setting.static final CharSequence
TheAround.hotswap()
setting.static final CharSequence
TheAround.lazy()
setting.static final CharSequence
TheAround.proxyTarget()
setting.Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Method Summary
-
Field Details
-
ARGUMENT
-
PROXY_TARGET
TheAround.proxyTarget()
setting. -
HOTSWAP
TheAround.hotswap()
setting. -
LAZY
TheAround.lazy()
setting. -
CACHEABLE_LAZY_TARGET
TheAround.cacheableLazyTarget()
setting.
-
-
Method Details
-
intercept
Intercepts an execution from a declaredAround
advice. The implementation can either callInvocationContext.proceed()
to return the original value or provide a replacement value- Parameters:
context
- The interception context- Returns:
- result type
-