类 JobLauncherApplicationRunner
java.lang.Object
org.springframework.boot.autoconfigure.batch.JobLauncherApplicationRunner
public class JobLauncherApplicationRunner
extends Object
implements ApplicationRunner, InitializingBean, Ordered, ApplicationEventPublisherAware
ApplicationRunner to launch Spring Batch jobs. If a single
job is found in the context, it will be executed by default. If multiple jobs are
found, launch a specific job by providing a jobName.- 从以下版本开始:
- 2.3.0
- 作者:
- Dave Syer, Jean-Pierre Bergamin, Mahmoud Ben Hassine, Stephane Nicoll, Akshay Dubey
-
字段概要
字段从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
构造器概要
构造器构造器说明JobLauncherApplicationRunner(org.springframework.batch.core.launch.JobLauncher jobLauncher, org.springframework.batch.core.explore.JobExplorer jobExplorer, org.springframework.batch.core.repository.JobRepository jobRepository) Create a newJobLauncherApplicationRunner. -
方法概要
修饰符和类型方法说明voidprotected voidexecute(org.springframework.batch.core.Job job, org.springframework.batch.core.JobParameters jobParameters) intgetOrder()protected voidlaunchJobFromProperties(Properties properties) voidvoidrun(ApplicationArguments args) Callback used to run the bean.voidvoidsetJobName(String jobName) voidsetJobParametersConverter(org.springframework.batch.core.converter.JobParametersConverter converter) voidsetJobRegistry(org.springframework.batch.core.configuration.JobRegistry jobRegistry) voidsetJobs(Collection<org.springframework.batch.core.Job> jobs) voidsetOrder(int order) voidvalidate()已过时, 待删除: 此 API 元素将从以后的版本中删除。
-
字段详细资料
-
DEFAULT_ORDER
public static final int DEFAULT_ORDERThe default order for the command line runner.- 另请参阅:
-
-
构造器详细资料
-
JobLauncherApplicationRunner
public JobLauncherApplicationRunner(org.springframework.batch.core.launch.JobLauncher jobLauncher, org.springframework.batch.core.explore.JobExplorer jobExplorer, org.springframework.batch.core.repository.JobRepository jobRepository) Create a newJobLauncherApplicationRunner.- 参数:
jobLauncher- to launch jobsjobExplorer- to check the job repository for previous executionsjobRepository- to check if a job instance exists with the given parameters when running a job
-
-
方法详细资料
-
afterPropertiesSet
public void afterPropertiesSet()- 指定者:
afterPropertiesSet在接口中InitializingBean
-
validate
已过时, 待删除: 此 API 元素将从以后的版本中删除。 -
setOrder
public void setOrder(int order) -
getOrder
public int getOrder() -
setApplicationEventPublisher
-
setJobRegistry
@Autowired(required=false) public void setJobRegistry(org.springframework.batch.core.configuration.JobRegistry jobRegistry) -
setJobName
-
setJobParametersConverter
@Autowired(required=false) public void setJobParametersConverter(org.springframework.batch.core.converter.JobParametersConverter converter) -
setJobs
-
run
从接口复制的说明:ApplicationRunnerCallback used to run the bean.- 指定者:
run在接口中ApplicationRunner- 参数:
args- incoming application arguments- 抛出:
Exception- on error
-
run
- 抛出:
org.springframework.batch.core.JobExecutionException
-
launchJobFromProperties
protected void launchJobFromProperties(Properties properties) throws org.springframework.batch.core.JobExecutionException - 抛出:
org.springframework.batch.core.JobExecutionException
-
execute
protected 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.repository.JobExecutionAlreadyRunningExceptionorg.springframework.batch.core.repository.JobRestartExceptionorg.springframework.batch.core.repository.JobInstanceAlreadyCompleteExceptionorg.springframework.batch.core.JobParametersInvalidException
-