org.springframework.batch.core.step.item
Class AbstractStepFactoryBean

java.lang.Object
  extended by org.springframework.batch.core.step.item.AbstractStepFactoryBean
All Implemented Interfaces:
BeanNameAware, FactoryBean
Direct Known Subclasses:
RepeatOperationsStepFactoryBean, SimpleStepFactoryBean

public abstract class AbstractStepFactoryBean
extends Object
implements FactoryBean, BeanNameAware

Base class for factory beans for ItemOrientedStep. Ensures that all the mandatory properties are set, and provides basic support for the Step interface responsibilities like start limit.

Author:
Dave Syer

Constructor Summary
AbstractStepFactoryBean()
           
 
Method Summary
protected  void applyConfiguration(ItemOrientedStep step)
           
protected  ItemReader getItemReader()
          Protected getter for the ItemReader for subclasses to use.
protected  ItemWriter getItemWriter()
          Protected getter for the ItemWriter for subclasses to use
 String getName()
          Public getter for the String.
 Object getObject()
          Create a Step from the configuration provided.
 Class getObjectType()
           
 boolean isSingleton()
          Returns true by default, but in most cases a Step should not be treated as thread safe.
 void setAllowStartIfComplete(boolean allowStartIfComplete)
          Public setter for the shouldAllowStartIfComplete.
 void setBeanName(String name)
          Set the bean name property, which will become the name of the Step when it is created.
 void setItemReader(ItemReader itemReader)
           
 void setItemWriter(ItemWriter itemWriter)
           
 void setJobRepository(JobRepository jobRepository)
          Public setter for JobRepository.
 void setSingleton(boolean singleton)
          Public setter for the singleton flag.
 void setStartLimit(int startLimit)
          Public setter for the startLimit.
 void setTransactionManager(PlatformTransactionManager transactionManager)
          Public setter for the PlatformTransactionManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStepFactoryBean

public AbstractStepFactoryBean()
Method Detail

setBeanName

public void setBeanName(String name)
Set the bean name property, which will become the name of the Step when it is created.

Specified by:
setBeanName in interface BeanNameAware
See Also:
BeanNameAware.setBeanName(java.lang.String)

getName

public String getName()
Public getter for the String.

Returns:
the name

setStartLimit

public void setStartLimit(int startLimit)
Public setter for the startLimit.

Parameters:
startLimit - the startLimit to set

setAllowStartIfComplete

public void setAllowStartIfComplete(boolean allowStartIfComplete)
Public setter for the shouldAllowStartIfComplete.

Parameters:
allowStartIfComplete - the shouldAllowStartIfComplete to set

setItemReader

public void setItemReader(ItemReader itemReader)
Parameters:
itemReader - the itemReader to set

setItemWriter

public void setItemWriter(ItemWriter itemWriter)
Parameters:
itemWriter - the itemWriter to set

getItemReader

protected ItemReader getItemReader()
Protected getter for the ItemReader for subclasses to use.

Returns:
the itemReader

getItemWriter

protected ItemWriter getItemWriter()
Protected getter for the ItemWriter for subclasses to use

Returns:
the itemWriter

setJobRepository

public void setJobRepository(JobRepository jobRepository)
Public setter for JobRepository.

Parameters:
jobRepository - is a mandatory dependence (no default).

setTransactionManager

public void setTransactionManager(PlatformTransactionManager transactionManager)
Public setter for the PlatformTransactionManager.

Parameters:
transactionManager - the transaction manager to set

getObject

public final Object getObject()
                       throws Exception
Create a Step from the configuration provided.

Specified by:
getObject in interface FactoryBean
Throws:
Exception
See Also:
FactoryBean.getObject()

applyConfiguration

protected void applyConfiguration(ItemOrientedStep step)
Parameters:
step -

getObjectType

public Class getObjectType()
Specified by:
getObjectType in interface FactoryBean

isSingleton

public boolean isSingleton()
Returns true by default, but in most cases a Step should not be treated as thread safe. Clients are recommended to create a new step for each job execution.

Specified by:
isSingleton in interface FactoryBean
See Also:
FactoryBean.isSingleton()

setSingleton

public void setSingleton(boolean singleton)
Public setter for the singleton flag.

Parameters:
singleton - the value to set. Defaults to true.


Copyright © 2008 SpringSource. All Rights Reserved.