Package org.springframework.batch.core

Examples of org.springframework.batch.core.JobParameters


* @author Costin Leau
*/
public class JobsTrigger {

  public static List<JobExecution> startJobs(ListableBeanFactory bf) {
    return startJobs(bf, new JobParameters());
  }
View Full Code Here


  }

  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

  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);
    context.close();
  }
View Full Code Here

    Map<String, Object> jobDataMap = context.getMergedJobDataMap();
   
    String jobName = (String) jobDataMap.get(JOB_NAME);
    log.info("Quartz trigger firing with Spring Batch jobName=" + jobName);
   
    JobParameters jobParameters = getJobParametersFromJobMap(jobDataMap);
    try {
      jobLauncher.run(jobLocator.getJob(jobName), jobParameters);

    } catch (JobExecutionException e) {
      log.error("Could not execute job.", e);
View Full Code Here

                        logger.debug("Trigger a new job for a new email, type: " + addressGeolocMessageJms.getGeolocType());
                    }

                    JobParametersBuilder jobParametersBuilder = new JobParametersBuilder();
                    jobParametersBuilder.addDate("date", new Date());
                    JobParameters params = jobParametersBuilder.toJobParameters();
                    jobLauncher.run(gelocJob, params);
                }
            }
           
        } catch (JMSException e) {
View Full Code Here

                        logger.debug("Trigger a new job for a new email, type: " + emailnotificationMessageJms.getEmailType());
                    }

                    JobParametersBuilder jobParametersBuilder = new JobParametersBuilder();
                    jobParametersBuilder.addDate("date", new Date());
                    JobParameters params = jobParametersBuilder.toJobParameters();
                    jobLauncher.run(emailSyncJob, params);
                }
            }
           
        } catch (JMSException e) {
View Full Code Here

        this.jobLauncher = jobLauncher;
    }

    @Override
    public void process(Exchange exchange) throws Exception {
        JobParameters jobParameters = prepareJobParameters(exchange.getIn().getHeaders());
        jobLauncher.run(job, jobParameters);
    }
View Full Code Here

        this.jobLauncher = jobLauncher;
    }

    @Override
    public void process(Exchange exchange) throws Exception {
        JobParameters jobParameters = prepareJobParameters(exchange.getIn().getHeaders());
        jobLauncher.run(job, jobParameters);
    }
View Full Code Here

        this.jobLauncher = jobLauncher;
    }

    @Override
    public void process(Exchange exchange) throws Exception {
        JobParameters jobParameters = prepareJobParameters(exchange.getIn().getHeaders());
        JobExecution jobExecution = jobLauncher.run(job, jobParameters);
        exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders());
        exchange.getOut().setBody(jobExecution);
    }
View Full Code Here

            } else {
                // if the value is null we just put String with null value here to avoid the NPE
                parametersBuilder.addString(headerKey, null);
            }
        }
        JobParameters jobParameters = parametersBuilder.toJobParameters();
        log.debug("Prepared parameters for Spring Batch job: {}", jobParameters);
        return jobParameters;
    }
View Full Code Here

TOP

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

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.