@Singleton public class DefaultRetryInterceptor extends Object implements MethodInterceptor<Object,Object>
MethodInterceptor
that retries an operation according to the specified
Retryable
annotation.ARGUMENT, CACHEABLE_LAZY_TARGET, HOTSWAP, LAZY, PROXY_TARGET
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
DefaultRetryInterceptor(ApplicationEventPublisher eventPublisher,
ExecutorService executorService)
Construct a default retry method interceptor with the event publisher.
|
Modifier and Type | Method and Description |
---|---|
int |
getOrder() |
Object |
intercept(MethodInvocationContext<Object,Object> context)
Extended version of the
MethodInterceptor.intercept(InvocationContext) method that accepts a MethodInvocationContext . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
intercept
public DefaultRetryInterceptor(ApplicationEventPublisher eventPublisher, @Named(value="scheduled") ExecutorService executorService)
eventPublisher
- The event publisher to publish retry eventsexecutorService
- The executor service to use for completable futurespublic int getOrder()
@Nullable public Object intercept(MethodInvocationContext<Object,Object> context)
MethodInterceptor
MethodInterceptor.intercept(InvocationContext)
method that accepts a MethodInvocationContext
.intercept
in interface MethodInterceptor<Object,Object>
context
- The context