/** * Test method for * {@link org.springframework.batch.core.listener.CompositeStepExecutionListener#register(org.springframework.batch.core.StepExecutionListener)} * . */ public void testSetListener() { JobExecution jobExecution = new JobExecution(1L); StepExecution stepExecution = new StepExecution("s1", jobExecution); listener.register(new StepExecutionListenerSupport() { @Override public ExitStatus afterStep(StepExecution stepExecution) { list.add("fail"); return ExitStatus.FAILED; } }); assertEquals(ExitStatus.FAILED, listener.afterStep(stepExecution)); assertEquals(1, list.size()); }
/** * Test method for * {@link org.springframework.batch.core.listener.CompositeStepExecutionListener#beforeStep(StepExecution)} * . */ public void testOpen() { listener.register(new StepExecutionListenerSupport() { @Override public void beforeStep(StepExecution stepExecution) { list.add("foo"); } }); listener.beforeStep(new StepExecution("foo", null)); assertEquals(1, list.size()); }
/** * Test method for * {@link org.springframework.batch.core.listener.CompositeStepExecutionListener#setListeners(org.springframework.batch.core.StepExecutionListener[])} * . */ public void testSetListeners() { JobExecution jobExecution = new JobExecution(1L); StepExecution stepExecution = new StepExecution("s1", jobExecution); listener.setListeners(new StepExecutionListener[] { new StepExecutionListenerSupport() { @Override public ExitStatus afterStep(StepExecution stepExecution) { assertEquals(ExitStatus.STOPPED, stepExecution.getExitStatus()); list.add("fail"); return ExitStatus.FAILED; } }, new StepExecutionListenerSupport() { @Override public ExitStatus afterStep(StepExecution stepExecution) { list.add("continue"); return ExitStatus.STOPPED; } } }); assertEquals(ExitStatus.FAILED, listener.afterStep(stepExecution)); assertEquals(2, list.size()); }
/** * Register a step listener for callbacks at the appropriate stages in a step execution. * * @param listener a {@link StepExecutionListener} */ public void registerStepExecutionListener(StepExecutionListener listener) { this.stepExecutionListener.register(listener); }
/** * @see org.springframework.batch.core.listener.CompositeStepExecutionListener#afterStep(StepExecution) */ @Override public ExitStatus afterStep(StepExecution stepExecution) { try { return stepListener.afterStep(stepExecution); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in afterStep.", e); } }
/** * @see org.springframework.batch.core.listener.CompositeStepExecutionListener#beforeStep(org.springframework.batch.core.StepExecution) */ @Override public void beforeStep(StepExecution stepExecution) { try { stepListener.beforeStep(stepExecution); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in beforeStep.", e); } }
this.stepListener.register((StepExecutionListener) listener);
/** * @see org.springframework.batch.core.listener.CompositeStepExecutionListener#afterStep(StepExecution) */ @Override public ExitStatus afterStep(StepExecution stepExecution) { try { return stepListener.afterStep(stepExecution); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in afterStep.", e); } }
/** * @see org.springframework.batch.core.listener.CompositeStepExecutionListener#beforeStep(org.springframework.batch.core.StepExecution) */ @Override public void beforeStep(StepExecution stepExecution) { try { stepListener.beforeStep(stepExecution); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in beforeStep.", e); } }
/** * Register a step listener for callbacks at the appropriate stages in a step execution. * * @param listener a {@link StepExecutionListener} */ public void registerStepExecutionListener(StepExecutionListener listener) { this.stepExecutionListener.register(listener); }
/** * @see org.springframework.batch.core.listener.CompositeStepExecutionListener#afterStep(StepExecution) */ @Override public ExitStatus afterStep(StepExecution stepExecution) { try { return stepListener.afterStep(stepExecution); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in afterStep.", e); } }
/** * @see org.springframework.batch.core.listener.CompositeStepExecutionListener#beforeStep(org.springframework.batch.core.StepExecution) */ @Override public void beforeStep(StepExecution stepExecution) { try { stepListener.beforeStep(stepExecution); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in beforeStep.", e); } }
/** * Register a step listener for callbacks at the appropriate stages in a step execution. * * @param listener a {@link StepExecutionListener} */ public void registerStepExecutionListener(StepExecutionListener listener) { this.stepExecutionListener.register(listener); }
/** * @see org.springframework.batch.core.listener.CompositeStepExecutionListener#afterStep(StepExecution) */ public ExitStatus afterStep(StepExecution stepExecution) { try { return stepListener.afterStep(stepExecution); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in afterStep.", e); } }
/** * @param stepExecution * @see org.springframework.batch.core.listener.CompositeStepExecutionListener#beforeStep(org.springframework.batch.core.StepExecution) */ public void beforeStep(StepExecution stepExecution) { try { stepListener.beforeStep(stepExecution); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in beforeStep.", e); } }
/** * Register a step listener for callbacks at the appropriate stages in a step execution. * * @param listener a {@link StepExecutionListener} */ public void registerStepExecutionListener(StepExecutionListener listener) { this.stepExecutionListener.register(listener); }
/** * @see org.springframework.batch.core.listener.CompositeStepExecutionListener#afterStep(StepExecution) */ @Override public ExitStatus afterStep(StepExecution stepExecution) { try { return stepListener.afterStep(stepExecution); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in afterStep.", e); } }
/** * @param stepExecution * @see org.springframework.batch.core.listener.CompositeStepExecutionListener#beforeStep(org.springframework.batch.core.StepExecution) */ @Override public void beforeStep(StepExecution stepExecution) { try { stepListener.beforeStep(stepExecution); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in beforeStep.", e); } }
/** * Register a step listener for callbacks at the appropriate stages in a * step execution. * * @param listener a {@link StepExecutionListener} */ public void registerStepExecutionListener(StepExecutionListener listener) { this.stepExecutionListener.register(listener); }
this.stepListener.register((StepExecutionListener) listener);