File tree Expand file tree Collapse file tree 3 files changed +21
-13
lines changed
spring-batch-core/src/main/java/org/springframework/batch/core Expand file tree Collapse file tree 3 files changed +21
-13
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2006-2018 the original author or authors.
2
+ * Copyright 2006-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
25
25
* @author Lucas Ward
26
26
* @author Michael Minella
27
27
* @author Mahmoud Ben Hassine
28
- *
28
+ * @author Parikshit Dutta
29
29
*/
30
30
public interface ChunkListener extends StepListener {
31
31
@@ -36,14 +36,16 @@ public interface ChunkListener extends StepListener {
36
36
*
37
37
* @param context The current {@link ChunkContext}
38
38
*/
39
- void beforeChunk (ChunkContext context );
39
+ default void beforeChunk (ChunkContext context ) {
40
+ }
40
41
41
42
/**
42
43
* Callback after the chunk is executed, outside the transaction.
43
44
*
44
45
* @param context The current {@link ChunkContext}
45
46
*/
46
- void afterChunk (ChunkContext context );
47
+ default void afterChunk (ChunkContext context ) {
48
+ }
47
49
48
50
/**
49
51
* Callback after a chunk has been marked for rollback. It is invoked
@@ -57,5 +59,6 @@ public interface ChunkListener extends StepListener {
57
59
* @param context the chunk context containing the exception that caused
58
60
* the underlying rollback.
59
61
*/
60
- void afterChunkError (ChunkContext context );
62
+ default void afterChunkError (ChunkContext context ) {
63
+ }
61
64
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2006-2013 the original author or authors.
2
+ * Copyright 2006-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
22
22
* instances themselves are not used by more than one thread.
23
23
*
24
24
* @author Dave Syer
25
- *
25
+ * @author Parikshit Dutta
26
26
*/
27
27
public interface JobExecutionListener {
28
28
@@ -31,7 +31,8 @@ public interface JobExecutionListener {
31
31
*
32
32
* @param jobExecution the current {@link JobExecution}
33
33
*/
34
- void beforeJob (JobExecution jobExecution );
34
+ default void beforeJob (JobExecution jobExecution ) {
35
+ }
35
36
36
37
/**
37
38
* Callback after completion of a job. Called after both both successful and
@@ -40,6 +41,7 @@ public interface JobExecutionListener {
40
41
*
41
42
* @param jobExecution the current {@link JobExecution}
42
43
*/
43
- void afterJob (JobExecution jobExecution );
44
+ default void afterJob (JobExecution jobExecution ) {
45
+ }
44
46
45
47
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2006-2018 the original author or authors.
2
+ * Copyright 2006-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
23
23
* @author Lucas Ward
24
24
* @author Dave Syer
25
25
* @author Mahmoud Ben Hassine
26
- *
26
+ * @author Parikshit Dutta
27
27
*/
28
28
public interface StepExecutionListener extends StepListener {
29
29
@@ -33,7 +33,8 @@ public interface StepExecutionListener extends StepListener {
33
33
*
34
34
* @param stepExecution instance of {@link StepExecution}.
35
35
*/
36
- void beforeStep (StepExecution stepExecution );
36
+ default void beforeStep (StepExecution stepExecution ) {
37
+ }
37
38
38
39
/**
39
40
* Give a listener a chance to modify the exit status from a step. The value
@@ -49,5 +50,7 @@ public interface StepExecutionListener extends StepListener {
49
50
* {@code null} to leave the old value unchanged.
50
51
*/
51
52
@ Nullable
52
- ExitStatus afterStep (StepExecution stepExecution );
53
+ default ExitStatus afterStep (StepExecution stepExecution ) {
54
+ return null ;
55
+ }
53
56
}
You can’t perform that action at this time.
0 commit comments