當前位置: 首頁>>代碼示例>>Java>>正文


Java StepBuilderFactory類代碼示例

本文整理匯總了Java中org.springframework.batch.core.configuration.annotation.StepBuilderFactory的典型用法代碼示例。如果您正苦於以下問題:Java StepBuilderFactory類的具體用法?Java StepBuilderFactory怎麽用?Java StepBuilderFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


StepBuilderFactory類屬於org.springframework.batch.core.configuration.annotation包,在下文中一共展示了StepBuilderFactory類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: importTicketStep

import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; //導入依賴的package包/類
@Bean
public Step importTicketStep(final StepBuilderFactory stepBuilderFactory,
                             @Qualifier("jpaTransactionManagerForBatch")
                             final PlatformTransactionManager jpaTransactionManager,
                             final @Value("${ticket.chunk.size}") int chunkSize,
                             final ItemReader<Ticket> ticketReader,
                             final ItemWriter<Ticket> ticketWriter,
                             final ItemProcessor<Ticket, Ticket> importTicketProcessor) {
    return stepBuilderFactory.get("importTicketStep")
            .<Ticket, Ticket>chunk(chunkSize)
            .reader(ticketReader)
            .processor(importTicketProcessor)
            .writer(ticketWriter)
            .transactionManager(jpaTransactionManager)
            .build();
}
 
開發者ID:create1st,項目名稱:spring-batch,代碼行數:17,代碼來源:BatchConfiguration.java

示例2: personEtl

import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; //導入依賴的package包/類
@Bean
Job personEtl(JobBuilderFactory jobBuilderFactory,
        StepBuilderFactory stepBuilderFactory,
        FlatFileItemReader<Person> reader,
        JdbcBatchItemWriter<Person> writer
) {

    Step step = stepBuilderFactory.get("file-to-database")
            .<Person, Person>chunk(5)
            .reader(reader)
            .writer(writer)
            .build();

    return jobBuilderFactory.get("etl")
            .start(step)
            .build();
}
 
開發者ID:livelessons-spring,項目名稱:building-microservices,代碼行數:18,代碼來源:BatchConfiguration.java

示例3: DemoJobConfiguration

import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; //導入依賴的package包/類
@Autowired
public DemoJobConfiguration(EntityManagerFactory entityManagerFactory, DemoJobListener demoJobListener, DemoJobStepListener demoJobStepListener, StepBuilderFactory stepBuilderFactory, JobBuilderFactory jobBuilderFactory) {
    this.entityManagerFactory = entityManagerFactory;
    this.demoJobListener = demoJobListener;
    this.demoJobStepListener = demoJobStepListener;
    this.stepBuilderFactory = stepBuilderFactory;
    this.jobBuilderFactory = jobBuilderFactory;
}
 
開發者ID:mintster,項目名稱:nixmash-blog,代碼行數:9,代碼來源:DemoJobConfiguration.java

示例4: init

