Package org.springframework.batch.core.step.tasklet

Examples of org.springframework.batch.core.step.tasklet.Tasklet


      return builder.build();
    }

    @Bean
    protected Step step3() throws Exception {
      return steps.get("step3").tasklet(new Tasklet() {
        @Override
        public RepeatStatus execute(StepContribution contribution, ChunkContext context) throws Exception {
          return RepeatStatus.FINISHED;
        }
      }).build();
View Full Code Here


    @Autowired
    StepBuilderFactory stepFactory;

    @Bean
    Step step1 () {
      return stepFactory.get("step1").tasklet(new Tasklet() {
        @Override
        public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
          return RepeatStatus.FINISHED;
        }
      }).build();
View Full Code Here

    assertEquals(STOPPED.toString(), stepExecution.getExitStatus().getExitCode());
  }

  @Test
  public void testInterruptedWithCustomStatus() throws Exception {
    taskletStep.setTasklet(new Tasklet() {
      @Override
      public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
        contribution.setExitStatus(new ExitStatus("FUNNY"));
        throw new JobInterruptedException("Planned");
      }
View Full Code Here

      @Override
      public ExitStatus afterStep(StepExecution stepExecution) {
        throw exception;
      }
    } });
    taskletStep.setTasklet(new Tasklet() {

      @Override
      public RepeatStatus execute(StepContribution contribution, ChunkContext attributes) throws Exception {
        return RepeatStatus.FINISHED;
      }
View Full Code Here

      protected void doRollback(DefaultTransactionStatus status) throws TransactionException {
        throw new RuntimeException("foo");
      }
    });

    taskletStep.setTasklet(new Tasklet() {

      @Override
      public RepeatStatus execute(StepContribution contribution, ChunkContext attributes) throws Exception {
        attributes.getStepContext().getStepExecution().getExecutionContext().putString("foo", "bar");
        return RepeatStatus.FINISHED;
View Full Code Here

        super.doRollback(status);
        throw new UnexpectedRollbackException("bar");
      }
    });

    taskletStep.setTasklet(new Tasklet() {

      @Override
      public RepeatStatus execute(StepContribution contribution, ChunkContext attributes) throws Exception {
        attributes.getStepContext().getStepExecution().getExecutionContext().putString("foo", "bar");
        return RepeatStatus.FINISHED;
View Full Code Here

  }

  @Test
  public void testRepositoryErrorOnExecutionContext() throws Exception {

    taskletStep.setTasklet(new Tasklet() {

      @Override
      public RepeatStatus execute(StepContribution contribution, ChunkContext attributes) throws Exception {
        return RepeatStatus.FINISHED;
      }
View Full Code Here

  }

  @Test
  public void testRepositoryErrorOnExecutionContextInTransaction() throws Exception {

    taskletStep.setTasklet(new Tasklet() {

      @Override
      public RepeatStatus execute(StepContribution contribution, ChunkContext attributes) throws Exception {
        return RepeatStatus.FINISHED;
      }
View Full Code Here

  }

  @Test
  public void testRepositoryErrorOnExecutionContextInTransactionRollbackFailed() throws Exception {

    taskletStep.setTasklet(new Tasklet() {

      @Override
      public RepeatStatus execute(StepContribution contribution, ChunkContext attributes) throws Exception {
        return RepeatStatus.FINISHED;
      }
View Full Code Here

  }

  @Test
  public void testRepositoryErrorOnUpdateStepExecution() throws Exception {

    taskletStep.setTasklet(new Tasklet() {

      @Override
      public RepeatStatus execute(StepContribution contribution, ChunkContext attributes) throws Exception {
        return RepeatStatus.FINISHED;
      }
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.step.tasklet.Tasklet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.