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
logger
Constructor and Description |
---|
RequestHandlerRetryAdvice() |
Modifier and Type | Method and Description |
---|---|
<T> void |
close(org.springframework.retry.RetryContext context,
org.springframework.retry.RetryCallback<T> callback,
Throwable throwable) |
protected Object |
doInvoke(AbstractRequestHandlerAdvice.ExecutionCallback callback,
Object target,
Message<?> message)
Subclasses implement this method to apply behavior to the
MessageHandler . |
<T> void |
onError(org.springframework.retry.RetryContext context,
org.springframework.retry.RetryCallback<T> callback,
Throwable throwable) |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
<T> boolean |
open(org.springframework.retry.RetryContext context,
org.springframework.retry.RetryCallback<T> callback) |
void |
setRecoveryCallback(org.springframework.retry.RecoveryCallback<Object> recoveryCallback) |
void |
setRetryStateGenerator(RetryStateGenerator retryStateGenerator) |
void |
setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate) |
invoke, unwrapExceptionIfNecessary, unwrapThrowableIfNecessary
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getComponentType, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, setTaskScheduler, toString
public void setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
public void setRecoveryCallback(org.springframework.retry.RecoveryCallback<Object> recoveryCallback)
public void setRetryStateGenerator(RetryStateGenerator retryStateGenerator)
protected void onInit() throws Exception
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
Exception
- Any exception.protected Object doInvoke(AbstractRequestHandlerAdvice.ExecutionCallback callback, Object target, Message<?> message) throws Exception
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
.Exception
- Any Exception.public <T> boolean open(org.springframework.retry.RetryContext context, org.springframework.retry.RetryCallback<T> callback)
open
in interface org.springframework.retry.RetryListener
public <T> void close(org.springframework.retry.RetryContext context, org.springframework.retry.RetryCallback<T> callback, Throwable throwable)
close
in interface org.springframework.retry.RetryListener
public <T> void onError(org.springframework.retry.RetryContext context, org.springframework.retry.RetryCallback<T> callback, Throwable throwable)
onError
in interface org.springframework.retry.RetryListener