@Bean @ConditionalOnMissingBean(JobRepository.class) public JobRepository getJobRepository() throws Exception { BatchConfigurer batchConfigurer = getBatchConfigurer(); if (batchConfigurer != null) { return batchConfigurer.getJobRepository(); } JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean(); factory.setDataSource(dataSource); factory.setTransactionManager(transactionManager); factory.afterPropertiesSet(); // factory.setIsolationLevelForCreate("ISOLATION_DEFAULT"); return factory.getObject(); }
@Bean @ConditionalOnMissingBean(JobLauncher.class) public JobLauncher getJobLauncher() throws Exception { BatchConfigurer batchConfigurer = getBatchConfigurer(); if (batchConfigurer != null) { return batchConfigurer.getJobLauncher(); } return null; }
@Bean @ConditionalOnMissingBean(JobExplorer.class) public JobExplorer getJobExplorer() throws Exception { BatchConfigurer batchConfigurer = getBatchConfigurer(); if (batchConfigurer != null) { return batchConfigurer.getJobExplorer(); } JobExplorerFactoryBean jobExplorerFactoryBean = new JobExplorerFactoryBean(); jobExplorerFactoryBean.setDataSource(dataSource); return jobExplorerFactoryBean.getObject(); }
@Bean @Conditional(UseMarkLogicBatchCondition.class) public BatchConfigurer batchConfigurer( @Qualifier(value = "markLogicJobRepositoryDatabaseClientProvider") DatabaseClientProvider databaseClientProvider, BatchProperties batchProperties) { return new MarkLogicBatchConfigurer(databaseClientProvider, batchProperties); }
protected BatchConfigurer getBatchConfigurer() { if (isEmpty(this.batchConfigurers)) { return null; } return this.batchConfigurers.get(0); }
@Bean BatchConfigurer batchConfigurer() { return new DefaultBatchConfigurer(dataSource()); }
@Bean BatchConfigurer batchConfigurer(DataSource dataSource) { return new DefaultBatchConfigurer(dataSource); }
@Bean public BatchConfigurer batchConfigurer() { return new CustomBatchConfigurer(this.dataSource); }