title: Spring batch stop a job
body: <p>How can I stop a job in spring batch ? I tried to use this method using the code below:</p>
  
  <pre><code>public class jobListener implements JobExecutionListener{
  
    @Override
    public void beforeJob(JobExecution jobExecution) {
      jobExecution.setExitStatus(ExitStatus.STOPPED);
  
    }
  
  
    @Override
    public void afterJob(JobExecution jobExecution) {
      // TODO Auto-generated method stub
  
    }
  }
  </code></pre>
  
  <p>I tried also COMPLETED,FAILED but this method doesn't work and the job continues to execute. Any solution?</p>