Class DefaultRetryInterceptor

  • All Implemented Interfaces:
    io.micronaut.aop.Interceptor<java.lang.Object,​java.lang.Object>, io.micronaut.aop.MethodInterceptor<java.lang.Object,​java.lang.Object>, io.micronaut.core.order.Ordered

    @Singleton
    public class DefaultRetryInterceptor
    extends java.lang.Object
    implements io.micronaut.aop.MethodInterceptor<java.lang.Object,​java.lang.Object>
    A MethodInterceptor that retries an operation according to the specified Retryable annotation.
    Since:
    1.0
    • Field Summary

      • Fields inherited from interface io.micronaut.aop.Interceptor

        ARGUMENT, CACHEABLE_LAZY_TARGET, HOTSWAP, LAZY, PROXY_TARGET
      • Fields inherited from interface io.micronaut.core.order.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultRetryInterceptor​(io.micronaut.context.event.ApplicationEventPublisher eventPublisher, java.util.concurrent.ExecutorService executorService)
      Construct a default retry method interceptor with the event publisher.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getOrder()  
      java.lang.Object intercept​(io.micronaut.aop.MethodInvocationContext<java.lang.Object,​java.lang.Object> context)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.micronaut.aop.MethodInterceptor

        intercept
    • Constructor Detail

      • DefaultRetryInterceptor

        public DefaultRetryInterceptor​(io.micronaut.context.event.ApplicationEventPublisher eventPublisher,
                                       @Named("scheduled")
                                       java.util.concurrent.ExecutorService executorService)
        Construct a default retry method interceptor with the event publisher.
        Parameters:
        eventPublisher - The event publisher to publish retry events
        executorService - The executor service to use for completable futures
    • Method Detail

      • getOrder

        public int getOrder()
        Specified by:
        getOrder in interface io.micronaut.core.order.Ordered
      • intercept

        @Nullable
        public java.lang.Object intercept​(io.micronaut.aop.MethodInvocationContext<java.lang.Object,​java.lang.Object> context)
        Specified by:
        intercept in interface io.micronaut.aop.MethodInterceptor<java.lang.Object,​java.lang.Object>