Examples of JobExecutionNotRunningException


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

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

          + ". 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

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

    // 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

Examples of org.springframework.xd.dirt.job.JobExecutionNotRunningException

  public void stopJobExecution(@PathVariable("executionId") long jobExecutionId) {
    try {
      jobService.stop(jobExecutionId);
    }
    catch (org.springframework.batch.core.launch.JobExecutionNotRunningException e) {
      throw new JobExecutionNotRunningException(jobExecutionId);
    }
    catch (org.springframework.batch.core.launch.NoSuchJobExecutionException e) {
      throw new NoSuchJobExecutionException(jobExecutionId);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.