Package org.springframework.batch.core.launch

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


  public void testAsyncStopOfStartingJob() throws Exception {
    ApplicationContext applicationContext =
        new ClassPathXmlApplicationContext("org/springframework/batch/core/repository/dao/OptimisticLockingFailureTests-context.xml");
    Job job = applicationContext.getBean(Job.class);
    JobLauncher jobLauncher = applicationContext.getBean(JobLauncher.class);
    JobOperator jobOperator = applicationContext.getBean(JobOperator.class);

    JobExecution jobExecution = jobLauncher.run(job, new JobParametersBuilder()
        .addLong("test", 1L)
        .toJobParameters());

    Thread.sleep(1000);

    jobOperator.stop(jobExecution.getId());

    while(jobExecution.isRunning()) {
      // wait for async launched job to complete execution
    }
View Full Code Here

TOP

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

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.