Refine contribution #3934

* Add default methods in all listener interfaces
* Remove usage of newly deprecated support classes

Issue #3924
This commit is contained in:
Mahmoud Ben Hassine
2021-09-10 21:46:42 +02:00
parent ba0900127d
commit f85a662ebf
46 changed files with 286 additions and 372 deletions

View File

@@ -21,7 +21,7 @@ import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.listener.StepExecutionListenerSupport;
import org.springframework.batch.core.StepExecutionListener;
import org.springframework.batch.item.ItemWriter;
/**
@@ -30,9 +30,10 @@ import org.springframework.batch.item.ItemWriter;
* jobs.
*
* @author Lucas Ward
* @author Mahmoud Ben Hassine
*
*/
public class InfiniteLoopWriter extends StepExecutionListenerSupport implements ItemWriter<Object> {
public class InfiniteLoopWriter implements StepExecutionListener, ItemWriter<Object> {
private static final Log LOG = LogFactory.getLog(InfiniteLoopWriter.class);
private StepExecution stepExecution;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2019 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
package org.springframework.batch.sample.domain.trade;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.listener.StepExecutionListenerSupport;
import org.springframework.batch.core.StepExecutionListener;
import org.springframework.batch.item.file.transform.FieldSet;
import org.springframework.batch.item.file.transform.LineTokenizer;
import org.springframework.lang.Nullable;
@@ -29,9 +29,10 @@ import org.springframework.lang.Nullable;
* will delegate accordingly.
*
* @author Lucas Ward
* @author Mahmoud Ben Hassine
* @since 2.0
*/
public class CompositeCustomerUpdateLineTokenizer extends StepExecutionListenerSupport implements LineTokenizer {
public class CompositeCustomerUpdateLineTokenizer implements StepExecutionListener, LineTokenizer {
private LineTokenizer customerTokenizer;
private LineTokenizer footerTokenizer;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2019 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@ package org.springframework.batch.sample.loop;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.listener.StepExecutionListenerSupport;
import org.springframework.batch.core.StepExecutionListener;
import org.springframework.batch.sample.domain.trade.internal.GeneratingTradeItemReader;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.lang.Nullable;
@@ -28,9 +28,10 @@ import org.springframework.util.Assert;
* step.
*
* @author Dan Garrette
* @author Mahmoud Ben Hassine
* @since 2.0
*/
public class GeneratingTradeResettingListener extends StepExecutionListenerSupport implements InitializingBean {
public class GeneratingTradeResettingListener implements StepExecutionListener, InitializingBean {
private GeneratingTradeItemReader reader;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,13 +20,13 @@ import java.io.IOException;
import java.io.Writer;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.listener.StepExecutionListenerSupport;
import org.springframework.batch.core.StepExecutionListener;
import org.springframework.batch.item.file.FlatFileFooterCallback;
/**
* Writes summary info in the footer of a file.
*/
public class SummaryFooterCallback extends StepExecutionListenerSupport implements FlatFileFooterCallback{
public class SummaryFooterCallback implements StepExecutionListener, FlatFileFooterCallback{
private StepExecution stepExecution;