Package org.springframework.batch.core.listener

Examples of org.springframework.batch.core.listener.JobExecutionListenerSupport


    //
    // Dump the given Job ExecutionContext using a listener
    //
    if (jobExecutionContext != null && !jobExecutionContext.isEmpty()) {
      job.setJobExecutionListeners(new JobExecutionListener[] { new JobExecutionListenerSupport() {
        @Override
        public void beforeJob(JobExecution jobExecution) {
          ExecutionContext jobContext = jobExecution.getExecutionContext();
          for (Map.Entry<String, Object> entry : jobExecutionContext.entrySet()) {
            jobContext.put(entry.getKey(), entry.getValue());
View Full Code Here


    assertFalse(step2.passedInJobContext.isEmpty());
  }

  @Test
  public void testRunNormallyWithListener() throws Exception {
    job.setJobExecutionListeners(new JobExecutionListenerSupport[] { new JobExecutionListenerSupport() {
      @Override
      public void beforeJob(JobExecution jobExecution) {
        list.add("before");
      }
View Full Code Here

    checkRepository(BatchStatus.FAILED, ExitStatus.FAILED);
  }

  @Test
  public void testFailedWithListener() throws Exception {
    job.setJobExecutionListeners(new JobExecutionListenerSupport[] { new JobExecutionListenerSupport() {
      @Override
      public void afterJob(JobExecution jobExecution) {
        list.add("afterJob");
      }
    } });
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.listener.JobExecutionListenerSupport

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.