本文整理匯總了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();
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}