public class DefaultRetryState extends Object implements RetryState
Constructor and Description |
---|
DefaultRetryState(Object key)
Defaults the force refresh flag (to false) and the rollback classifier
(to null).
|
DefaultRetryState(Object key,
boolean forceRefresh)
Defaults the rollback classifier to null.
|
DefaultRetryState(Object key,
boolean forceRefresh,
Classifier<? super Throwable,Boolean> rollbackClassifier)
Create a
DefaultRetryState representing the state for a new retry
attempt. |
DefaultRetryState(Object key,
Classifier<? super Throwable,Boolean> rollbackClassifier)
Defaults the force refresh flag to false.
|
Modifier and Type | Method and Description |
---|---|
Object |
getKey()
Key representing the state for a retry attempt.
|
boolean |
isForceRefresh()
Indicate whether a cache lookup can be avoided.
|
boolean |
rollbackFor(Throwable exception)
Check whether this exception requires a rollback.
|
String |
toString() |
public DefaultRetryState(Object key, boolean forceRefresh, Classifier<? super Throwable,Boolean> rollbackClassifier)
DefaultRetryState
representing the state for a new retry
attempt.key
- the key for the state to allow this retry attempt to be
recognisedforceRefresh
- true if the attempt is known to be a brand new state
(could not have previously failed)rollbackClassifier
- the rollback classifier to set. The rollback
classifier answers true if the exception provided should cause a
rollback.RetryOperations.execute(RetryCallback, RetryState)
,
RetryOperations.execute(RetryCallback, RecoveryCallback, RetryState)
public DefaultRetryState(Object key, Classifier<? super Throwable,Boolean> rollbackClassifier)
key
- the keyrollbackClassifier
- the rollback Classifier
DefaultRetryState(Object, boolean, Classifier)
public DefaultRetryState(Object key, boolean forceRefresh)
key
- the keyforceRefresh
- whether to force a refreshDefaultRetryState(Object, boolean, Classifier)
public DefaultRetryState(Object key)
key
- the key to useDefaultRetryState(Object, boolean, Classifier)
public Object getKey()
RetryState
getKey
in interface RetryState
public boolean isForceRefresh()
RetryState
isForceRefresh
in interface RetryState
public boolean rollbackFor(Throwable exception)
RetryState
rollbackFor
in interface RetryState
exception
- the exception that caused a retry attempt to failCopyright © 2018 SpringSource. All rights reserved.