Package org.springframework.batch.core.launch

Examples of org.springframework.batch.core.launch.JobExecutionNotRunningException


  @Override
  public JobExecution stop(Long jobExecutionId) throws NoSuchJobExecutionException, JobExecutionNotRunningException {

    JobExecution jobExecution = getJobExecution(jobExecutionId);
    if (!jobExecution.isRunning()) {
      throw new JobExecutionNotRunningException("JobExecution is not running and therefore cannot be stopped");
    }

    logger.info("Stopping job execution: " + jobExecution);
    jobExecution.stop();
    jobRepository.update(jobExecution);
View Full Code Here


          + ". If parameters are provided they should be in the form name=value (no whitespace).");

      if (opts.contains("-stop")) {
        List<JobExecution> jobExecutions = getRunningJobExecutions(jobIdentifier);
        if (jobExecutions == null) {
          throw new JobExecutionNotRunningException("No running execution found for job=" + jobIdentifier);
        }
        for (JobExecution jobExecution : jobExecutions) {
          jobExecution.setStatus(BatchStatus.STOPPING);
          jobRepository.update(jobExecution);
        }
View Full Code Here

    // Indicate the execution should be stopped by setting it's status to
    // 'STOPPING'. It is assumed that
    // the step implementation will check this status at chunk boundaries.
    BatchStatus status = jobExecution.getStatus();
    if (!(status == BatchStatus.STARTED || status == BatchStatus.STARTING)) {
      throw new JobExecutionNotRunningException("JobExecution must be running so that it can be stopped: "+jobExecution);
    }
    jobExecution.setStatus(BatchStatus.STOPPING);
    jobRepository.update(jobExecution);

    try {
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.launch.JobExecutionNotRunningException

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.