committed by
Mahmoud Ben Hassine
parent
89e0a0cd86
commit
29d574734f
@@ -756,10 +756,10 @@ The following example shows how to promote a step to the `Job` `ExecutionContext
|
||||
[source, java]
|
||||
----
|
||||
@Bean
|
||||
public Job job1(JobRepository jobRepository) {
|
||||
public Job job1(JobRepository jobRepository, Step step1, Step step2) {
|
||||
return new JobBuilder("job1", jobRepository)
|
||||
.start(step1())
|
||||
.next(step1())
|
||||
.start(step1)
|
||||
.next(step2)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -92,9 +92,9 @@ Java::
|
||||
[source, java]
|
||||
----
|
||||
@Bean
|
||||
public Job ioSampleJob(JobRepository jobRepository) {
|
||||
public Job ioSampleJob(JobRepository jobRepository, Step step1) {
|
||||
return new JobBuilder("ioSampleJob", jobRepository)
|
||||
.start(step1())
|
||||
.start(step1)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -196,9 +196,9 @@ Java::
|
||||
[source, java]
|
||||
----
|
||||
@Bean
|
||||
public Job ioSampleJob(JobRepository jobRepository) {
|
||||
public Job ioSampleJob(JobRepository jobRepository, Step step1) {
|
||||
return new JobBuilder("ioSampleJob", jobRepository)
|
||||
.start(step1())
|
||||
.start(step1)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ The following example shows how to inject a delegate as a stream in Java:
|
||||
[source, java]
|
||||
----
|
||||
@Bean
|
||||
public Job ioSampleJob(JobRepository jobRepository) {
|
||||
public Job ioSampleJob(JobRepository jobRepository, Step step1) {
|
||||
return new JobBuilder("ioSampleJob", jobRepository)
|
||||
.start(step1())
|
||||
.start(step1)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -426,8 +426,8 @@ as follows:
|
||||
[source, java]
|
||||
----
|
||||
@Bean
|
||||
public Step step1Manager() {
|
||||
return stepBuilderFactory.get("step1.manager")
|
||||
public Step step1Manager(JobRepository jobRepository) {
|
||||
return new StepBuilder("step1.manager", jobRepository)
|
||||
.partitioner("step1", partitioner())
|
||||
.partitionHandler(partitionHandler())
|
||||
.build();
|
||||
|
||||
@@ -140,13 +140,15 @@ The following example shows the how to add a step-level listener in Java:
|
||||
.Java Configuration
|
||||
[source, java]
|
||||
----
|
||||
public Job importPaymentsJob(JobRepository jobRepository) {
|
||||
public Job importPaymentsJob(JobRepository jobRepository, PlatformTransactionManager transactionManager) {
|
||||
return new JobBuilder("importPayments", jobRepository)
|
||||
.start(stepBuilderFactory.get("step1")
|
||||
.chunk(200)
|
||||
.start(new StepBuilder("step1", jobRepository)
|
||||
.chunk(200, transactionManager)
|
||||
.listener(notificationExecutionsListener())
|
||||
...
|
||||
// ...
|
||||
.build();
|
||||
)
|
||||
.build();
|
||||
}
|
||||
----
|
||||
|
||||
@@ -320,10 +322,10 @@ following in Java:
|
||||
.Java Configuration
|
||||
[source, java]
|
||||
----
|
||||
public Job chunkJob(JobRepository jobRepository) {
|
||||
public Job chunkJob(JobRepository jobRepository, PlatformTransactionManager transactionManager) {
|
||||
return new JobBuilder("personJob", jobRepository)
|
||||
.start(stepBuilderFactory.get("step1")
|
||||
.<Person, Person>chunk(200)
|
||||
.start(new StepBuilder("step1", jobRepository)
|
||||
.<Person, Person>chunk(200, transactionManager)
|
||||
.reader(itemReader())
|
||||
.writer(itemWriter())
|
||||
.build())
|
||||
@@ -915,7 +917,7 @@ Java:
|
||||
----
|
||||
public Job personJob(JobRepository jobRepository) {
|
||||
return new JobBuilder("personJob", jobRepository)
|
||||
.start(stepBuilderFactory.get("step1.manager")
|
||||
.start(new StepBuilder("step1.manager", jobRepository)
|
||||
.partitioner("step1.worker", partitioner())
|
||||
.partitionHandler(partitionHandler())
|
||||
.build())
|
||||
|
||||
@@ -20,9 +20,9 @@ value of 10 as it would be defined in Java:
|
||||
[source, java]
|
||||
----
|
||||
@Bean
|
||||
public Job sampleJob(JobRepository jobRepository) {
|
||||
public Job sampleJob(JobRepository jobRepository, Step step1) {
|
||||
return new JobBuilder("sampleJob", jobRepository)
|
||||
.start(step1())
|
||||
.start(step1)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -121,11 +121,11 @@ restarted:
|
||||
[source, java]
|
||||
----
|
||||
@Bean
|
||||
public Job footballJob(JobRepository jobRepository) {
|
||||
public Job footballJob(JobRepository jobRepository, Step playerLoad, Step gameLoad, Step playerSummarization) {
|
||||
return new JobBuilder("footballJob", jobRepository)
|
||||
.start(playerLoad())
|
||||
.next(gameLoad())
|
||||
.next(playerSummarization())
|
||||
.start(playerLoad)
|
||||
.next(gameLoad)
|
||||
.next(playerSummarization)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -160,9 +160,9 @@ The following example shows how to reference the `tasklet` from the `step` in Ja
|
||||
[source, java]
|
||||
----
|
||||
@Bean
|
||||
public Job taskletJob(JobRepository jobRepository) {
|
||||
public Job taskletJob(JobRepository jobRepository, Step deleteFilesInDir) {
|
||||
return new JobBuilder("taskletJob", jobRepository)
|
||||
.start(deleteFilesInDir())
|
||||
.start(deleteFilesInDir)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user