org.springframework.batch.core.job.flow
Class FlowJob

java.lang.Object
  extended by org.springframework.batch.core.job.AbstractJob
      extended by org.springframework.batch.core.job.flow.FlowJob
All Implemented Interfaces:
Job, StepLocator, BeanNameAware, InitializingBean

public class FlowJob
extends AbstractJob

Implementation of the Job interface that allows for complex flows of steps, rather than requiring sequential execution. In general, this job implementation was designed to be used behind a parser, allowing for a namespace to abstract away details.

Since:
2.0
Author:
Dave Syer

Field Summary
 
Fields inherited from class org.springframework.batch.core.job.AbstractJob
logger
 
Constructor Summary
FlowJob()
          Create a FlowJob with null name and no flow (invalid state).
FlowJob(String name)
          Create a FlowJob with provided name and no flow (invalid state).
 
Method Summary
protected  void doExecute(JobExecution execution)
          Extension point for subclasses allowing them to concentrate on processing logic and ignore listeners and repository calls.
 Step getStep(String stepName)
          Retrieve the step with the given name.
 Collection<String> getStepNames()
          Retrieve the step names.
 void setFlow(Flow flow)
          Public setter for the flow.
 
Methods inherited from class org.springframework.batch.core.job.AbstractJob
afterPropertiesSet, execute, getJobParametersIncrementer, getName, handleStep, isRestartable, registerJobExecutionListener, setBeanName, setJobExecutionListeners, setJobParametersIncrementer, setJobRepository, setName, setRestartable, toString, updateStepExecution
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FlowJob

public FlowJob()
Create a FlowJob with null name and no flow (invalid state).


FlowJob

public FlowJob(String name)
Create a FlowJob with provided name and no flow (invalid state).

Method Detail

setFlow

public void setFlow(Flow flow)
Public setter for the flow.

Parameters:
flow - the flow to set

getStep

public Step getStep(String stepName)
Retrieve the step with the given name. If there is no Step with the given name, then return null.

Specified by:
getStep in interface StepLocator
Specified by:
getStep in class AbstractJob
Returns:
the Step

getStepNames

public Collection<String> getStepNames()
Retrieve the step names.

Specified by:
getStepNames in interface StepLocator
Specified by:
getStepNames in class AbstractJob
Returns:
the step names

doExecute

protected void doExecute(JobExecution execution)
                  throws JobExecutionException
Description copied from class: AbstractJob
Extension point for subclasses allowing them to concentrate on processing logic and ignore listeners and repository calls. Implementations usually are concerned with the ordering of steps, and delegate actual step processing to AbstractJob.handleStep(Step, JobExecution).

Specified by:
doExecute in class AbstractJob
Parameters:
execution - the current JobExecution
Throws:
JobExecutionException - to signal a fatal batch framework error (not a business or validation exception)
See Also:
AbstractJob.doExecute(JobExecution)


Copyright © 2009 SpringSource. All Rights Reserved.