Class RecoveryInterceptor
java.lang.Object
io.micronaut.retry.intercept.RecoveryInterceptor
- All Implemented Interfaces:
io.micronaut.aop.Interceptor<Object,Object>, io.micronaut.aop.MethodInterceptor<Object, Object>, io.micronaut.core.order.Ordered
-
Field Summary
FieldsFields inherited from interface io.micronaut.aop.Interceptor
ARGUMENT, CACHEABLE_LAZY_TARGET, HOTSWAP, LAZY, PROXY_TARGETFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionRecoveryInterceptor(io.micronaut.context.BeanContext beanContext) Creates a recovery interceptor. -
Method Summary
Modifier and TypeMethodDescriptionfindFallbackMethod(io.micronaut.aop.MethodInvocationContext<Object, Object> context) Finds a fallback method for the given context.intgetOrder()@Nullable Objectprotected @Nullable ObjectresolveFallback(io.micronaut.aop.MethodInvocationContext<Object, Object> context, RuntimeException exception) Resolves a fallback for the given execution context and exception.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.aop.MethodInterceptor
intercept
-
Field Details
-
POSITION
public static final int POSITIONPositioned before theRetryableinterceptor.
-
-
Constructor Details
-
RecoveryInterceptor
public RecoveryInterceptor(io.micronaut.context.BeanContext beanContext) Creates a recovery interceptor.- Parameters:
beanContext- The bean context to allow for DI of class annotated withInject.
-
-
Method Details
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceio.micronaut.core.order.Ordered
-
intercept
-
findFallbackMethod
-
resolveFallback
protected @Nullable Object resolveFallback(io.micronaut.aop.MethodInvocationContext<Object, Object> context, RuntimeException exception) Resolves a fallback for the given execution context and exception.- Parameters:
context- The contextexception- The exception- Returns:
- Returns the fallback value or throws the original exception
-