Package org.springframework.batch.core.launch

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


    JobParameters jobParameters;
    List<JobInstance> lastInstances = jobExplorer.getJobInstances(jobIdentifier, 0, 1);

    JobParametersIncrementer incrementer = job.getJobParametersIncrementer();
    if (incrementer == null) {
      throw new JobParametersNotFoundException("No job parameters incrementer found for job=" + jobIdentifier);
    }

    if (lastInstances.isEmpty()) {
      jobParameters = incrementer.getNext(new JobParameters());
      if (jobParameters == null) {
        throw new JobParametersNotFoundException("No bootstrap parameters found from incrementer for job="
            + jobIdentifier);
      }
    } else {
      List<JobExecution> lastExecutions = jobExplorer.getJobExecutions(lastInstances.get(0));
      jobParameters = incrementer.getNext(lastExecutions.get(0).getJobParameters());
View Full Code Here


        start, count);

    JobParameters jobParameters = null;

    if (lastInstances.isEmpty()) {
      throw new JobParametersNotFoundException(
          "No job instance found for job=" + jobName);
    }

    while (!lastInstances.isEmpty()) {

      for (JobInstance jobInstance : lastInstances) {
        List<JobExecution> jobExecutions = jobExplorer
            .getJobExecutions(jobInstance);
        if (jobExecutions == null || jobExecutions.isEmpty()) {
          continue;
        }
        JobExecution jobExecution = jobExecutions.get(jobExecutions
            .size() - 1);
        if (jobExecution.getStatus()
            .isGreaterThan(BatchStatus.STOPPING)) {
          jobParameters = jobExecution.getJobParameters();
          break;
        }
      }

      if (jobParameters != null) {
        break;
      }

      start += count;
      lastInstances = jobExplorer.getJobInstances(jobName, start, count);

    }

    if (jobParameters == null) {
      throw new JobParametersNotFoundException(
          "No failed or stopped execution found for job=" + jobName);
    }
    return jobParameters;

  }
View Full Code Here

    JobParameters jobParameters;
    List<JobInstance> lastInstances = jobExplorer.getJobInstances(jobIdentifier, 0, 1);

    JobParametersIncrementer incrementer = job.getJobParametersIncrementer();
    if (incrementer == null) {
      throw new JobParametersNotFoundException("No job parameters incrementer found for job=" + jobIdentifier);
    }

    if (lastInstances.isEmpty()) {
      jobParameters = incrementer.getNext(new JobParameters());
      if (jobParameters == null) {
        throw new JobParametersNotFoundException("No bootstrap parameters found from incrementer for job="
            + jobIdentifier);
      }
    }
    else {
      List<JobExecution> lastExecutions = jobExplorer.getJobExecutions(lastInstances.get(0));
View Full Code Here

    Job job = jobRegistry.getJob(jobName);
    List<JobInstance> lastInstances = jobExplorer.getJobInstances(jobName, 0, 1);

    JobParametersIncrementer incrementer = job.getJobParametersIncrementer();
    if (incrementer == null) {
      throw new JobParametersNotFoundException("No job parameters incrementer found for job=" + jobName);
    }

    JobParameters parameters;
    if (lastInstances.isEmpty()) {
      parameters = incrementer.getNext(new JobParameters());
      if (parameters == null) {
        throw new JobParametersNotFoundException("No bootstrap parameters found for job=" + jobName);
      }
    }
    else {
      List<JobExecution> lastExecutions = jobExplorer.getJobExecutions(lastInstances.get(0));
      parameters = incrementer.getNext(lastExecutions.get(0).getJobParameters());
View Full Code Here

TOP

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

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.