Skip to content

Commit 219fee3

Browse files
committed
Update documentation
1 parent 1141975 commit 219fee3

File tree

10 files changed

+346
-298
lines changed

10 files changed

+346
-298
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultBatchConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
*
8282
* <pre class="code">
8383
* &#064;Configuration
84-
* public class MyJobConfiguration extends AbstractBatchConfiguration {
84+
* public class MyJobConfiguration extends DefaultBatchConfiguration {
8585
*
8686
* &#064;Bean
8787
* public Job job(JobRepository jobRepository) {

spring-batch-docs/src/main/asciidoc/common-patterns.adoc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ The following example shows how to register a listener with a step Java:
7474
[source, java, role="javaContent"]
7575
----
7676
@Bean
77-
public Step simpleStep() {
78-
return this.stepBuilderFactory.get("simpleStep")
77+
public Step simpleStep(JobRepository jobRepository) {
78+
return new StepBuilder("simpleStep", jobRepository)
7979
...
8080
.listener(new ItemFailureLoggerListener())
8181
.build();
@@ -163,9 +163,9 @@ The following example shows how to inject a completion policy into a step in Jav
163163
[source, java, role="javaContent"]
164164
----
165165
@Bean
166-
public Step simpleStep() {
167-
return this.stepBuilderFactory.get("simpleStep")
168-
.<String, String>chunk(new SpecialCompletionPolicy())
166+
public Step simpleStep(JobRepository jobRepository, PlatformTransactionManager transactionManager) {
167+
return new StepBuilder("simpleStep", jobRepository)
168+
.<String, String>chunk(new SpecialCompletionPolicy(), transactionManager)
169169
.reader(reader())
170170
.writer(writer())
171171
.build();
@@ -724,17 +724,17 @@ The following example shows how to promote a step to the `Job` `ExecutionContext
724724
[source, java, role="javaContent"]
725725
----
726726
@Bean
727-
public Job job1() {
728-
return this.jobBuilderFactory.get("job1")
727+
public Job job1(JobRepository jobRepository) {
728+
return new JobBuilder("job1", jobRepository)
729729
.start(step1())
730730
.next(step1())
731731
.build();
732732
}
733733
734734
@Bean
735-
public Step step1() {
736-
return this.stepBuilderFactory.get("step1")
737-
.<String, String>chunk(10)
735+
public Step step1(JobRepository jobRepository, PlatformTransactionManager transactionManager) {
736+
return tnew StepBuilder("step1", jobRepository)
737+
.<String, String>chunk(10, transactionManager)
738738
.reader(reader())
739739
.writer(savingWriter())
740740
.listener(promotionListener())

spring-batch-docs/src/main/asciidoc/domain.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ example shows:
7272
[source, java, role="javaContent"]
7373
----
7474
@Bean
75-
public Job footballJob() {
76-
return this.jobBuilderFactory.get("footballJob")
75+
public Job footballJob(JobRepository jobRepository) {
76+
return new JobBuilder("footballJob", jobRepository)
7777
.start(playerLoad())
7878
.next(gameLoad())
7979
.next(playerSummarization())
@@ -111,8 +111,8 @@ instantiation of a `Job`, as the following example shows:
111111
[source, java]
112112
----
113113
@Bean
114-
public Job footballJob() {
115-
return this.jobBuilderFactory.get("footballJob")
114+
public Job footballJob(JobRepository jobRepository) {
115+
return new JobBuilder("footballJob", jobRepository)
116116
.start(playerLoad())
117117
.next(gameLoad())
118118
.next(playerSummarization())

0 commit comments

Comments
 (0)