org.springframework.batch.core.job
Class SimpleJob

java.lang.Object
  extended by org.springframework.batch.core.job.AbstractJob
      extended by org.springframework.batch.core.job.SimpleJob
All Implemented Interfaces:
Job, BeanNameAware

public class SimpleJob
extends AbstractJob

Simple implementation of (@link Job} interface providing the ability to run a JobExecution. Sequentially executes a job by iterating through its list of steps.

Author:
Lucas Ward, Dave Syer

Constructor Summary
SimpleJob()
           
 
Method Summary
 void execute(JobExecution execution)
          Run the specified job by looping through the steps and delegating to the Step.
 void registerJobExecutionListener(JobExecutionListener listener)
          Register a single listener for the JobExecutionListener callbacks.
 void setJobExecutionListeners(JobExecutionListener[] listeners)
          Public setter for injecting JobExecutionListeners.
 void setJobRepository(JobRepository jobRepository)
          Public setter for the JobRepository that is needed to manage the state of the batch meta domain (jobs, steps, executions) during the life of a job.
 
Methods inherited from class org.springframework.batch.core.job.AbstractJob
addStep, getName, getSteps, isRestartable, setBeanName, setName, setRestartable, setSteps, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleJob

public SimpleJob()
Method Detail

setJobExecutionListeners

public void setJobExecutionListeners(JobExecutionListener[] listeners)
Public setter for injecting JobExecutionListeners. They will all be given the listener callbacks at the appropriate point in the job.

Parameters:
listeners - the listeners to set.

registerJobExecutionListener

public void registerJobExecutionListener(JobExecutionListener listener)
Register a single listener for the JobExecutionListener callbacks.

Parameters:
listener - a JobExecutionListener

execute

public void execute(JobExecution execution)
             throws JobExecutionException
Run the specified job by looping through the steps and delegating to the Step.

Parameters:
execution - a JobExecution
Throws:
StartLimitExceededException - if start limit of one of the steps was exceeded
JobExecutionException
See Also:
Job.execute(org.springframework.batch.core.JobExecution)

setJobRepository

public void setJobRepository(JobRepository jobRepository)
Public setter for the JobRepository that is needed to manage the state of the batch meta domain (jobs, steps, executions) during the life of a job.

Parameters:
jobRepository -


Copyright © 2008 SpringSource. All Rights Reserved.