File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
src/main/java/org/springframework/batch/experimental/core/step/item Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1010 *
1111 * Notable difference: afterChunk is called inside the transaction, not outside the transaction.
1212 */
13- public interface ChunkListener <O > extends StepListener {
13+ public interface ChunkListener <I , O > extends StepListener {
1414
1515 /**
1616 * Callback before the chunk is processed, inside the transaction.
1717 */
18- default void beforeChunk () {
18+ default void beforeChunk (Chunk < I > chunk ) {
1919 }
2020
2121 /**
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ public boolean rollbackOn(Throwable ex) {
8484 */
8585 private final int chunkSize ;
8686 private final ChunkTracker chunkTracker = new ChunkTracker ();
87- private ChunkListener <O > chunkListener = new ChunkListener <>() {};
87+ private ChunkListener <I , O > chunkListener = new ChunkListener <>() {};
8888
8989 /*
9090 * Step state / interruption parameters
@@ -132,8 +132,8 @@ protected void doInTransactionWithoutResult(TransactionStatus status) {
132132 Chunk <I > inputChunk = new Chunk <>();
133133 Chunk <O > processedChunk = new Chunk <>();
134134 try {
135- chunkListener .beforeChunk ();
136135 inputChunk = read (contribution );
136+ chunkListener .beforeChunk (inputChunk );
137137 processedChunk = process (inputChunk , contribution );
138138 write (processedChunk , contribution );
139139 chunkListener .afterChunk (processedChunk );
@@ -243,7 +243,7 @@ public void setItemWriteListener(ItemWriteListener<O> itemWriteListener) {
243243 this .itemWriteListener = itemWriteListener ;
244244 }
245245
246- public void setChunkListener (ChunkListener <O > chunkListener ) {
246+ public void setChunkListener (ChunkListener <I , O > chunkListener ) {
247247 this .chunkListener = chunkListener ;
248248 }
249249
You can’t perform that action at this time.
0 commit comments