spring-batch SimpleBatchConfiguration 源码

  • 2022-08-16
  • 浏览 (398)

spring-batch SimpleBatchConfiguration 代码

文件路径:/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.java

/*
 * Copyright 2012-2022 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.springframework.batch.core.configuration.annotation;

import java.util.Collection;

import org.springframework.batch.core.explore.JobExplorer;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.PlatformTransactionManager;

/**
 * Base {@code Configuration} class to provide a common structure for enabling and using
 * Spring Batch. Customization is available by implementing the {@link BatchConfigurer}
 * interface.
 *
 * @author Dave Syer
 * @author Mahmoud Ben Hassine
 * @since 2.2
 * @see EnableBatchProcessing
 */
@Configuration(proxyBeanMethods = false)
public class SimpleBatchConfiguration extends AbstractBatchConfiguration {

	@Override
	public JobRepository jobRepository() throws Exception {
		return getOrCreateConfigurer().getJobRepository();
	}

	@Override
	public JobLauncher jobLauncher() throws Exception {
		return getOrCreateConfigurer().getJobLauncher();
	}

	@Override
	public JobExplorer jobExplorer() throws Exception {
		return getOrCreateConfigurer().getJobExplorer();
	}

	@Override
	public PlatformTransactionManager transactionManager() throws Exception {
		return getOrCreateConfigurer().getTransactionManager();
	}

}

相关信息

spring-batch 源码目录

相关文章

spring-batch AbstractBatchConfiguration 源码

spring-batch BatchConfigurationSelector 源码

spring-batch BatchConfigurer 源码

spring-batch DefaultBatchConfigurer 源码

spring-batch EnableBatchProcessing 源码

spring-batch JobBuilderFactory 源码

spring-batch JobScope 源码

spring-batch ModularBatchConfiguration 源码

spring-batch ScopeConfiguration 源码

spring-batch StepBuilderFactory 源码

0  赞