Search in sources :

Example 1 with JobExplorerFactoryBean

use of org.springframework.batch.core.explore.support.JobExplorerFactoryBean in project spring-boot by spring-projects.

the class BasicBatchConfigurer method createJobExplorer.

protected JobExplorer createJobExplorer() throws Exception {
    JobExplorerFactoryBean jobExplorerFactoryBean = new JobExplorerFactoryBean();
    jobExplorerFactoryBean.setDataSource(this.dataSource);
    String tablePrefix = this.properties.getTablePrefix();
    if (StringUtils.hasText(tablePrefix)) {
        jobExplorerFactoryBean.setTablePrefix(tablePrefix);
    }
    jobExplorerFactoryBean.afterPropertiesSet();
    return jobExplorerFactoryBean.getObject();
}
Also used : JobExplorerFactoryBean(org.springframework.batch.core.explore.support.JobExplorerFactoryBean)

Example 2 with JobExplorerFactoryBean

use of org.springframework.batch.core.explore.support.JobExplorerFactoryBean in project spring-boot by spring-projects.

the class BatchAutoConfiguration method jobExplorer.

@Bean
@ConditionalOnMissingBean
@ConditionalOnBean(DataSource.class)
public JobExplorer jobExplorer(DataSource dataSource) throws Exception {
    JobExplorerFactoryBean factory = new JobExplorerFactoryBean();
    factory.setDataSource(dataSource);
    String tablePrefix = this.properties.getTablePrefix();
    if (StringUtils.hasText(tablePrefix)) {
        factory.setTablePrefix(tablePrefix);
    }
    factory.afterPropertiesSet();
    return factory.getObject();
}
Also used : JobExplorerFactoryBean(org.springframework.batch.core.explore.support.JobExplorerFactoryBean) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) JobExplorerFactoryBean(org.springframework.batch.core.explore.support.JobExplorerFactoryBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

JobExplorerFactoryBean (org.springframework.batch.core.explore.support.JobExplorerFactoryBean)2 ConditionalOnBean (org.springframework.boot.autoconfigure.condition.ConditionalOnBean)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1