Class JobLauncherWithAdditionalRestartCapabilities

  • All Implemented Interfaces:
    org.springframework.batch.core.launch.JobLauncher, org.springframework.beans.factory.InitializingBean

    public class JobLauncherWithAdditionalRestartCapabilities
    extends org.springframework.batch.core.launch.support.SimpleJobLauncher
    JobLauncher that extends the functionality provided by the standard SimpleJobLauncher:

    For batches, which always restart from scratch (i.e. those marked with restartable="false"), the parameter's are 'incremented' automatically using the JobParametersIncrementer from the job (usually by adding or modifying the 'run.id' parameter). It is actually just a convenience functionality so that the one starting batches does not have to change the parameters manually.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.springframework.batch.core.repository.JobRepository jobRepository  
      • Fields inherited from class org.springframework.batch.core.launch.support.SimpleJobLauncher

        logger
    • Field Detail

      • jobRepository

        private org.springframework.batch.core.repository.JobRepository jobRepository
    • Constructor Detail

      • JobLauncherWithAdditionalRestartCapabilities

        public JobLauncherWithAdditionalRestartCapabilities()
    • Method Detail

      • run

        public org.springframework.batch.core.JobExecution run​(org.springframework.batch.core.Job job,
                                                               org.springframework.batch.core.JobParameters jobParameters)
                                                        throws org.springframework.batch.core.repository.JobExecutionAlreadyRunningException,
                                                               org.springframework.batch.core.repository.JobRestartException,
                                                               org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException,
                                                               org.springframework.batch.core.JobParametersInvalidException
        Specified by:
        run in interface org.springframework.batch.core.launch.JobLauncher
        Overrides:
        run in class org.springframework.batch.core.launch.support.SimpleJobLauncher
        Throws:
        org.springframework.batch.core.repository.JobExecutionAlreadyRunningException
        org.springframework.batch.core.repository.JobRestartException
        org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException
        org.springframework.batch.core.JobParametersInvalidException
      • setJobRepository

        public void setJobRepository​(org.springframework.batch.core.repository.JobRepository jobRepository)
        Overrides:
        setJobRepository in class org.springframework.batch.core.launch.support.SimpleJobLauncher