Skip to content

Commit ec5f814

Browse files
committed
Add AbstractTaskletStepBuilder copy constructor
1 parent 5712b8a commit ec5f814

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/AbstractTaskletStepBuilder.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
* @author Dave Syer
5050
* @author Michael Minella
5151
* @author Mahmoud Ben Hassine
52+
* @author Ilpyo Yang
5253
* @since 2.2
5354
* @param <B> the type of builder represented
5455
*/
@@ -74,6 +75,23 @@ public AbstractTaskletStepBuilder(StepBuilderHelper<?> parent) {
7475
super(parent);
7576
}
7677

78+
/**
79+
* Create a new builder initialized with any properties in the parent. The parent is
80+
* copied, so it can be re-used.
81+
* @param parent a parent helper containing common step properties
82+
*/
83+
public AbstractTaskletStepBuilder(AbstractTaskletStepBuilder<?> parent) {
84+
super(parent);
85+
this.chunkListeners = parent.chunkListeners;
86+
this.stepOperations = parent.stepOperations;
87+
this.transactionManager = parent.transactionManager;
88+
this.transactionAttribute = parent.transactionAttribute;
89+
this.streams.addAll(parent.streams);
90+
this.exceptionHandler = parent.exceptionHandler;
91+
this.throttleLimit = parent.throttleLimit;
92+
this.taskExecutor = parent.taskExecutor;
93+
}
94+
7795
protected abstract Tasklet createTasklet();
7896

7997
/**

0 commit comments

Comments
 (0)