Java Code Examples for org.springframework.batch.core.ItemWriteListener

The following examples show how to use org.springframework.batch.core.ItemWriteListener. These examples are extracted from open source projects. 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
@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
@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
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));
	}
}