Package org.springframework.batch.core

Examples of org.springframework.batch.core.JobInterruptedException


    SimpleFlow flow = new SimpleFlow("job");
    List<StateTransition> transitions = new ArrayList<StateTransition>();
    transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1") {
      @Override
      public void execute(StepExecution stepExecution) throws JobInterruptedException {
        throw new JobInterruptedException("Stopped");
      }
    }), "end0"));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end0")));
    flow.setStateTransitions(transitions);
    flow.afterPropertiesSet();
View Full Code Here


    List<StateTransition> transitions = new ArrayList<StateTransition>();
    transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1") {
      @Override
      public void execute(StepExecution stepExecution) throws JobInterruptedException {
        throw new JobInterruptedException("Stopped");
      }
    }), "end0"));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end0")));
    flow1.setStateTransitions(new ArrayList<StateTransition>(transitions));
    flow1.afterPropertiesSet();
View Full Code Here

      }
      exitStatus = ExitStatus.COMPLETED.and(stepExecution.getExitStatus());

      // Check if someone is trying to stop us
      if (stepExecution.isTerminateOnly()) {
        throw new JobInterruptedException("JobExecution interrupted.");
      }

      // Need to upgrade here not set, in case the execution was stopped
      stepExecution.upgradeStatus(BatchStatus.COMPLETED);
      logger.debug("Step execution success: id=" + stepExecution.getId());
View Full Code Here

   */
  @Override
  public void checkInterrupted(StepExecution stepExecution) throws JobInterruptedException {

    if (isInterrupted(stepExecution)) {
      throw new JobInterruptedException("Job interrupted status detected.");
    }

  }
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.JobInterruptedException

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.