Search in sources :

Example 1 with SimpleJobOperator

use of org.springframework.batch.core.launch.support.SimpleJobOperator in project spring-boot by spring-projects.

the class BatchAutoConfiguration method jobOperator.

@Bean
@ConditionalOnMissingBean(JobOperator.class)
public SimpleJobOperator jobOperator(JobExplorer jobExplorer, JobLauncher jobLauncher, ListableJobLocator jobRegistry, JobRepository jobRepository) throws Exception {
    SimpleJobOperator factory = new SimpleJobOperator();
    factory.setJobExplorer(jobExplorer);
    factory.setJobLauncher(jobLauncher);
    factory.setJobRegistry(jobRegistry);
    factory.setJobRepository(jobRepository);
    if (this.jobParametersConverter != null) {
        factory.setJobParametersConverter(this.jobParametersConverter);
    }
    return factory;
}
Also used : SimpleJobOperator(org.springframework.batch.core.launch.support.SimpleJobOperator) 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)

Example 2 with SimpleJobOperator

use of org.springframework.batch.core.launch.support.SimpleJobOperator in project RecordManager2 by moravianlibrary.

the class AppConfig method jobOperator.

@Bean
public JobOperator jobOperator() throws Exception {
    SimpleJobOperator jobOperator = new SimpleJobOperator();
    jobOperator.setJobRepository(jobRepository());
    jobOperator.setJobRegistry(jobRegistry());
    jobOperator.setJobLauncher(jobLauncher());
    jobOperator.setJobExplorer(jobExplorer());
    return jobOperator;
}
Also used : SimpleJobOperator(org.springframework.batch.core.launch.support.SimpleJobOperator) JobRepositoryFactoryBean(org.springframework.batch.core.repository.support.JobRepositoryFactoryBean) JobExplorerFactoryBean(org.springframework.batch.core.explore.support.JobExplorerFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 3 with SimpleJobOperator

use of org.springframework.batch.core.launch.support.SimpleJobOperator in project spring-boot by spring-projects.

the class BatchAutoConfiguration method jobOperator.

@Bean
@ConditionalOnMissingBean(JobOperator.class)
public SimpleJobOperator jobOperator(ObjectProvider<JobParametersConverter> jobParametersConverter, JobExplorer jobExplorer, JobLauncher jobLauncher, ListableJobLocator jobRegistry, JobRepository jobRepository) throws Exception {
    SimpleJobOperator factory = new SimpleJobOperator();
    factory.setJobExplorer(jobExplorer);
    factory.setJobLauncher(jobLauncher);
    factory.setJobRegistry(jobRegistry);
    factory.setJobRepository(jobRepository);
    jobParametersConverter.ifAvailable(factory::setJobParametersConverter);
    return factory;
}
Also used : SimpleJobOperator(org.springframework.batch.core.launch.support.SimpleJobOperator) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

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