OPEN - issue BATCH-777: Parametrise RetryCallback and related interfaces

RetryCallback and RecoveryCallback done
This commit is contained in:
dsyer
2008-08-25 14:06:57 +00:00
parent 919e9b5489
commit 6e36093b2e
26 changed files with 144 additions and 211 deletions

View File

@@ -86,7 +86,7 @@ public class SimpleRetryExceptionHandler extends RetryListenerSupport implements
* @see org.springframework.batch.retry.RetryListener#close(org.springframework.batch.retry.RetryContext,
* org.springframework.batch.retry.RetryCallback, java.lang.Throwable)
*/
public void close(RetryContext context, RetryCallback callback, Throwable throwable) {
public <T> void close(RetryContext context, RetryCallback<T> callback, Throwable throwable) {
if (!retryPolicy.canRetry(context)) {
getRepeatContext().setAttribute(EXHAUSTED, "true");
}

View File

@@ -432,7 +432,7 @@ public class SkipLimitStepFactoryBean<T, S> extends SimpleStepFactoryBean<T, S>
*/
private void retryChunk(final Chunk<S> chunk, final StepContribution contribution) throws Exception {
RetryCallback retryCallback = new RetryCallback() {
RetryCallback<Object> retryCallback = new RetryCallback<Object>() {
public Object doWithRetry(RetryContext context) throws Exception {
doWrite(chunk.getItems());
// TODO: if there is an exception marked as no rollback it
@@ -441,7 +441,7 @@ public class SkipLimitStepFactoryBean<T, S> extends SimpleStepFactoryBean<T, S>
}
};
RecoveryCallback recoveryCallback = new RecoveryCallback() {
RecoveryCallback<Object> recoveryCallback = new RecoveryCallback<Object>() {
public Object recover(RetryContext context) throws Exception {