Package org.springframework.batch.core.launch

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


        count++;
      }
    }

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

      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

  @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

  @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

          count++;
        }
      }

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

      @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

    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

   * (non-Javadoc)
   * @see org.springframework.batch.io.exception.AbstractExceptionTests#getException(java.lang.String)
   */
    @Override
  public Exception getException(String msg) throws Exception {
    return new NoSuchJobException(msg);
  }
View Full Code Here

   * @see org.springframework.batch.io.exception.AbstractExceptionTests#getException(java.lang.String,
   * java.lang.Throwable)
   */
    @Override
  public Exception getException(String msg, Throwable t) throws Exception {
    return new NoSuchJobException(msg, t);
  }
View Full Code Here

TOP

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

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.