org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean Java Examples
The following examples show how to use
org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultSpringBatchLightminBatchConfigurer.java From spring-batch-lightmin with Apache License 2.0 | 6 votes |
protected void createMapComponents() throws Exception { if (this.transactionManager == null) { this.transactionManager = new ResourcelessTransactionManager(); } // jobRepository final MapJobRepositoryFactoryBean jobRepositoryFactory = new MapJobRepositoryFactoryBean( this.transactionManager); jobRepositoryFactory.afterPropertiesSet(); this.jobRepository = jobRepositoryFactory.getObject(); // jobExplorer final MapJobExplorerFactoryBean jobExplorerFactory = new MapJobExplorerFactoryBean( jobRepositoryFactory); jobExplorerFactory.afterPropertiesSet(); this.jobExplorer = jobExplorerFactory.getObject(); // jobExecutionDao this.jobExecutionDao = new MapJobExecutionDao(); // jobInstanceDao this.jobInstanceDao = new MapJobInstanceDao(); // stepExecutionDao this.stepExecutionDao = new MapStepExecutionDao(); }
Example #2
Source File: MapLightminJobExecutionDaoTest.java From spring-batch-lightmin with Apache License 2.0 | 6 votes |
@Before public void init() throws Exception { final MapJobRepositoryFactoryBean mapJobRepositoryFactoryBean = new MapJobRepositoryFactoryBean(); mapJobRepositoryFactoryBean.getObject(); this.jobExecutionDao = mapJobRepositoryFactoryBean.getJobExecutionDao(); this.jobInstanceDao = mapJobRepositoryFactoryBean.getJobInstanceDao(); final MapJobExplorerFactoryBean mapJobExplorerFactoryBean = new MapJobExplorerFactoryBean( mapJobRepositoryFactoryBean); this.jobExplorer = mapJobExplorerFactoryBean.getObject(); this.mapLightminJobExecutionDao = new MapLightminJobExecutionDao(this.jobExplorer); this.jobInstance = this.jobInstanceDao.createJobInstance("someJob", new JobParametersBuilder().toJobParameters()); final List<JobExecution> jobExecutions = DomainTestHelper.createJobExecutions(JOB_EXECUTION_COUNT); for (final JobExecution jobExecution : jobExecutions) { jobExecution.setId(null); jobExecution.setJobInstance(this.jobInstance); this.jobExecutionDao.saveJobExecution(jobExecution); } }
Example #3
Source File: SpringBatchConfiguration.java From spring-cloud with Apache License 2.0 | 5 votes |
@PostConstruct public void initialize() { try { if (dataSource == null) { log.warn("No datasource was provided...using a Map based JobRepository"); if (this.transactionManager == null) { this.transactionManager = new ResourcelessTransactionManager(); } MapJobRepositoryFactoryBean jobRepositoryFactory = new MapJobRepositoryFactoryBean( this.transactionManager); jobRepositoryFactory.afterPropertiesSet(); this.jobRepository = jobRepositoryFactory.getObject(); MapJobExplorerFactoryBean jobExplorerFactory = new MapJobExplorerFactoryBean( jobRepositoryFactory); jobExplorerFactory.afterPropertiesSet(); this.jobExplorer = jobExplorerFactory.getObject(); } else { this.jobRepository = createJobRepository(); JobExplorerFactoryBean jobExplorerFactoryBean = new JobExplorerFactoryBean(); jobExplorerFactoryBean.setDataSource(this.dataSource); jobExplorerFactoryBean.afterPropertiesSet(); this.jobExplorer = jobExplorerFactoryBean.getObject(); } this.jobLauncher = createJobLauncher(); } catch (Exception e) { throw new BatchConfigurationException(e); } }
Example #4
Source File: ApplicationConfiguration.java From blackduck-alert with Apache License 2.0 | 5 votes |
@Bean public MapJobRepositoryFactoryBean mapJobRepositoryFactory() throws Exception { MapJobRepositoryFactoryBean factory = new MapJobRepositoryFactoryBean(transactionManager()); factory.afterPropertiesSet(); return factory; }
Example #5
Source File: TaskExecutorBatchConfiguration.java From spring-boot-starter-batch-web with Apache License 2.0 | 5 votes |
@PostConstruct public void initialize() throws Exception { if (dataSource == null) { LOGGER.warn("No datasource was provided...using a Map based JobRepository"); if (this.transactionManager == null) { this.transactionManager = new ResourcelessTransactionManager(); } MapJobRepositoryFactoryBean jobRepositoryFactory = new MapJobRepositoryFactoryBean(this.transactionManager); jobRepositoryFactory.afterPropertiesSet(); this.jobRepository = jobRepositoryFactory.getObject(); MapJobExplorerFactoryBean jobExplorerFactory = new MapJobExplorerFactoryBean(jobRepositoryFactory); jobExplorerFactory.afterPropertiesSet(); this.jobExplorer = jobExplorerFactory.getObject(); } else { if (this.transactionManager == null) { this.transactionManager = new DataSourceTransactionManager(dataSource); } this.jobRepository = createJobRepository(); JobExplorerFactoryBean jobExplorerFactoryBean = new JobExplorerFactoryBean(); jobExplorerFactoryBean.setDataSource(this.dataSource); jobExplorerFactoryBean.setSerializer(serializer); String tablePrefix = batchConfig.getRepository().getTablePrefix(); if (tablePrefix != null) { jobExplorerFactoryBean.setTablePrefix(tablePrefix); } jobExplorerFactoryBean.afterPropertiesSet(); this.jobExplorer = jobExplorerFactoryBean.getObject(); } this.jobLauncher = createJobLauncher(); }
Example #6
Source File: JpaBatchConfigurer.java From spring4-sandbox with Apache License 2.0 | 5 votes |
@PostConstruct public void initialize() { try { if (dataSource == null) { logger.warn("No datasource was provided...using a Map based JobRepository"); if (this.transactionManager == null) { this.transactionManager = new ResourcelessTransactionManager(); } MapJobRepositoryFactoryBean jobRepositoryFactory = new MapJobRepositoryFactoryBean( this.transactionManager); jobRepositoryFactory.afterPropertiesSet(); this.jobRepository = jobRepositoryFactory.getObject(); MapJobExplorerFactoryBean jobExplorerFactory = new MapJobExplorerFactoryBean( jobRepositoryFactory); jobExplorerFactory.afterPropertiesSet(); this.jobExplorer = jobExplorerFactory.getObject(); } else { this.jobRepository = createJobRepository(); JobExplorerFactoryBean jobExplorerFactoryBean = new JobExplorerFactoryBean(); jobExplorerFactoryBean.setDataSource(this.dataSource); jobExplorerFactoryBean.afterPropertiesSet(); this.jobExplorer = jobExplorerFactoryBean.getObject(); } this.jobLauncher = createJobLauncher(); } catch (Exception e) { throw new BatchConfigurationException(e); } }
Example #7
Source File: SpringBatchScheduler.java From tutorials with MIT License | 4 votes |
@Bean public JobRepository jobRepository() throws Exception { MapJobRepositoryFactoryBean factory = new MapJobRepositoryFactoryBean(); factory.setTransactionManager(new ResourcelessTransactionManager()); return (JobRepository) factory.getObject(); }
Example #8
Source File: TaskletsConfig.java From tutorials with MIT License | 4 votes |
@Bean public JobRepository jobRepository() throws Exception { MapJobRepositoryFactoryBean factory = new MapJobRepositoryFactoryBean(); factory.setTransactionManager(transactionManager()); return (JobRepository) factory.getObject(); }
Example #9
Source File: ChunksConfig.java From tutorials with MIT License | 4 votes |
@Bean public JobRepository jobRepository() throws Exception { MapJobRepositoryFactoryBean factory = new MapJobRepositoryFactoryBean(); factory.setTransactionManager(transactionManager()); return (JobRepository) factory.getObject(); }