public class RequestHandlerRetryAdvice extends AbstractRequestHandlerAdvice implements org.springframework.retry.RetryListener
RetryTemplate
; stateful retry means the
exception is thrown but state is maintained to support
the retry policies. Stateful retry requires a
RetryStateGenerator
.AbstractRequestHandlerAdvice.ExecutionCallback, AbstractRequestHandlerAdvice.ThrowableHolderException
EXPRESSION_PARSER, logger
Constructor and Description |
---|
RequestHandlerRetryAdvice() |
Modifier and Type | Method and Description |
---|---|
<T,E extends Throwable> |
close(org.springframework.retry.RetryContext context,
org.springframework.retry.RetryCallback<T,E> callback,
Throwable throwable) |
protected Object |
doInvoke(AbstractRequestHandlerAdvice.ExecutionCallback callback,
Object target,
Message<?> message)
Subclasses implement this method to apply behavior to the
MessageHandler . |
<T,E extends Throwable> |
onError(org.springframework.retry.RetryContext context,
org.springframework.retry.RetryCallback<T,E> callback,
Throwable throwable) |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
<T,E extends Throwable> |
open(org.springframework.retry.RetryContext context,
org.springframework.retry.RetryCallback<T,E> callback) |
void |
setRecoveryCallback(org.springframework.retry.RecoveryCallback<Object> recoveryCallback) |
void |
setRetryStateGenerator(RetryStateGenerator retryStateGenerator) |
void |
setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
Set the retry template.
|
invoke, unwrapExceptionIfNecessary, unwrapThrowableIfNecessary
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
public void setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
MessagingException
.retryTemplate
- the retry template.public void setRecoveryCallback(org.springframework.retry.RecoveryCallback<Object> recoveryCallback)
public void setRetryStateGenerator(RetryStateGenerator retryStateGenerator)
protected void onInit()
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
protected Object doInvoke(AbstractRequestHandlerAdvice.ExecutionCallback callback, Object target, Message<?> message)
AbstractRequestHandlerAdvice
MessageHandler
.
callback.execute() invokes the handler method and returns its result, or null.
doInvoke
in class AbstractRequestHandlerAdvice
callback
- Subclasses invoke the execute() method on this interface to invoke the handler method.target
- The target handler.message
- The message that will be sent to the handler.MessageHandler
.public <T,E extends Throwable> boolean open(org.springframework.retry.RetryContext context, org.springframework.retry.RetryCallback<T,E> callback)
open
in interface org.springframework.retry.RetryListener
public <T,E extends Throwable> void close(org.springframework.retry.RetryContext context, org.springframework.retry.RetryCallback<T,E> callback, Throwable throwable)
close
in interface org.springframework.retry.RetryListener