public class RetryContextSupport extends org.springframework.core.AttributeAccessorSupport implements RetryContext
| Constructor and Description |
|---|
RetryContextSupport(RetryContext parent) |
| Modifier and Type | Method and Description |
|---|---|
Throwable |
getLastThrowable()
Accessor for the exception object that caused the current retry.
|
RetryContext |
getParent()
Accessor for the parent context if retry blocks are nested.
|
int |
getRetryCount()
Counts the number of retry attempts.
|
boolean |
isExhaustedOnly()
Public accessor for the exhausted flag
RetryContext.setExhaustedOnly(). |
void |
registerThrowable(Throwable throwable)
Set the exception for the public interface
RetryContext, and also increment
the retry count if the throwable is non-null. |
void |
setExhaustedOnly()
Signal to the framework that no more attempts should be made to try or retry the
current
RetryCallback. |
String |
toString() |
attributeNames, copyAttributesFrom, equals, getAttribute, hasAttribute, hashCode, removeAttribute, setAttributepublic RetryContextSupport(RetryContext parent)
public RetryContext getParent()
RetryContextgetParent in interface RetryContextpublic boolean isExhaustedOnly()
RetryContextRetryContext.setExhaustedOnly().isExhaustedOnly in interface RetryContextpublic void setExhaustedOnly()
RetryContextRetryCallback.setExhaustedOnly in interface RetryContextpublic int getRetryCount()
RetryContextgetRetryCount in interface RetryContextpublic Throwable getLastThrowable()
RetryContextgetLastThrowable in interface RetryContextpublic void registerThrowable(Throwable throwable)
RetryContext, and also increment
the retry count if the throwable is non-null.
All RetryPolicy implementations should use this method when they register
the throwable. It should only be called once per retry attempt because it
increments a counter.
Use of this method is not enforced by the framework - it is a service provider
contract for authors of policies.throwable - the exception that caused the current retry attempt to fail.Copyright © 2022 SpringSource. All rights reserved.