org.springframework.batch.core.ItemWriteListener Java Examples
The following examples show how to use
org.springframework.batch.core.ItemWriteListener.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TaskBatchEventListenerBeanPostProcessorTests.java From spring-cloud-task with Apache License 2.0 | 6 votes |
@Before public void setupMock() { when(this.taskletStep.getTasklet()).thenReturn( new ChunkOrientedTasklet(this.chunkProvider, this.chunkProcessor)); when(this.taskletStep.getName()).thenReturn("FOOOBAR"); registerAlias(ItemProcessListener.class, BatchEventAutoConfiguration.ITEM_PROCESS_EVENTS_LISTENER); registerAlias(StepExecutionListener.class, BatchEventAutoConfiguration.STEP_EXECUTION_EVENTS_LISTENER); registerAlias(ChunkListener.class, BatchEventAutoConfiguration.CHUNK_EVENTS_LISTENER); registerAlias(ItemReadListener.class, BatchEventAutoConfiguration.ITEM_READ_EVENTS_LISTENER); registerAlias(ItemWriteListener.class, BatchEventAutoConfiguration.ITEM_WRITE_EVENTS_LISTENER); registerAlias(SkipListener.class, BatchEventAutoConfiguration.SKIP_EVENTS_LISTENER); }
Example #2
Source File: BatchEventAutoConfiguration.java From spring-cloud-task with Apache License 2.0 | 5 votes |
@Bean @ConditionalOnProperty(prefix = "spring.cloud.task.batch.events.item-write", name = "enabled", havingValue = "true", matchIfMissing = true) // @checkstyle:on public ItemWriteListener itemWriteEventsListener() { return new EventEmittingItemWriteListener( this.listenerChannels.itemWriteEvents(), this.taskEventProperties.getItemWriteOrder()); }
Example #3
Source File: TaskBatchEventListenerBeanPostProcessor.java From spring-cloud-task with Apache License 2.0 | 5 votes |
private void registerItemWriteEvents(SimpleChunkProcessor chunkProcessor) { if (this.applicationContext .containsBean(BatchEventAutoConfiguration.ITEM_WRITE_EVENTS_LISTENER)) { chunkProcessor.registerListener((ItemWriteListener) this.applicationContext .getBean(BatchEventAutoConfiguration.ITEM_WRITE_EVENTS_LISTENER)); } }