@@ -30,10 +30,10 @@ to address very complex processing needs.
30
30
image::spring-batch-reference-model.png[Figure 2.1: Batch Stereotypes, scaledwidth="60%"]
31
31
32
32
The preceding diagram highlights the key concepts that make up the domain language of
33
- Spring Batch. A `Job` has one to many steps, each of which has exactly one `ItemReader`,
34
- one `ItemProcessor`, and one `ItemWriter`. A job needs to be launched (with
35
- `JobLauncher`) , and metadata about the currently running process needs to be stored (in
36
- `JobRepository`) .
33
+ Spring Batch. A `Job` has one or more steps, each of which has exactly one `ItemReader`,
34
+ an optional `ItemProcessor`, and one `ItemWriter`. A job is operated (started, stopped, etc)
35
+ with a `JobOperator` , and metadata about the currently running process is stored in and
36
+ restored from a `JobRepository`.
37
37
38
38
[[job]]
39
39
== Job
@@ -183,7 +183,7 @@ This field is empty if the job has yet to start.
183
183
184
184
|`endTime`
185
185
|A `java.time.LocalDateTime` representing the current system time when the execution finished,
186
- regardless of whether or not it was successful. The field is empty if the job has yet to
186
+ regardless of whether it was successful or not . The field is empty if the job has yet to
187
187
finish.
188
188
189
189
|`exitStatus`
@@ -323,7 +323,7 @@ formatting.
323
323
324
324
A `Step` is a domain object that encapsulates an independent, sequential phase of a batch
325
325
job. Therefore, every `Job` is composed entirely of one or more steps. A `Step` contains
326
- all of the information necessary to define and control the actual batch processing. This
326
+ all the information necessary to define and control the actual batch processing. This
327
327
is a necessarily vague description because the contents of any given `Step` are at the
328
328
discretion of the developer writing a `Job`. A `Step` can be as simple or complex as the
329
329
developer desires. A simple `Step` might load data from a file into the database,
@@ -365,7 +365,7 @@ This field is empty if the step has yet to start.
365
365
|`endTime`
366
366
367
367
|A `java.time.LocalDateTime` representing the current system time when the execution finished,
368
- regardless of whether or not it was successful. This field is empty if the step has yet to
368
+ regardless of whether it was successful or not . This field is empty if the step has yet to
369
369
exit.
370
370
371
371
|`exitStatus`
@@ -569,24 +569,27 @@ with the `<job-repository>` tag, as the following example shows:
569
569
====
570
570
571
571
572
- [[joblauncher ]]
573
- == JobLauncher
572
+ [[jobOperator ]]
573
+ == JobOperator
574
574
575
- `JobLauncher ` represents a simple interface for launching a `Job` with a given set of
576
- `JobParameters` , as the following example shows:
575
+ `JobOperator ` represents a simple interface for operations like starting, stopping and restarting
576
+ jobs , as the following example shows:
577
577
578
578
[source, java]
579
579
----
580
- public interface JobLauncher {
580
+ public interface JobOperator {
581
+
582
+ JobExecution start(Job job, JobParameters jobParameters) throws Exception;
583
+ JobExecution startNextInstance(Job job) throws Exception;
584
+ boolean stop(JobExecution jobExecution) throws Exception;
585
+ JobExecution restart(JobExecution jobExecution) throws Exception;
586
+ JobExecution abandon(JobExecution jobExecution) throws Exception;
581
587
582
- public JobExecution run(Job job, JobParameters jobParameters)
583
- throws JobExecutionAlreadyRunningException, JobRestartException,
584
- JobInstanceAlreadyCompleteException, JobParametersInvalidException;
585
588
}
586
589
----
587
590
588
- It is expected that implementations obtain a valid `JobExecution` from the
589
- `JobRepository` and execute the `Job`.
591
+ A `Job` is started with a given set of `JobParameters`. It is expected that implementations obtain
592
+ a valid `JobExecution` from the `JobRepository` and execute the `Job`.
590
593
591
594
[[itemreader]]
592
595
== ItemReader
0 commit comments