Class AbstractRetryInterceptor

java.lang.Object
org.springframework.resilience.retry.AbstractRetryInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, org.springframework.beans.factory.Aware, ApplicationEventPublisherAware
Direct Known Subclasses:
SimpleRetryInterceptor

public abstract class AbstractRetryInterceptor extends Object implements org.aopalliance.intercept.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 Details

    • AbstractRetryInterceptor

      public AbstractRetryInterceptor()
  • Method Details

    • setApplicationEventPublisher

      public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
      Description copied from interface: ApplicationEventPublisherAware
      Set 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:
      setApplicationEventPublisher in interface ApplicationEventPublisherAware
      Parameters:
      applicationEventPublisher - event publisher to be used by this object
    • invoke

      public @Nullable Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws Throwable
      Specified by:
      invoke in interface org.aopalliance.intercept.MethodInterceptor
      Throws:
      Throwable
    • getRetrySpec

      protected abstract @Nullable MethodRetrySpec getRetrySpec(Method method, Class<?> targetClass)
      Determine the retry specification for the given method on the given target.
      Parameters:
      method - the currently executing method
      targetClass - the class of the current target object
      Returns:
      the retry specification as a MethodRetrySpec