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, setAttribute
public RetryContextSupport(RetryContext parent)
public RetryContext getParent()
RetryContext
getParent
in interface RetryContext
public boolean isExhaustedOnly()
RetryContext
RetryContext.setExhaustedOnly()
.isExhaustedOnly
in interface RetryContext
public void setExhaustedOnly()
RetryContext
RetryCallback
.setExhaustedOnly
in interface RetryContext
public int getRetryCount()
RetryContext
getRetryCount
in interface RetryContext
public Throwable getLastThrowable()
RetryContext
getLastThrowable
in interface RetryContext
public 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 © 2020 SpringSource. All rights reserved.