public class BatchRetryTemplate extends Object implements org.springframework.retry.RetryOperations
RetryState
used in the
execute methods is composite, and when a failure occurs, all of the keys in
the composite are "tarred with the same brush". Subsequent attempts to
execute with any of the keys that have failed previously results in a new
attempt and the previous state is used to check the RetryPolicy
. If
one of the failed items eventually succeeds then the others in the current
composite for that attempt will be cleared from the context cache (as
normal), but there may still be entries in the cache for the original failed
items. This might mean that an item that did not cause a failure is never
retried because other items in the same batch fail fatally first.Constructor and Description |
---|
BatchRetryTemplate() |
Modifier and Type | Method and Description |
---|---|
boolean |
canRetry(org.springframework.retry.RetryContext context) |
static List<org.springframework.retry.RetryState> |
createState(List<?> keys) |
static List<org.springframework.retry.RetryState> |
createState(List<?> keys,
org.springframework.classify.Classifier<? super Throwable,Boolean> classifier) |
<T> T |
execute(org.springframework.retry.RetryCallback<T> retryCallback) |
<T> T |
execute(org.springframework.retry.RetryCallback<T> retryCallback,
Collection<org.springframework.retry.RetryState> states) |
<T> T |
execute(org.springframework.retry.RetryCallback<T> retryCallback,
org.springframework.retry.RecoveryCallback<T> recoveryCallback) |
<T> T |
execute(org.springframework.retry.RetryCallback<T> retryCallback,
org.springframework.retry.RecoveryCallback<T> recoveryCallback,
Collection<org.springframework.retry.RetryState> states) |
<T> T |
execute(org.springframework.retry.RetryCallback<T> retryCallback,
org.springframework.retry.RecoveryCallback<T> recoveryCallback,
org.springframework.retry.RetryState retryState) |
<T> T |
execute(org.springframework.retry.RetryCallback<T> retryCallback,
org.springframework.retry.RetryState retryState) |
void |
registerListener(org.springframework.retry.RetryListener listener) |
void |
setBackOffPolicy(org.springframework.retry.backoff.BackOffPolicy backOffPolicy) |
void |
setListeners(org.springframework.retry.RetryListener[] listeners) |
void |
setRetryContextCache(org.springframework.retry.policy.RetryContextCache retryContextCache) |
void |
setRetryPolicy(org.springframework.retry.RetryPolicy retryPolicy) |
public <T> T execute(org.springframework.retry.RetryCallback<T> retryCallback, Collection<org.springframework.retry.RetryState> states) throws org.springframework.retry.ExhaustedRetryException, Exception
org.springframework.retry.ExhaustedRetryException
Exception
public <T> T execute(org.springframework.retry.RetryCallback<T> retryCallback, org.springframework.retry.RecoveryCallback<T> recoveryCallback, Collection<org.springframework.retry.RetryState> states) throws org.springframework.retry.ExhaustedRetryException, Exception
org.springframework.retry.ExhaustedRetryException
Exception
public final <T> T execute(org.springframework.retry.RetryCallback<T> retryCallback, org.springframework.retry.RecoveryCallback<T> recoveryCallback, org.springframework.retry.RetryState retryState) throws Exception, org.springframework.retry.ExhaustedRetryException
execute
in interface org.springframework.retry.RetryOperations
Exception
org.springframework.retry.ExhaustedRetryException
public final <T> T execute(org.springframework.retry.RetryCallback<T> retryCallback, org.springframework.retry.RecoveryCallback<T> recoveryCallback) throws Exception
execute
in interface org.springframework.retry.RetryOperations
Exception
public final <T> T execute(org.springframework.retry.RetryCallback<T> retryCallback, org.springframework.retry.RetryState retryState) throws Exception, org.springframework.retry.ExhaustedRetryException
execute
in interface org.springframework.retry.RetryOperations
Exception
org.springframework.retry.ExhaustedRetryException
public final <T> T execute(org.springframework.retry.RetryCallback<T> retryCallback) throws Exception
execute
in interface org.springframework.retry.RetryOperations
Exception
public static List<org.springframework.retry.RetryState> createState(List<?> keys, org.springframework.classify.Classifier<? super Throwable,Boolean> classifier)
public void registerListener(org.springframework.retry.RetryListener listener)
public void setBackOffPolicy(org.springframework.retry.backoff.BackOffPolicy backOffPolicy)
public void setListeners(org.springframework.retry.RetryListener[] listeners)
public void setRetryContextCache(org.springframework.retry.policy.RetryContextCache retryContextCache)
public void setRetryPolicy(org.springframework.retry.RetryPolicy retryPolicy)
public boolean canRetry(org.springframework.retry.RetryContext context)
Copyright © 2014 Pivotal. All rights reserved.