Class AbstractRetryInterceptor
java.lang.Object
org.springframework.resilience.retry.AbstractRetryInterceptor
- All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, Aware, ApplicationEventPublisherAware
- Direct Known Subclasses:
SimpleRetryInterceptor
public abstract class AbstractRetryInterceptor
extends Object
implements MethodInterceptor, ApplicationEventPublisherAware
Abstract retry interceptor implementation, adapting a given
retry specification to either
RetryTemplate or Reactor.- Since:
- 7.0
- Author:
- Juergen Hoeller
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract @Nullable MethodRetrySpecgetRetrySpec(Method method, Class<?> targetClass) Determine the retry specification for the given method on the given target.invoke(MethodInvocation invocation) Implement this method to perform extra treatments before and after the invocation.voidsetApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) Set the ApplicationEventPublisher that this object runs in.
-
Constructor Details
-
AbstractRetryInterceptor
public AbstractRetryInterceptor()
-
-
Method Details
-
setApplicationEventPublisher
Description copied from interface:ApplicationEventPublisherAwareSet the ApplicationEventPublisher that this object runs in.Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked before ApplicationContextAware's setApplicationContext.
- Specified by:
setApplicationEventPublisherin interfaceApplicationEventPublisherAware- Parameters:
applicationEventPublisher- event publisher to be used by this object
-
invoke
Description copied from interface:MethodInterceptorImplement this method to perform extra treatments before and after the invocation. Polite implementations would certainly like to invokeJoinpoint.proceed().- Specified by:
invokein interfaceMethodInterceptor- Parameters:
invocation- the method invocation joinpoint- Returns:
- the result of the call to
Joinpoint.proceed(); might be intercepted by the interceptor - Throws:
Throwable- if the interceptors or the target object throws an exception
-
getRetrySpec
Determine the retry specification for the given method on the given target.- Parameters:
method- the currently executing methodtargetClass- the class of the current target object- Returns:
- the retry specification as a
MethodRetrySpec
-