org.springframework.batch.core.ChunkListener Java Examples

The following examples show how to use org.springframework.batch.core.ChunkListener. 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 vote down vote up
@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: TaskBatchEventListenerBeanPostProcessor.java    From spring-cloud-task with Apache License 2.0 5 votes vote down vote up
private void registerChunkEventsListener(Object bean) {
	if (this.applicationContext
			.containsBean(BatchEventAutoConfiguration.CHUNK_EVENTS_LISTENER)) {
		((TaskletStep) bean)
				.registerChunkListener((ChunkListener) this.applicationContext
						.getBean(BatchEventAutoConfiguration.CHUNK_EVENTS_LISTENER));
	}
}