类org.springframework.boot.autoconfigure.batch.BatchProperties源码实例Demo

下面列出了怎么用org.springframework.boot.autoconfigure.batch.BatchProperties的API类实例代码及写法,或者点击链接到github查看源代码。

public TaskJobLauncherCommandLineRunnerFactoryBean(JobLauncher jobLauncher,
		JobExplorer jobExplorer, List<Job> jobs,
		TaskBatchProperties taskBatchProperties, JobRegistry jobRegistry,
		JobRepository jobRepository, BatchProperties batchProperties) {
	Assert.notNull(taskBatchProperties, "taskBatchProperties must not be null");
	Assert.notNull(batchProperties, "batchProperties must not be null");
	this.jobLauncher = jobLauncher;
	this.jobExplorer = jobExplorer;
	Assert.notEmpty(jobs, "jobs must not be null nor empty");
	this.jobs = jobs;
	this.jobNames = taskBatchProperties.getJobNames();
	this.jobRegistry = jobRegistry;
	this.taskBatchProperties = taskBatchProperties;
	if (StringUtils.hasText(batchProperties.getJob().getNames())) {
		this.jobNames = batchProperties.getJob().getNames();
	}
	else {
		this.jobNames = taskBatchProperties.getJobNames();
	}
	this.order = taskBatchProperties.getCommandLineRunnerOrder();
	this.jobRepository = jobRepository;
}
 
@Bean
public TaskJobLauncherCommandLineRunnerFactoryBean jobLauncherCommandLineRunner(
		JobLauncher jobLauncher, JobExplorer jobExplorer, List<Job> jobs,
		JobRegistry jobRegistry, JobRepository jobRepository,
		BatchProperties batchProperties) {
	TaskJobLauncherCommandLineRunnerFactoryBean taskJobLauncherCommandLineRunnerFactoryBean;
	taskJobLauncherCommandLineRunnerFactoryBean = new TaskJobLauncherCommandLineRunnerFactoryBean(
			jobLauncher, jobExplorer, jobs, this.properties, jobRegistry,
			jobRepository, batchProperties);

	return taskJobLauncherCommandLineRunnerFactoryBean;
}
 
@Bean
public BatchConfigurer getComposedBatchConfigurer(BatchProperties properties, DataSource dataSource, TransactionManagerCustomizers transactionManagerCustomizers) {
	return new ComposedBatchConfigurer(properties, dataSource, transactionManagerCustomizers);
}
 
@Bean
public BatchConfigurer getComposedBatchConfigurer(BatchProperties properties, DataSource dataSource, TransactionManagerCustomizers transactionManagerCustomizers) {
	return new org.springframework.cloud.dataflow.composedtaskrunner.ComposedBatchConfigurer(properties, dataSource, transactionManagerCustomizers);
}
 
源代码5 项目: spring-cloud-dataflow   文件: JobDependencies.java
@Bean
public BatchDataSourceInitializer batchRepositoryInitializerForDefaultDBForServer(DataSource dataSource,
		ResourceLoader resourceLoader, BatchProperties properties) {
	return new BatchDataSourceInitializer(dataSource, resourceLoader, properties);
}
 
/**
 * Create a new {@link BasicBatchConfigurer} instance.
 *
 * @param properties                    the batch properties
 * @param dataSource                    the underlying data source
 * @param transactionManagerCustomizers transaction manager customizers (or
 *                                      {@code null})
 */
protected ComposedBatchConfigurer(BatchProperties properties, DataSource dataSource, TransactionManagerCustomizers transactionManagerCustomizers) {
	super(properties, dataSource, transactionManagerCustomizers);
}
 
/**
 * Create a new {@link BasicBatchConfigurer} instance.
 *
 * @param properties                    the batch properties
 * @param dataSource                    the underlying data source
 * @param transactionManagerCustomizers transaction manager customizers (or
 *                                      {@code null})
 */
protected ComposedBatchConfigurer(BatchProperties properties, DataSource dataSource, TransactionManagerCustomizers transactionManagerCustomizers) {
	super(properties, dataSource, transactionManagerCustomizers);
}
 
 同包方法