/** * Implements reading as well as any related listener calls required. * * @param contribution a {@link StepContribution} * @param chunk a {@link Chunk} * @return an item * @throws Exception thrown if error occurs during reading or listener calls. */ protected final I doProvide(final StepContribution contribution, final Chunk<I> chunk) throws Exception { try { listener.beforeRead(); I item = itemReader.read(); if(item != null) { listener.afterRead(item); } else { chunk.setEnd(); } return item; } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug(e.getMessage() + " : " + e.getClass().getName()); } listener.onReadError(e); throw e; } }
@Override public RepeatStatus doInIteration(final RepeatContext context) throws Exception { I item = null; try { item = read(contribution, inputs); } catch (SkipOverflowException e) { // read() tells us about an excess of skips by throwing an // exception return RepeatStatus.FINISHED; } if (item == null) { inputs.setEnd(); return RepeatStatus.FINISHED; } inputs.add(item); contribution.incrementReadCount(); return RepeatStatus.CONTINUABLE; }
@Override public Chunk<String> provide(StepContribution contribution) throws Exception { contribution.incrementReadCount(); Chunk<String> chunk = new Chunk<>(); chunk.add("foo"); chunk.setEnd(); return chunk; } @Override
@Override public RepeatStatus doInIteration(final RepeatContext context) throws Exception { I item = null; try { item = read(contribution, inputs); } catch (SkipOverflowException e) { // read() tells us about an excess of skips by throwing an // exception return RepeatStatus.FINISHED; } if (item instanceof FlushFlag) { return RepeatStatus.FINISHED; } if (item == null) { inputs.setEnd(); return RepeatStatus.FINISHED; } inputs.add(item); contribution.incrementReadCount(); return RepeatStatus.CONTINUABLE; }
/** * Implements reading as well as any related listener calls required. * * @param contribution a {@link StepContribution} * @param chunk a {@link Chunk} * @return an item * @throws Exception thrown if error occurs during reading or listener calls. */ protected final I doProvide(final StepContribution contribution, final Chunk<I> chunk) throws Exception { try { listener.beforeRead(); I item = itemReader.read(); if(item != null) { listener.afterRead(item); } else { chunk.setEnd(); } return item; } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug(e.getMessage() + " : " + e.getClass().getName()); } listener.onReadError(e); throw e; } }
/** * Implements reading as well as any related listener calls required. * * @param contribution a {@link StepContribution} * @param chunk a {@link Chunk} * @return an item * @throws Exception */ protected final I doProvide(final StepContribution contribution, final Chunk<I> chunk) throws Exception { try { listener.beforeRead(); I item = itemReader.read(); if(item != null) { listener.afterRead(item); } else { chunk.setEnd(); } return item; } catch (Exception e) { logger.debug(e.getMessage() + " : " + e.getClass().getName()); listener.onReadError(e); throw e; } }
/** * Implements reading as well as any related listener calls required. * * @param contribution a {@link StepContribution} * @param chunk a {@link Chunk} * @return an item * @throws Exception thrown if error occurs during reading or listener calls. */ protected final I doProvide(final StepContribution contribution, final Chunk<I> chunk) throws Exception { try { listener.beforeRead(); I item = itemReader.read(); if(item != null) { listener.afterRead(item); } else { chunk.setEnd(); } return item; } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug(e.getMessage() + " : " + e.getClass().getName()); } listener.onReadError(e); throw e; } }
public RepeatStatus doInIteration(final RepeatContext context) throws Exception { I item = null; try { item = read(contribution, inputs); } catch (SkipOverflowException e) { // read() tells us about an excess of skips by throwing an // exception return RepeatStatus.FINISHED; } if (item == null) { inputs.setEnd(); return RepeatStatus.FINISHED; } inputs.add(item); contribution.incrementReadCount(); return RepeatStatus.CONTINUABLE; }
@Override public RepeatStatus doInIteration(final RepeatContext context) throws Exception { I item = null; try { item = read(contribution, inputs); } catch (SkipOverflowException e) { // read() tells us about an excess of skips by throwing an // exception return RepeatStatus.FINISHED; } if (item == null) { inputs.setEnd(); return RepeatStatus.FINISHED; } inputs.add(item); contribution.incrementReadCount(); return RepeatStatus.CONTINUABLE; }
@Override public RepeatStatus doInIteration(final RepeatContext context) throws Exception { I item = null; try { item = read(contribution, inputs); } catch (SkipOverflowException e) { // read() tells us about an excess of skips by throwing an // exception return RepeatStatus.FINISHED; } if (item == null) { inputs.setEnd(); return RepeatStatus.FINISHED; } inputs.add(item); contribution.incrementReadCount(); return RepeatStatus.CONTINUABLE; }
@Override public RepeatStatus doInIteration(final RepeatContext context) throws Exception { I item = null; try { item = read(contribution, inputs); } catch (SkipOverflowException e) { // read() tells us about an excess of skips by throwing an // exception return RepeatStatus.FINISHED; } if (item == null) { inputs.setEnd(); return RepeatStatus.FINISHED; } inputs.add(item); contribution.incrementReadCount(); return RepeatStatus.CONTINUABLE; }