org.springframework.boot.autoconfigure.quartz.QuartzDataSource源码实例Demo

类org.springframework.boot.autoconfigure.quartz.QuartzDataSource源码实例Demo

下面列出了org.springframework.boot.autoconfigure.quartz.QuartzDataSource 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

@Bean
@Order(1)
public SchedulerFactoryBeanCustomizer jobDataSourceCustomizer(ApiBootQuartzProperties properties, DataSource dataSource, @QuartzDataSource ObjectProvider<DataSource> quartzDataSource, ObjectProvider<PlatformTransactionManager> transactionManager) {
    return (schedulerFactoryBean) -> {
        if (properties.getJobStoreType() == JobStoreType.JDBC) {
            DataSource dataSourceToUse = this.getDataSource(dataSource, quartzDataSource);
            schedulerFactoryBean.setDataSource(dataSourceToUse);
            PlatformTransactionManager txManager = transactionManager.getIfUnique();
            if (txManager != null) {
                schedulerFactoryBean.setTransactionManager(txManager);
            }
        }

    };
}
 
源代码2 项目: api-boot   文件: ApiBootQuartzAutoConfiguration.java
@Bean
@Order(1)
public SchedulerFactoryBeanCustomizer jobDataSourceCustomizer(ApiBootQuartzProperties properties, DataSource dataSource, @QuartzDataSource ObjectProvider<DataSource> quartzDataSource, ObjectProvider<PlatformTransactionManager> transactionManager) {
    return (schedulerFactoryBean) -> {
        if (properties.getJobStoreType() == JobStoreType.JDBC) {
            DataSource dataSourceToUse = this.getDataSource(dataSource, quartzDataSource);
            schedulerFactoryBean.setDataSource(dataSourceToUse);
            PlatformTransactionManager txManager = transactionManager.getIfUnique();
            if (txManager != null) {
                schedulerFactoryBean.setTransactionManager(txManager);
            }
        }

    };
}
 
@Bean
@ConditionalOnMissingBean
public ApiBootQuartzDataSourceInitializer apiBootQuartzDataSourceInitializer(DataSource dataSource, @QuartzDataSource ObjectProvider<DataSource> quartzDataSource, ResourceLoader resourceLoader, ApiBootQuartzProperties properties) {
    DataSource dataSourceToUse = this.getDataSource(dataSource, quartzDataSource);
    return new ApiBootQuartzDataSourceInitializer(dataSourceToUse, resourceLoader, properties);
}
 
源代码4 项目: api-boot   文件: ApiBootQuartzAutoConfiguration.java
@Bean
@ConditionalOnMissingBean
public ApiBootQuartzDataSourceInitializer apiBootQuartzDataSourceInitializer(DataSource dataSource, @QuartzDataSource ObjectProvider<DataSource> quartzDataSource, ResourceLoader resourceLoader, ApiBootQuartzProperties properties) {
    DataSource dataSourceToUse = this.getDataSource(dataSource, quartzDataSource);
    return new ApiBootQuartzDataSourceInitializer(dataSourceToUse, resourceLoader, properties);
}
 
源代码5 项目: tutorials   文件: SpringQrtzScheduler.java
@Bean
@QuartzDataSource
@ConfigurationProperties(prefix = "spring.datasource")
public DataSource quartzDataSource() {
    return DataSourceBuilder.create().build();
}
 
源代码评论
动弹
沙发等你来抢
 类方法
 同包方法