OPEN - issue BATCH-777: Parametrise RetryCallback and related interfaces
Remove unused Exception throws clauses
This commit is contained in:
@@ -58,9 +58,7 @@ public interface RetryPolicy {
|
||||
*
|
||||
* @param context the current status object.
|
||||
*
|
||||
* @throws TerminatedRetryException if the status is set to terminate only.
|
||||
*
|
||||
*/
|
||||
void registerThrowable(RetryContext context, Exception throwable) throws TerminatedRetryException;
|
||||
void registerThrowable(RetryContext context, Exception throwable);
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.List;
|
||||
|
||||
import org.springframework.batch.retry.RetryContext;
|
||||
import org.springframework.batch.retry.RetryPolicy;
|
||||
import org.springframework.batch.retry.TerminatedRetryException;
|
||||
import org.springframework.batch.retry.context.RetryContextSupport;
|
||||
|
||||
/**
|
||||
@@ -108,7 +107,7 @@ public class CompositeRetryPolicy implements RetryPolicy {
|
||||
*
|
||||
* @see org.springframework.batch.retry.RetryPolicy#close(org.springframework.batch.retry.RetryContext, boolean)
|
||||
*/
|
||||
public void registerThrowable(RetryContext context, Exception throwable) throws TerminatedRetryException {
|
||||
public void registerThrowable(RetryContext context, Exception throwable) {
|
||||
RetryContext[] contexts = ((CompositeRetryContext) context).contexts;
|
||||
RetryPolicy[] policies = ((CompositeRetryContext) context).policies;
|
||||
for (int i = 0; i < contexts.length; i++) {
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.Map;
|
||||
|
||||
import org.springframework.batch.retry.RetryContext;
|
||||
import org.springframework.batch.retry.RetryPolicy;
|
||||
import org.springframework.batch.retry.TerminatedRetryException;
|
||||
import org.springframework.batch.retry.context.RetryContextSupport;
|
||||
import org.springframework.batch.support.Classifier;
|
||||
import org.springframework.batch.support.ExceptionClassifierSupport;
|
||||
@@ -103,7 +102,7 @@ public class ExceptionClassifierRetryPolicy implements RetryPolicy {
|
||||
* @see org.springframework.batch.retry.RetryPolicy#registerThrowable(org.springframework.batch.retry.RetryContext,
|
||||
* Exception)
|
||||
*/
|
||||
public void registerThrowable(RetryContext context, Exception throwable) throws TerminatedRetryException {
|
||||
public void registerThrowable(RetryContext context, Exception throwable) {
|
||||
RetryPolicy policy = (RetryPolicy) context;
|
||||
policy.registerThrowable(context, throwable);
|
||||
((RetryContextSupport) context).registerThrowable(throwable);
|
||||
@@ -148,7 +147,7 @@ public class ExceptionClassifierRetryPolicy implements RetryPolicy {
|
||||
return this;
|
||||
}
|
||||
|
||||
public void registerThrowable(RetryContext context, Exception throwable) throws TerminatedRetryException {
|
||||
public void registerThrowable(RetryContext context, Exception throwable) {
|
||||
policy = getPolicy(exceptionClassifier.classify(throwable));
|
||||
this.context = getContext(policy);
|
||||
policy.registerThrowable(this.context, throwable);
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.springframework.batch.retry.policy;
|
||||
|
||||
import org.springframework.batch.retry.RetryContext;
|
||||
import org.springframework.batch.retry.RetryPolicy;
|
||||
import org.springframework.batch.retry.TerminatedRetryException;
|
||||
import org.springframework.batch.retry.context.RetryContextSupport;
|
||||
|
||||
/**
|
||||
@@ -65,7 +64,7 @@ public class NeverRetryPolicy implements RetryPolicy {
|
||||
* @see org.springframework.batch.retry.RetryPolicy#registerThrowable(org.springframework.batch.retry.RetryContext,
|
||||
* Exception)
|
||||
*/
|
||||
public void registerThrowable(RetryContext context, Exception throwable) throws TerminatedRetryException {
|
||||
public void registerThrowable(RetryContext context, Exception throwable) {
|
||||
((NeverRetryContext) context).setFinished();
|
||||
((RetryContextSupport) context).registerThrowable(throwable);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.springframework.batch.retry.policy;
|
||||
|
||||
import org.springframework.batch.retry.RetryContext;
|
||||
import org.springframework.batch.retry.RetryPolicy;
|
||||
import org.springframework.batch.retry.TerminatedRetryException;
|
||||
import org.springframework.batch.retry.context.RetryContextSupport;
|
||||
|
||||
/**
|
||||
@@ -62,7 +61,7 @@ public class TimeoutRetryPolicy implements RetryPolicy {
|
||||
return new TimeoutRetryContext(parent, timeout);
|
||||
}
|
||||
|
||||
public void registerThrowable(RetryContext context, Exception throwable) throws TerminatedRetryException {
|
||||
public void registerThrowable(RetryContext context, Exception throwable) {
|
||||
((RetryContextSupport) context).registerThrowable(throwable);
|
||||
// otherwise no-op - we only time out, otherwise retry everything...
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ public class RetryTemplate implements RetryOperations {
|
||||
* @see org.springframework.batch.retry.RetryOperations#execute(org.springframework.batch.retry.RetryCallback)
|
||||
*
|
||||
* @throws TerminatedRetryException if the retry has been manually
|
||||
* terminated through the {@link RetryContext}.
|
||||
* terminated by a listener.
|
||||
*/
|
||||
public final <T> T execute(RetryCallback<T> retryCallback) throws Exception {
|
||||
return doExecute(retryCallback, null, null);
|
||||
@@ -148,7 +148,7 @@ public class RetryTemplate implements RetryOperations {
|
||||
* org.springframework.batch.retry.RecoveryCallback)
|
||||
*
|
||||
* @throws TerminatedRetryException if the retry has been manually
|
||||
* terminated through the {@link RetryContext}.
|
||||
* terminated by a listener.
|
||||
*/
|
||||
public final <T> T execute(RetryCallback<T> retryCallback, RecoveryCallback<T> recoveryCallback) throws Exception {
|
||||
return doExecute(retryCallback, recoveryCallback, null);
|
||||
|
||||
Reference in New Issue
Block a user