@@ -30,10 +30,10 @@ to address very complex processing needs.
3030image::spring-batch-reference-model.png[Figure 2.1: Batch Stereotypes, scaledwidth="60%"]
3131
3232The 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`.
3737
3838[[job]]
3939== Job
@@ -183,7 +183,7 @@ This field is empty if the job has yet to start.
183183
184184|`endTime`
185185|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
187187finish.
188188
189189|`exitStatus`
@@ -323,7 +323,7 @@ formatting.
323323
324324A `Step` is a domain object that encapsulates an independent, sequential phase of a batch
325325job. 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
327327is a necessarily vague description because the contents of any given `Step` are at the
328328discretion of the developer writing a `Job`. A `Step` can be as simple or complex as the
329329developer 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.
365365|`endTime`
366366
367367|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
369369exit.
370370
371371|`exitStatus`
@@ -569,24 +569,27 @@ with the `<job-repository>` tag, as the following example shows:
569569====
570570
571571
572- [[joblauncher ]]
573- == JobLauncher
572+ [[jobOperator ]]
573+ == JobOperator
574574
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:
577577
578578[source, java]
579579----
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;
581587
582- public JobExecution run(Job job, JobParameters jobParameters)
583- throws JobExecutionAlreadyRunningException, JobRestartException,
584- JobInstanceAlreadyCompleteException, JobParametersInvalidException;
585588}
586589----
587590
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`.
590593
591594[[itemreader]]
592595== ItemReader
0 commit comments