Want to write articles/new answer to be published in javapedia.net? Send in your article with your name to javatutorials2016@gmail.com!

Prev Next

Spring / Spring batch Interview questions

How do I intercept a Job Execution in Spring Batch?

During the course of the execution of a Job, it may be useful to be notified of various events in its lifecycle so that custom code may be executed. The SimpleJob allows for this by calling a JobListener at the appropriate time.

public interface JobExecutionListener {

    void beforeJob(JobExecution jobExecution);

    void afterJob(JobExecution jobExecution);


JobListeners can be added to a SimpleJob via the listeners element on the job.

<job id="myBatchJob">
    <step id="mySimpleStep"  />
        <listener ref="myJobListener"/>

The annotations corresponding to this interface are:

  • @BeforeJob.
  • @AfterJob.

Invest now!!! Get Free equity stock!

Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.

The Robinhood app makes it easy to trade stocks, crypto and more.

More Related questions...

Explain spring batch framework. List out some of the practical usage scenario of Spring Batch framework. Technical advantages of using Spring Batch Framework from a Developer perspective. Explain the Spring Batch framework architecture. How do you categorize batch applications based on input source in spring batch? What are the typical processing strategies in spring batch? How do I start a Spring Batch Job? What are the important features of Spring Batch? Explain Normal processing strategy in spring Batch framework. Explain Concurrent batch on-line processing in Spring Batch Framework. Explain parallel processing in Spring Batch Framework. Explain Partitioning in Spring Batch framework. Explain the spring batch framework architecture. What is tasklet in Spring batch framework? How do I configure a job in spring batch framework? What are Spring Batch metadata schema? Can we create a Spring batch with No step? what are the different bean scope in Spring Batch 3.0? Can we configure Spring Batch without persisting metadata to database? How do we track the number of item processed by the ItemReader in Spring batch? Define a Job in Spring Batch. What are the elements of job configuration in spring batch? How do I intercept a Job Execution in Spring Batch? What is Job launcher in Spring Batch framework? Spring Batch Framework: What is ExecutionContext? Can we create Spring Batch Job without using XML configuration? How do you run Spring Batch jobs in Production Environment? What is CommandLineJobRunner in Spring Batch? How do I configure parallel execution of steps in Spring Batch? What is ResourceAware is Spring Batch? Difference between Spring Batch and Quartz Scheduler. How do I schedule a job with Spring Batch? How can I make an item reader thread safe in Spring Batch? What is the latest version of Spring Batch? What is ItemReader in Spring batch framework? What is ItemWriter in Spring batch framework? Spring Batch: What is ItemProcessor? Mention the different ItemReader and ItemWriter implementations available in Spring Batch? Name few of the domain buzzwords in Spring Batch. Spring Batch: What Job configuration consists of? Spring Batch: What is JobInstance? Spring Batch: Difference between Step and StepExecution. Spring batch: Define ExecutionContext. Spring batch: uses of JobRepository. Spring batch: What are the required dependencies for configuring a job? Spring batch: list the job configurations other than step. Can a spring batch Job have a parent job? Explain the role of JobParametersValidator in Spring Batch. How do I setup Spring batch job without using XML? Explain the role of JobRepository in Spring batch. How do you implement conditional step flow in Spring batch? What is the default isolation level of Spring batch transactions? How do I configure parallel execution of steps in Spring batch? What is a cron job? How cron job works in Linux? What is an autosys box? Explain the role MapJobRegistry in Spring Batch.
Show more question and Answers...

Spring MVC Interview questions

Comments & Discussions