Tabnine Logo
JobStepBuilder.listener
Code IndexAdd Tabnine to your IDE (free)

How to use
listener
method
in
org.springframework.batch.core.step.builder.JobStepBuilder

Best Java code snippets using org.springframework.batch.core.step.builder.JobStepBuilder.listener (Showing top 1 results out of 315)

origin: spring-projects/spring-batch

@Test
public void testAnnotationBasedChunkListenerForJobStepBuilder() throws Exception {
  JobRepository jobRepository = new MapJobRepositoryFactoryBean().getObject();
  StepExecution execution = jobRepository.createJobExecution("foo", new JobParameters()).createStepExecution("step");
  jobRepository.add(execution);
  PlatformTransactionManager transactionManager = new ResourcelessTransactionManager();
  SimpleJob job = new SimpleJob("job");
  job.setJobRepository(jobRepository);
  JobStepBuilder builder = new StepBuilder("step")
      .repository(jobRepository)
      .transactionManager(transactionManager)
      .job(job)
      .listener(new AnnotationBasedChunkListener());
  builder.build().execute(execution);
  assertEquals(BatchStatus.COMPLETED, execution.getStatus());
  // it makes no sense to register a ChunkListener on a step which is not of type tasklet, so it should not be invoked
  assertEquals(0, AnnotationBasedChunkListener.beforeChunkCount);
  assertEquals(0, AnnotationBasedChunkListener.afterChunkCount);
}
org.springframework.batch.core.step.builderJobStepBuilderlistener

Popular methods of JobStepBuilder

  • build
    Build a step from the job provided.
  • <init>
    Create a new builder initialized with any properties in the parent. The parent is copied, so it can
  • job
    Provide a job to execute during the step.
  • launcher
    Add a job launcher. Defaults to a simple job launcher.
  • getJobRepository
  • getName
  • parametersExtractor
    Provide a job parameters extractor. Useful for extracting job parameters from the parent step execut
  • repository
  • transactionManager

Popular in Java

  • Reactive rest calls using spring rest template
  • setContentView (Activity)
  • compareTo (BigDecimal)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JLabel (javax.swing)
  • Top PhpStorm plugins
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