import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; //導入依賴的package包/類
@Before
public void init() throws Exception {
	this.context.register(BatchConfiguration.class);
	this.context.refresh();
	JobRepository jobRepository = this.context.getBean(JobRepository.class);
	this.jobLauncher = this.context.getBean(JobLauncher.class);
	this.jobs = new JobBuilderFactory(jobRepository);
	PlatformTransactionManager transactionManager = this.context
			.getBean(PlatformTransactionManager.class);
	this.steps = new StepBuilderFactory(jobRepository, transactionManager);
	this.step = this.steps.get("step").tasklet(new Tasklet() {
		@Override
		public RepeatStatus execute(StepContribution contribution,
				ChunkContext chunkContext) throws Exception {
			return null;
		}
	}).build();
	this.job = this.jobs.get("job").start(this.step).build();
	this.jobExplorer = this.context.getBean(JobExplorer.class);
	this.runner = new JobLauncherCommandLineRunner(this.jobLauncher,
			this.jobExplorer);
	this.context.getBean(BatchConfiguration.class).clear();
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:24,代碼來源:JobLauncherCommandLineRunnerTests.java

示例5: step1

import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; //導入依賴的package包/類
@Bean
@JobScope
public Step step1(
        StepBuilderFactory stepBuilderFactory,
        DatabaseClientProvider databaseClientProvider,
        @Value("#{jobParameters['input_file_path']}") String inputFilePath,
        @Value("#{jobParameters['graph_name']}") String graphName) {
    RdfTripleItemReader<Map<String, Object>> reader = new RdfTripleItemReader<Map<String, Object>>();
    reader.setFileName(inputFilePath);

    RdfTripleItemWriter writer = new RdfTripleItemWriter(databaseClientProvider.getDatabaseClient(), graphName);

    return stepBuilderFactory.get("step1")
            .<Map<String, Object>, Map<String, Object>>chunk(10)
            .reader(reader)
            .writer(writer)
            .build();
}
 
開發者ID:marklogic-community,項目名稱:marklogic-spring-batch,代碼行數:19,代碼來源:ImportRdfFromFileJob.java

示例6: readCsvFileIntoTableStep

import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; //導入依賴的package包/類
@Bean(name = readCsvFileIntoTableStep)
public Step readCsvFileIntoTableStep(
        StepBuilderFactory stepBuilderFactory,
        PlatformTransactionManager platformTransactionManager,
        @Qualifier(readCsvFileIntoTableStepReader) ItemReader<Customer> ir,
        @Qualifier(readCsvFileIntoTableStepProcessor) ItemProcessor<Customer, Customer> itemProcessor,
        @Qualifier(readCsvFileIntoTableStepWriter) ItemWriter<Customer> iw) {

    StepBuilder builder = stepBuilderFactory.get(readCsvFileIntoTableStep);

    return builder.<Customer, Customer>chunk(3)
            .reader(ir)
            .processor(itemProcessor)
            .writer(iw)
            .transactionManager(platformTransactionManager)
            .build();
}
 
開發者ID:joshlong,項目名稱:javaconfig-ftw,代碼行數:18,代碼來源:BatchConfiguration.java

示例7: step1

import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; //導入依賴的package包/類
@Bean
public Step step1(StepBuilderFactory stepBuilderFactory, ItemReader<Path> reader,
    ItemWriter<NamedBytes> writer, ItemProcessor<Path, NamedBytes> processor) {
    return stepBuilderFactory.get("step1")
        .<Path, NamedBytes>chunk(5)
        .reader(reader)
        .processor(processor)
        .writer(writer)
        .build();
}
 
開發者ID:nfrankel,項目名稱:jplantuml,代碼行數:11,代碼來源:PlantUmlConfig.java

示例8: step2

import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; //導入依賴的package包/類
@Bean("step2")
public Step step2(StepBuilderFactory stepBuilderFactory, ItemReader<Employee> reader,
                   ItemProcessor<Employee, Permanent> processor) {
      return stepBuilderFactory.get("step2")
              .<Employee, Permanent>chunk(2)
              .reader(reader)
              .processor(processor)
              .writer(xmlWriter())
              .build();
}
 
開發者ID:PacktPublishing,項目名稱:Spring-5.0-Cookbook,代碼行數:11,代碼來源:BatchConfig.java

示例9: BlackDuckFortifyPhoneHomeJobConfig

import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; //導入依賴的package包/類
@Autowired
public BlackDuckFortifyPhoneHomeJobConfig(JobLauncher jobLauncher, JobBuilderFactory jobBuilderFactory,
        StepBuilderFactory stepBuilderFactory, HubServices hubServices, PropertyConstants propertyConstants) {
    this.jobLauncher = jobLauncher;
    this.jobBuilderFactory = jobBuilderFactory;
    this.stepBuilderFactory = stepBuilderFactory;
    this.hubServices = hubServices;
    this.propertyConstants = propertyConstants;
}
 
開發者ID:blackducksoftware,項目名稱:hub-fortify-ssc-integration-service,代碼行數:10,代碼來源:BlackDuckFortifyPhoneHomeJobConfig.java

示例10: step1

import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; //導入依賴的package包/類
@Bean
public Step step1(StepBuilderFactory stepBuilderFactory, ItemReader<MooreNcaaStat> reader,
				  ItemWriter<MooreNcaaStat> writer) {
	return stepBuilderFactory.get("step1")
			.<MooreNcaaStat, MooreNcaaStat>chunk(10)
			.reader(reader)
			.writer(writer)
			.build();
}
 
開發者ID:mminella,項目名稱:TaskMadness,代碼行數:10,代碼來源:MooreStatConfiguration.java

示例11: step1

import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; //導入依賴的package包/類
@Bean
public Step step1(StepBuilderFactory stepBuilderFactory,
				  ItemReader<NcaaStats> reader,
				  ItemWriter<NcaaStats> writer,
				  ItemProcessor<NcaaStats,NcaaStats> processor) {
	return stepBuilderFactory.get("step1")
			.<NcaaStats, NcaaStats>chunk(10)
			.reader(reader)
			.processor(processor)
			.writer(writer)
			.build();
}
 
開發者ID:mminella,項目名稱:TaskMadness,代碼行數:13,代碼來源:NcaaStatConfiguration.java

示例12: step1

import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; //導入依賴的package包/類
@Bean
public Step step1(StepBuilderFactory stepBuilderFactory, ItemReader<Person> reader,
        ItemWriter<Person> writer, ItemProcessor<Person, Person> processor) {
	
    return stepBuilderFactory.get("step1")
            .<Person, Person> chunk(2) //commit-interval = 2
            .reader(reader)
            .processor(processor)
            .writer(writer)
            .build();
}
 
開發者ID:SoatGroup,項目名稱:json-file-itemwriter,代碼行數:12,代碼來源:BatchConfiguration.java

示例13: step1

import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; //導入依賴的package包/類
@Bean
public Step step1(StepBuilderFactory stepBuilderFactory, ItemReader<Person> reader, ItemWriter<Person> writer,
    ItemProcessor<Person, Person> processor)
{
  return stepBuilderFactory.get("step1").<Person, Person> chunk(10).reader(reader).processor(processor)
      .writer(writer).build();
}
 
開發者ID:iisi-nj,項目名稱:GemFireLite,代碼行數:8,代碼來源:BatchConfiguration.java

示例14: step2

import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; //導入依賴的package包/類
@Bean
@JobScope
public Step step2(StepBuilderFactory stepBuilderFactory) {
    ItemReader<String> reader = new ItemReader<String>() {
        int i = 0;

        @Override
        public String read() throws Exception {
            i++;
            return i == 1 ? "hello" : null;
        }
    };


    ItemWriter<String> writer = new ItemWriter<String>() {
        String someString;

        @BeforeStep
        public void beforeStep(StepExecution stepExecution) {
            JobExecution jobExecution = stepExecution.getJobExecution();
            ExecutionContext jobContext = jobExecution.getExecutionContext();
            this.someString = jobContext.getString("someKey");
        }

        @Override
        public void write(List<? extends String> items) throws Exception {
            logger.info("Step 2: " + someString);
            for (String item : items) {
                logger.info("step2: " + item);
            }
        }

    };


    return stepBuilderFactory.get("step2")
            .<String, String>chunk(10)
            .reader(reader)
            .writer(writer)
            .listener(writer)
            .build();
}
 
開發者ID:marklogic-community,項目名稱:marklogic-spring-batch,代碼行數:43,代碼來源:YourTwoStepJobConfig.java

示例15: jobTemplate

import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; //導入依賴的package包/類
@Bean
public JobTemplate jobTemplate(final JobLauncher jobLauncher, final JobBuilderFactory jobBuilders,
                               final StepBuilderFactory stepBuilders) {
    return new JobTemplate(jobLauncher, jobBuilders, stepBuilders);
}
 
開發者ID:OHDSI,項目名稱:WebAPI,代碼行數:6,代碼來源:JobConfig.java


注:本文中的org.springframework.batch.core.configuration.annotation.StepBuilderFactory類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。