Package org.springframework.batch.core

Examples of org.springframework.batch.core.Job


      log.info("No jobRegistry defined, skipping registered jobs");
    }
    if (this.jobRegistry != null && StringUtils.hasText(this.jobName)) {
      for (String name : this.jobRegistry.getJobNames()) {
        if (StringUtils.hasText(this.jobName) && jobMatches(this.jobName, name)) {
          Job job = this.jobRegistry.getJob(name);
          executeJob(job, jobParameters);
        } else {
          log.debug("Skipped registered job: " + name);
        }
View Full Code Here


    JobParametersBuilder jobParametersBuilder = new JobParametersBuilder();
    jobParametersBuilder.addString(JOB_PARAM_PID_KEY,
        pidMessage.getPayload());
    JobParameters jobParameters = jobParametersBuilder.toJobParameters();

    Job job = null;
    try {
      job = jobLocator.getJob("generateDerivatives");
    } catch (NoSuchJobException e) {
      e.printStackTrace();
    }
View Full Code Here

    this.jobLauncher = jobLauncher;
  }

  @Override
  public void write(List<? extends String> pids) throws Exception {
    Job derivativeGenerationJob = jobLocator.getJob("generateDerivatives");

    for (String pid : pids) {
      JobParametersBuilder jobParametersBuilder = new JobParametersBuilder();
      jobParametersBuilder.addString(JOB_PARAM_PID_KEY, pid);
      JobParameters jobParameters = jobParametersBuilder
View Full Code Here

    JobParametersBuilder jobParametersBuilder = new JobParametersBuilder();
    jobParametersBuilder.addString("GUID", guid);
    jobParametersBuilder.addString("URI", uri);
    JobParameters jobParameters = jobParametersBuilder.toJobParameters();
   
    Job job = null;
    try {
      job = jobLocator.getJob("batchIngestJob");
    } catch (NoSuchJobException e) {
      e.printStackTrace();
    }
View Full Code Here

    logger.info("Transforming job launch request {} / {}",
        sipMessage.getPayload().getGuid(),
        sipMessage.getPayload().getURI().toString()
        );

    Job job = null;
    try {
      job = jobLocator.getJob("batchIngestJob");
    } catch (NoSuchJobException e) {
      e.printStackTrace();
    }
View Full Code Here

    JobParametersBuilder jobParametersBuilder = new JobParametersBuilder();
    jobParametersBuilder.addString("GUID", guid);
    jobParametersBuilder.addString("URI", uri);
    JobParameters jobParameters = jobParametersBuilder.toJobParameters();
   
    Job job = null;
    try {
      job = jobLocator.getJob("batchIngestJob");
    } catch (NoSuchJobException e) {
      e.printStackTrace();
    }
View Full Code Here

    }
    return executions;
  }

  public static JobExecution startJob(ListableBeanFactory lbf, String jobName) throws Exception {
    Job job = lbf.getBean(jobName, Job.class);
    JobLauncher launcher = lbf.getBean(JobLauncher.class);
    return launcher.run(job, new JobParameters());
  }
View Full Code Here

  @Test
  public void testWithinJob() throws Exception {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("/org/springframework/data/hadoop/fs/HdfsItemWriterTest-context.xml");
    JobLauncher launcher = context.getBean(JobLauncher.class);
    Job job = context.getBean(Job.class);

    JobParameters jobParameters = new JobParametersBuilder().toJobParameters();

    JobExecution execution = launcher.run(job, jobParameters);
    assertTrue("status was: " + execution.getStatus(), execution.getStatus() == BatchStatus.COMPLETED);
View Full Code Here

    // Tests

    @Test
    public void shouldInjectJobToEndpoint() throws IllegalAccessException {
        SpringBatchEndpoint batchEndpoint = getMandatoryEndpoint("spring-batch:mockJob", SpringBatchEndpoint.class);
        Job batchEndpointJob = (Job) FieldUtils.readField(batchEndpoint, "job", true);
        assertSame(job, batchEndpointJob);
    }
View Full Code Here

    private Map<String, JobLauncher> allResolvedJobLaunchers;

    @Override
    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
        Job resolvedJob = CamelContextHelper.mandatoryLookup(getCamelContext(), remaining, Job.class);
        return new SpringBatchEndpoint(uri, this, jobLauncher, defaultResolvedJobLauncher, allResolvedJobLaunchers, resolvedJob);
    }
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.Job

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.