Package org.springframework.batch.core.repository

Examples of org.springframework.batch.core.repository.JobRestartException


    final JobExecution jobExecution;
    JobExecution lastExecution = repository.getLastJobExecution(job.getName(), jobParameters);
    if (lastExecution != null) {
      if (!job.isRestartable()) {
        throw new JobRestartException("JobInstance already exists and is not restartable");
      }
    }

    // Check the validity of the parameters before doing creating anything
    // in the repository...
View Full Code Here


    else {
      stepStatus = lastStepExecution.getStatus();
    }

    if (stepStatus == BatchStatus.UNKNOWN) {
      throw new JobRestartException("Cannot restart step from UNKNOWN status. "
          + "The last execution ended with a failure that could not be rolled back, "
          + "so it may be dangerous to proceed. Manual intervention is probably necessary.");
    }

    if ((stepStatus == BatchStatus.COMPLETED && !step.isAllowStartIfComplete())
View Full Code Here

    final JobExecution jobExecution;
    JobExecution lastExecution = jobRepository.getLastJobExecution(job.getName(), jobParameters);
    if (lastExecution != null) {
      if (!job.isRestartable()) {
        throw new JobRestartException("JobInstance already exists and is not restartable");
      }
      /*
       * validate here if it has stepExecutions that are UNKNOWN
       * retrieve the previous execution and check
       */
      for (StepExecution execution : lastExecution.getStepExecutions()) {
        if (execution.getStatus() == BatchStatus.UNKNOWN) {
          //throw
          throw new JobRestartException("Step [" + execution.getStepName() + "] is of status UNKNOWN");
        }//end if
      }//end for
    }

    // Check the validity of the parameters before doing creating anything
View Full Code Here

        }
      }
    }

    if (stepStatus == BatchStatus.UNKNOWN) {
      throw new JobRestartException("Cannot restart step from UNKNOWN status. "
          + "The last execution ended with a failure that could not be rolled back, "
          + "so it may be dangerous to proceed. Manual intervention is probably necessary.");
    }

    if ((stepStatus == BatchStatus.COMPLETED && step.isAllowStartIfComplete() == false)
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.repository.JobRestartException

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.