@Component public class JobLauncherCommandLineRunner extends Object implements CommandLineRunner, ApplicationEventPublisherAware
CommandLineRunner to launch Spring Batch jobs. Runs all
jobs in the surrounding context by default. Can also be used to launch a specific job
by providing a jobName| Constructor and Description |
|---|
JobLauncherCommandLineRunner(org.springframework.batch.core.launch.JobLauncher jobLauncher,
org.springframework.batch.core.explore.JobExplorer jobExplorer) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
execute(org.springframework.batch.core.Job job,
org.springframework.batch.core.JobParameters jobParameters) |
protected void |
launchJobFromProperties(Properties properties) |
void |
run(String... args)
Callback used to run the bean.
|
void |
setApplicationEventPublisher(ApplicationEventPublisher publisher) |
void |
setJobNames(String jobNames) |
void |
setJobParametersConverter(org.springframework.batch.core.converter.JobParametersConverter converter) |
void |
setJobRegistry(org.springframework.batch.core.configuration.JobRegistry jobRegistry) |
void |
setJobs(Collection<org.springframework.batch.core.Job> jobs) |
public JobLauncherCommandLineRunner(org.springframework.batch.core.launch.JobLauncher jobLauncher,
org.springframework.batch.core.explore.JobExplorer jobExplorer)
public void setJobNames(String jobNames)
public void setApplicationEventPublisher(ApplicationEventPublisher publisher)
setApplicationEventPublisher in interface ApplicationEventPublisherAware@Autowired(required=false) public void setJobRegistry(org.springframework.batch.core.configuration.JobRegistry jobRegistry)
@Autowired(required=false) public void setJobParametersConverter(org.springframework.batch.core.converter.JobParametersConverter converter)
@Autowired(required=false) public void setJobs(Collection<org.springframework.batch.core.Job> jobs)
public void run(String... args) throws org.springframework.batch.core.JobExecutionException
CommandLineRunnerrun in interface CommandLineRunnerargs - incoming main method argumentsorg.springframework.batch.core.JobExecutionExceptionprotected void launchJobFromProperties(Properties properties) throws org.springframework.batch.core.JobExecutionException
org.springframework.batch.core.JobExecutionExceptionprotected void execute(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,
org.springframework.batch.core.launch.JobParametersNotFoundException
org.springframework.batch.core.repository.JobExecutionAlreadyRunningExceptionorg.springframework.batch.core.repository.JobRestartExceptionorg.springframework.batch.core.repository.JobInstanceAlreadyCompleteExceptionorg.springframework.batch.core.JobParametersInvalidExceptionorg.springframework.batch.core.launch.JobParametersNotFoundExceptionCopyright © 2015 Pivotal Software, Inc.. All rights reserved.