Add AbstractTaskletStepBuilder copy constructor
This commit includes tests for the copy constructor
of AbstractTaskletStepBuilder and for the faultTolerant
method, specifically after taskExecutor has been set.
(cherry picked from commit b9ba8ffb86)
This commit is contained in:
committed by
Mahmoud Ben Hassine
parent
3c46ab86cd
commit
d2fa9fe831
@@ -49,6 +49,7 @@ import org.springframework.transaction.interceptor.TransactionAttribute;
|
||||
* @author Dave Syer
|
||||
* @author Michael Minella
|
||||
* @author Mahmoud Ben Hassine
|
||||
* @author Ilpyo Yang
|
||||
* @since 2.2
|
||||
* @param <B> the type of builder represented
|
||||
*/
|
||||
@@ -74,6 +75,23 @@ public abstract class AbstractTaskletStepBuilder<B extends AbstractTaskletStepBu
|
||||
super(parent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new builder initialized with any properties in the parent. The parent is
|
||||
* copied, so it can be re-used.
|
||||
* @param parent a parent helper containing common step properties
|
||||
*/
|
||||
public AbstractTaskletStepBuilder(AbstractTaskletStepBuilder<?> parent) {
|
||||
super(parent);
|
||||
this.chunkListeners = parent.chunkListeners;
|
||||
this.stepOperations = parent.stepOperations;
|
||||
this.transactionManager = parent.transactionManager;
|
||||
this.transactionAttribute = parent.transactionAttribute;
|
||||
this.streams.addAll(parent.streams);
|
||||
this.exceptionHandler = parent.exceptionHandler;
|
||||
this.throttleLimit = parent.throttleLimit;
|
||||
this.taskExecutor = parent.taskExecutor;
|
||||
}
|
||||
|
||||
protected abstract Tasklet createTasklet();
|
||||
|
||||
/**
|
||||
|
||||
@@ -114,7 +114,6 @@ public class SimpleStepBuilder<I, O> extends AbstractTaskletStepBuilder<SimpleSt
|
||||
this.itemListeners = parent.itemListeners;
|
||||
this.readerTransactionalQueue = parent.readerTransactionalQueue;
|
||||
this.meterRegistry = parent.meterRegistry;
|
||||
this.transactionManager(parent.getTransactionManager());
|
||||
}
|
||||
|
||||
public FaultTolerantStepBuilder<I, O> faultTolerant() {
|
||||
|
||||
Reference in New Issue
Block a user