Examples of NoSuchJobException


Examples of javax.batch.operations.NoSuchJobException

  public List<Long> getRunningExecutions(String name)
      throws NoSuchJobException, JobSecurityException {
    Set<org.springframework.batch.core.JobExecution> findRunningJobExecutions = jobExplorer.findRunningJobExecutions(name);

    if(findRunningJobExecutions.isEmpty()) {
      throw new NoSuchJobException("Job name: " + name + " not found.");
    }

    List<Long> results = new ArrayList<Long>(findRunningJobExecutions.size());

    for (org.springframework.batch.core.JobExecution jobExecution : findRunningJobExecutions) {
View Full Code Here

Examples of javax.batch.operations.NoSuchJobException

  public List<StepExecution> getStepExecutions(long executionId)
      throws NoSuchJobExecutionException, JobSecurityException {
    org.springframework.batch.core.JobExecution execution = jobExplorer.getJobExecution(executionId);

    if(execution == null) {
      throw new NoSuchJobException("JobExecution with the id " + executionId + " was not found");
    }

    Collection<org.springframework.batch.core.StepExecution> executions = execution.getStepExecutions();

    List<StepExecution> batchExecutions = new ArrayList<StepExecution>();
View Full Code Here

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

      return;
    }
    if (jobInstanceDao.countJobInstances(jobName) > 0) {
      return;
    }
    throw new NoSuchJobException("No Job with that name either current or historic: [" + jobName + "]");
  }
View Full Code Here

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

        count++;
      }
    }

    if(count == 0) {
      throw new NoSuchJobException("No job instances for job name " + jobName + " were found");
    } else {
      return count;
    }
  }
View Full Code Here

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

      return getJdbcTemplate().queryForObject(
          getQuery(COUNT_JOBS_WITH_NAME),
          Integer.class,
          jobName);
    } catch (EmptyResultDataAccessException e) {
      throw new NoSuchJobException("No job instances were found for job name " + jobName);
    }
  }
View Full Code Here

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

  @Override
  public Step getStep(String jobName, String stepName) throws NoSuchJobException {
    Assert.notNull(jobName, "The job name cannot be null.");
    Assert.notNull(stepName, "The step name cannot be null.");
    if (!map.containsKey(jobName)) {
      throw new NoSuchJobException("No job configuration with the name [" + jobName + "] was registered");
    } else {
      final Map<String, Step> jobSteps = map.get(jobName);
      if (jobSteps.containsKey(stepName)) {
        return jobSteps.get(stepName);
      } else {
View Full Code Here

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

  @Override
  public Job getJob(String name) throws NoSuchJobException {
    JobFactory factory = map.get(name);
    if (factory == null) {
      throw new NoSuchJobException("No job configuration with the name [" + name + "] was registered");
    } else {
      return factory.createJob();
    }
  }
View Full Code Here

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

          count++;
        }
      }

      if(count == 0) {
        throw new NoSuchJobException("Unable to find job instances for " + jobName);
      } else {
        return count;
      }
    }
View Full Code Here

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

      @Override
      public Job getJob(String name) throws NoSuchJobException {
        if (name.equals("foo")) {
          return job;
        }
        throw new NoSuchJobException("foo");
      }

      @Override
      public Set<String> getJobNames() {
        return new HashSet<String>(Arrays.asList(new String[] { "foo", "bar" }));
View Full Code Here

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

    assertEquals(4, jobExplorer.getJobInstanceCount("myJob"));
  }

  @Test(expected=NoSuchJobException.class)
  public void testGetJobInstanceCountException() throws Exception {
    when(jobInstanceDao.getJobInstanceCount("throwException")).thenThrow(new NoSuchJobException("expected"));

    jobExplorer.getJobInstanceCount("throwException");
  }
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.