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,
java.lang.Throwable throwable) |
protected java.lang.Object |
doInvoke(AbstractRequestHandlerAdvice.ExecutionCallback callback,
java.lang.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,
java.lang.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<java.lang.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, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString
public void setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
public void setRecoveryCallback(org.springframework.retry.RecoveryCallback<java.lang.Object> recoveryCallback)
public void setRetryStateGenerator(RetryStateGenerator retryStateGenerator)
protected void onInit() throws java.lang.Exception
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
java.lang.Exception
protected java.lang.Object doInvoke(AbstractRequestHandlerAdvice.ExecutionCallback callback, java.lang.Object target, Message<?> message) throws java.lang.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
.java.lang.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, java.lang.Throwable throwable)
close
in interface org.springframework.retry.RetryListener
public <T> void onError(org.springframework.retry.RetryContext context, org.springframework.retry.RetryCallback<T> callback, java.lang.Throwable throwable)
onError
in interface org.springframework.retry.RetryListener