org.springframework.batch.core.job.builder
Class JobBuilderHelper<B extends JobBuilderHelper<B>>

java.lang.Object
  extended by org.springframework.batch.core.job.builder.JobBuilderHelper<B>
Direct Known Subclasses:
FlowJobBuilder, JobBuilder, SimpleJobBuilder

public abstract class JobBuilderHelper<B extends JobBuilderHelper<B>>
extends Object

A base class and utility for other job builders providing access to common properties like job repository.

Since:
2.2
Author:
Dave Syer

Nested Class Summary
static class JobBuilderHelper.CommonJobProperties
           
 
Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
protected JobBuilderHelper(JobBuilderHelper<?> parent)
          Create a new builder initialized with any properties in the parent.
  JobBuilderHelper(String name)
           
 
Method Summary
protected  void enhance(Job target)
           
protected  JobRepository getJobRepository()
           
protected  String getName()
           
 B incrementer(JobParametersIncrementer jobParametersIncrementer)
          Add a job parameters incrementer.
protected  boolean isRestartable()
           
 B listener(JobExecutionListener listener)
          Register a job execution listener.
 B preventRestart()
          Set a flag to prevent restart an execution of this job even if it has failed.
 B repository(JobRepository jobRepository)
          Sets the job repository for the job.
 B validator(JobParametersValidator jobParametersValidator)
          Add a job parameters validator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

JobBuilderHelper

public JobBuilderHelper(String name)

JobBuilderHelper

protected JobBuilderHelper(JobBuilderHelper<?> parent)
Create a new builder initialized with any properties in the parent. The parent is copied, so it can be re-used.

Parameters:
parent - a parent helper containing common step properties
Method Detail

validator

public B validator(JobParametersValidator jobParametersValidator)
Add a job parameters validator.

Parameters:
jobParametersValidator - a job parameters validator
Returns:
this to enable fluent chaining

incrementer

public B incrementer(JobParametersIncrementer jobParametersIncrementer)
Add a job parameters incrementer.

Parameters:
jobParametersIncrementer - a job parameters incrementer
Returns:
this to enable fluent chaining

repository

public B repository(JobRepository jobRepository)
Sets the job repository for the job.

Parameters:
jobRepository - the job repository (mandatory)
Returns:
this to enable fluent chaining

listener

public B listener(JobExecutionListener listener)
Register a job execution listener.

Parameters:
listener - a job execution listener
Returns:
this to enable fluent chaining

preventRestart

public B preventRestart()
Set a flag to prevent restart an execution of this job even if it has failed.

Returns:
this to enable fluent chaining

getName

protected String getName()

getJobRepository

protected JobRepository getJobRepository()

isRestartable

protected boolean isRestartable()

enhance

protected void enhance(Job target)


Copyright © 2013 SpringSource. All Rights Reserved.