Java Examples for org.springframework.batch.core.repository.support.JobRepositoryFactoryBean

The following java examples will help you to understand the usage of org.springframework.batch.core.repository.support.JobRepositoryFactoryBean. These source code samples are taken from different open source projects.

Example 1
Project: spring-xd-master  File: RuntimeBatchConfigurer.java View source code
protected JobRepository createJobRepository() throws Exception {
    JobRepositoryFactoryBean factory = createJobRepositoryFactoryBean();
    factory.setDataSource(dataSource);
    if (dbType != null) {
        factory.setDatabaseType(dbType);
    }
    if (clobType != null) {
        factory.setClobType(clobType);
    }
    factory.setTransactionManager(transactionManager);
    factory.setIsolationLevelForCreate(isolationLevel);
    factory.setMaxVarCharLength(maxVarCharLength);
    factory.setTablePrefix(tablePrefix);
    factory.setValidateTransactionState(validateTransactionState);
    factory.afterPropertiesSet();
    return factory.getObject();
}
Example 2
Project: spring4-sandbox-master  File: JpaBatchConfigurer.java View source code
protected JobRepository createJobRepository() throws Exception {
    JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
    factory.setIsolationLevelForCreate("ISOLATION_SERIALIZABLE");
    factory.setDataSource(dataSource);
    factory.setTransactionManager(transactionManager);
    factory.setValidateTransactionState(false);
    factory.afterPropertiesSet();
    return factory.getObject();
}
Example 3
Project: spring-batch-master  File: ConcurrentTransactionTests.java View source code
@Override
protected JobRepository createJobRepository() throws Exception {
    JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
    factory.setDataSource(dataSource());
    factory.setIsolationLevelForCreate("ISOLATION_READ_COMMITTED");
    factory.setTransactionManager(getTransactionManager());
    factory.afterPropertiesSet();
    return factory.getObject();
}
Example 4
Project: spring-boot-starter-batch-web-master  File: TaskExecutorBatchConfigurer.java View source code
protected JobRepository createJobRepository() throws Exception {
    JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
    factory.setDataSource(dataSource);
    factory.setTransactionManager(transactionManager);
    String isolationLevelForCreate = env.getProperty("batch.repository.isolationlevelforcreate");
    if (isolationLevelForCreate != null) {
        factory.setIsolationLevelForCreate(isolationLevelForCreate);
    }
    String tablePrefix = env.getProperty("batch.repository.tableprefix");
    if (tablePrefix != null) {
        factory.setTablePrefix(tablePrefix);
    }
    factory.afterPropertiesSet();
    return factory.getObject();
}
Example 5
Project: spring-boot-master  File: BasicBatchConfigurer.java View source code
protected JobRepository createJobRepository() throws Exception {
    JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
    factory.setDataSource(this.dataSource);
    String isolationLevel = determineIsolationLevel();
    if (isolationLevel != null) {
        factory.setIsolationLevelForCreate(isolationLevel);
    }
    String tablePrefix = this.properties.getTablePrefix();
    if (StringUtils.hasText(tablePrefix)) {
        factory.setTablePrefix(tablePrefix);
    }
    factory.setTransactionManager(getTransactionManager());
    factory.afterPropertiesSet();
    return factory.getObject();
}
Example 6
Project: WebAPI-master  File: JobConfig.java View source code
protected JobRepository createJobRepository() throws Exception {
    final JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
    factory.setDataSource(this.dataSource);
    //prevent ISOLATION_DEFAULT setting for oracle (i.e. SERIALIZABLE)
    //ISOLATION_REPEATABLE_READ throws READ_COMMITTED and SERIALIZABLE are the only valid transaction levels
    factory.setIsolationLevelForCreate(JobConfig.this.isolationLevelForCreate);
    factory.setTablePrefix(JobConfig.this.tablePrefix);
    factory.setTransactionManager(getTransactionManager());
    factory.afterPropertiesSet();
    return factory.getObject();
}
Example 7
Project: spring-cloud-dataflow-master  File: JobCommandTests.java View source code
@BeforeClass
public static void setUp() throws Exception {
    dataSource = applicationContext.getBean(DataSource.class);
    taskBatchDao = new JdbcTaskBatchDao(dataSource);
    JobRepositoryFactoryBean repositoryFactoryBean = new JobRepositoryFactoryBean();
    repositoryFactoryBean.setDataSource(dataSource);
    repositoryFactoryBean.setTransactionManager(new DataSourceTransactionManager(dataSource));
    jobRepository = repositoryFactoryBean.getObject();
    TaskExecutionDaoFactoryBean taskExecutionDaoFactoryBean = new TaskExecutionDaoFactoryBean(dataSource);
    dao = taskExecutionDaoFactoryBean.getObject();
    createSampleJob(JOB_NAME_ORIG, 1);
    createSampleJob(JOB_NAME_FOO, 1);
    createSampleJob(JOB_NAME_FOOBAR, 2);
}
Example 8
Project: oasp4j-master  File: BeansBatchConfig.java View source code
/**
   * This method is creating jobrepository
   *
   * @return JobRepositoryFactoryBean
   */
@Bean(name = "jobRepository")
public JobRepositoryFactoryBean jobRepository() {
    this.jobRepository = new JobRepositoryFactoryBean();
    this.jobRepository.setDataSource(this.dataSource);
    this.jobRepository.setTransactionManager(this.transactionManager);
    this.jobRepository.setIsolationLevelForCreate(this.isolationLevelForCreate);
    return this.jobRepository;
}
Example 9
Project: saos-master  File: BatchCoreConfiguration.java View source code
@Bean
public JobRepository jobRepository() throws Exception {
    JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
    factory.setDataSource(dataSource);
    factory.setTransactionManager(transactionManager);
    factory.afterPropertiesSet();
    factory.setIsolationLevelForCreate("ISOLATION_DEFAULT");
    return factory.getObject();
}
Example 10
Project: ambari-master  File: InfraManagerBatchConfig.java View source code
@Bean
public JobRepository jobRepository() throws Exception {
    JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
    factory.setDataSource(dataSource());
    factory.setTransactionManager(getTransactionManager());
    factory.afterPropertiesSet();
    return factory.getObject();
}
Example 11
Project: spring-social-flickr-master  File: BatchConfiguration.java View source code
@Bean
@Inject
public JobRepositoryFactoryBean jobRepository(DataSource ds, PlatformTransactionManager tx) throws Exception {
    JobRepositoryFactoryBean jobRepositoryFactoryBean = new JobRepositoryFactoryBean();
    jobRepositoryFactoryBean.setDataSource(ds);
    jobRepositoryFactoryBean.setTransactionManager(tx);
    return jobRepositoryFactoryBean;
}
Example 12
Project: oas-master  File: BeansBatchConfig.java View source code
/**
   * This method is creating jobrepository
   *
   * @return JobRepositoryFactoryBean
   */
@Bean(name = "jobRepository")
public JobRepositoryFactoryBean jobRepository() {
    this.jobRepository = new JobRepositoryFactoryBean();
    this.jobRepository.setDataSource(this.dataSource);
    this.jobRepository.setTransactionManager(this.transactionManager);
    this.jobRepository.setIsolationLevelForCreate(this.isolationLevelForCreate);
    return this.jobRepository;
}