/** * Create a new chunk oriented tasklet with reader, writer and processor as provided. * * @see org.springframework.batch.core.step.builder.SimpleStepBuilder#createTasklet() */ @Override protected Tasklet createTasklet() { Assert.state(getReader() != null, "ItemReader must be provided"); Assert.state( getProcessor() != null || getWriter() != null, "ItemWriter or ItemProcessor must be provided"); addSpecialExceptions(); registerSkipListeners(); FaultTolerantChunkProvider<I> chunkProvider = createChunkProvider(); FaultTolerantChunkProcessor<I, O> chunkProcessor = createChunkProcessor(); ChunkOrientedTasklet<I> tasklet = new ChunkOrientedTasklet<I>(chunkProvider, chunkProcessor); tasklet.setBuffering(!isReaderTransactionalQueue()); return tasklet; }
@Override @SuppressWarnings({"unchecked", "rawtypes"}) protected Tasklet createTasklet() { Assert.state(getReader() != null, "ItemReader must be provided"); Assert.state( getProcessor() != null || getWriter() != null, "ItemWriter or ItemProcessor must be provided"); RepeatOperations repeatOperations = createRepeatOperations(); ChunkProvider<I> chunkProvider = new JsrChunkProvider<I>(); JsrChunkProcessor<I, O> chunkProcessor = new JsrChunkProcessor(getReader(), getProcessor(), getWriter(), repeatOperations); chunkProcessor.setListeners(new ArrayList<StepListener>(getItemListeners())); ChunkOrientedTasklet<I> tasklet = new ChunkOrientedTasklet<I>(chunkProvider, chunkProcessor); tasklet.setBuffering(!isReaderTransactionalQueue()); return tasklet; }