Tabnine Logo
JobExecutionListener.afterJob
Code IndexAdd Tabnine to your IDE (free)

How to use
afterJob
method
in
org.springframework.batch.core.JobExecutionListener

Best Java code snippets using org.springframework.batch.core.JobExecutionListener.afterJob (Showing top 13 results out of 315)

origin: spring-projects/spring-batch

/**
 * Call the registered listeners in reverse order, respecting and
 * prioritising those that implement {@link Ordered}.
 * @see org.springframework.batch.core.JobExecutionListener#afterJob(org.springframework.batch.core.JobExecution)
 */
@Override
public void afterJob(JobExecution jobExecution) {
  for (Iterator<JobExecutionListener> iterator = listeners.reverse(); iterator.hasNext();) {
    JobExecutionListener listener = iterator.next();
    listener.afterJob(jobExecution);
  }
}
origin: spring-projects/spring-batch

@Test
public void testInterruptWithListener() throws Exception {
  step1.setProcessException(new JobInterruptedException("job interrupted!"));
  JobExecutionListener listener = mock(JobExecutionListener.class);
  listener.beforeJob(jobExecution);
  listener.afterJob(jobExecution);
  job.setJobExecutionListeners(new JobExecutionListener[] { listener });
  job.execute(jobExecution);
  assertEquals(BatchStatus.STOPPED, jobExecution.getStatus());
}
origin: spring-projects/spring-batch

@Test
public void testEmptySignatureNamedMethod() {
  AbstractTestComponent delegate = new AbstractTestComponent() {
    @SuppressWarnings("unused")
    public void aMethod() {
      executed = true;
    }
  };
  factoryBean.setDelegate(delegate);
  Map<String, String> metaDataMap = new HashMap<>();
  metaDataMap.put(AFTER_JOB.getPropertyName(), "aMethod");
  factoryBean.setMetaDataMap(metaDataMap);
  JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
  listener.afterJob(new JobExecution(1L));
  assertTrue(delegate.isExecuted());
}
origin: spring-projects/spring-batch

@Test
public void testRightSignatureNamedMethod() {
  AbstractTestComponent delegate = new AbstractTestComponent() {
    @SuppressWarnings("unused")
    public void aMethod(JobExecution jobExecution) {
      executed = true;
      assertEquals(new Long(25), jobExecution.getId());
    }
  };
  factoryBean.setDelegate(delegate);
  Map<String, String> metaDataMap = new HashMap<>();
  metaDataMap.put(AFTER_JOB.getPropertyName(), "aMethod");
  factoryBean.setMetaDataMap(metaDataMap);
  JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
  listener.afterJob(new JobExecution(25L));
  assertTrue(delegate.isExecuted());
}
origin: spring-projects/spring-batch

@Test
public void testFactoryMethod() throws Exception {
  JobListenerWithInterface delegate = new JobListenerWithInterface();
  Object listener = JobListenerFactoryBean.getListener(delegate);
  assertTrue(listener instanceof JobExecutionListener);
  ((JobExecutionListener) listener).afterJob(new JobExecution(11L));
  assertTrue(delegate.afterJobCalled);
}
origin: spring-projects/spring-batch

@Test
public void testEmptySignatureAnnotation() {
  AbstractTestComponent delegate = new AbstractTestComponent() {
    @AfterJob
    public void aMethod() {
      executed = true;
    }
  };
  factoryBean.setDelegate(delegate);
  JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
  listener.afterJob(new JobExecution(1L));
  assertTrue(delegate.isExecuted());
}
origin: spring-projects/spring-batch

@Test
public void testRightSignatureAnnotation() {
  AbstractTestComponent delegate = new AbstractTestComponent() {
    @AfterJob
    public void aMethod(JobExecution jobExecution) {
      executed = true;
      assertEquals(new Long(25), jobExecution.getId());
    }
  };
  factoryBean.setDelegate(delegate);
  JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
  listener.afterJob(new JobExecution(25L));
  assertTrue(delegate.isExecuted());
}
origin: spring-projects/spring-batch

@Test
public void testWithInterface() throws Exception {
  JobListenerWithInterface delegate = new JobListenerWithInterface();
  factoryBean.setDelegate(delegate);
  JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
  JobExecution jobExecution = new JobExecution(11L);
  listener.beforeJob(jobExecution);
  listener.afterJob(jobExecution);
  assertTrue(delegate.beforeJobCalled);
  assertTrue(delegate.afterJobCalled);
}
origin: spring-projects/spring-batch

@Test
public void testWithAnnotations() throws Exception {
  AnnotatedTestClass delegate = new AnnotatedTestClass();
  factoryBean.setDelegate(delegate);
  JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
  JobExecution jobExecution = new JobExecution(11L);
  listener.beforeJob(jobExecution);
  listener.afterJob(jobExecution);
  assertTrue(delegate.beforeJobCalled);
  assertTrue(delegate.afterJobCalled);
}
origin: org.springframework.batch/spring-batch-core

/**
 * Call the registered listeners in reverse order, respecting and
 * prioritising those that implement {@link Ordered}.
 * @see org.springframework.batch.core.JobExecutionListener#afterJob(org.springframework.batch.core.JobExecution)
 */
@Override
public void afterJob(JobExecution jobExecution) {
  for (Iterator<JobExecutionListener> iterator = listeners.reverse(); iterator.hasNext();) {
    JobExecutionListener listener = iterator.next();
    listener.afterJob(jobExecution);
  }
}
origin: apache/servicemix-bundles

/**
 * Call the registered listeners in reverse order, respecting and
 * prioritising those that implement {@link Ordered}.
 * @see org.springframework.batch.core.JobExecutionListener#afterJob(org.springframework.batch.core.JobExecution)
 */
@Override
public void afterJob(JobExecution jobExecution) {
  for (Iterator<JobExecutionListener> iterator = listeners.reverse(); iterator.hasNext();) {
    JobExecutionListener listener = iterator.next();
    listener.afterJob(jobExecution);
  }
}
origin: org.springframework.batch/org.springframework.batch.core

/**
 * Call the registered listeners in reverse order, respecting and
 * prioritising those that implement {@link Ordered}.
 * @see org.springframework.batch.core.JobExecutionListener#afterJob(org.springframework.batch.core.JobExecution)
 */
public void afterJob(JobExecution jobExecution) {
  for (Iterator<JobExecutionListener> iterator = listeners.reverse(); iterator.hasNext();) {
    JobExecutionListener listener = iterator.next();
    listener.afterJob(jobExecution);
  }
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

/**
 * Call the registered listeners in reverse order, respecting and
 * prioritising those that implement {@link Ordered}.
 * @see org.springframework.batch.core.JobExecutionListener#afterJob(org.springframework.batch.core.JobExecution)
 */
@Override
public void afterJob(JobExecution jobExecution) {
  for (Iterator<JobExecutionListener> iterator = listeners.reverse(); iterator.hasNext();) {
    JobExecutionListener listener = iterator.next();
    listener.afterJob(jobExecution);
  }
}
org.springframework.batch.coreJobExecutionListenerafterJob

Javadoc

Callback after completion of a job. Called after both both successful and failed executions. To perform logic on a particular status, use "if (jobExecution.getStatus() == BatchStatus.X)".

Popular methods of JobExecutionListener

  • beforeJob
    Callback before a job executes.

Popular in Java

  • Reading from database using SQL prepared statement
  • getSystemService (Context)
  • runOnUiThread (Activity)
  • getContentResolver (Context)
  • Menu (java.awt)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JPanel (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now