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

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

public class SimpleStepFactoryBean
extends AbstractStepFactoryBean

Most common configuration options for simple steps should be found here. Use this factory bean instead of creating a Step implementation manually. This factory does not support configuration of fault-tolerant behavior, use appropriate subclass of this factory bean to configure skip or retry.

Author:
Dave Syer
See Also:
SkipLimitStepFactoryBean

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
SimpleStepFactoryBean()
           
 
Method Summary
protected  void applyConfiguration(ItemOrientedStep step)
           
protected  RepeatTemplate getChunkOperations()
          Protected getter for the chunk operations to make them available in subclasses.
protected  ExceptionHandler getExceptionHandler()
          Protected getter for the ExceptionHandler.
protected  ItemHandler getItemHandler()
          Public getter for the ItemHandler.
protected  RepeatTemplate getStepOperations()
          Protected getter for the step operations to make them available in subclasses.
 void setChunkCompletionPolicy(CompletionPolicy chunkCompletionPolicy)
          Public setter for the CompletionPolicy applying to the chunk level.
 void setCommitInterval(int commitInterval)
          Set the commit interval.
 void setExceptionHandler(ExceptionHandler exceptionHandler)
          Public setter for the ExceptionHandler.
protected  void setItemHandler(ItemHandler itemHandler)
          Public setter for the ItemHandler.
 void setTaskExecutor(TaskExecutor taskExecutor)
          Public setter for the TaskExecutor.
 void setThrottleLimit(int throttleLimit)
          Public setter for the throttle limit.
 
Methods inherited from class org.springframework.batch.core.step.item.AbstractStepFactoryBean
getItemReader, getItemWriter, getListeners, getName, getObject, getObjectType, getTransactionAttribute, isSingleton, setAllowStartIfComplete, setBeanName, setItemReader, setItemWriter, setJobRepository, setListeners, setSingleton, setStartLimit, setStreams, setTransactionAttribute, setTransactionManager
 
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

SimpleStepFactoryBean

public SimpleStepFactoryBean()
Method Detail

setCommitInterval

public void setCommitInterval(int commitInterval)
Set the commit interval. Either set this or the chunkCompletionPolicy but not both.

Parameters:
commitInterval - 1 by default

setChunkCompletionPolicy

public void setChunkCompletionPolicy(CompletionPolicy chunkCompletionPolicy)
Public setter for the CompletionPolicy applying to the chunk level. A transaction will be committed when this policy decides to complete. Defaults to a SimpleCompletionPolicy with chunk size equal to the commitInterval property.

Parameters:
chunkCompletionPolicy - the chunkCompletionPolicy to set

getStepOperations

protected RepeatTemplate getStepOperations()
Protected getter for the step operations to make them available in subclasses.

Returns:
the step operations

getChunkOperations

protected RepeatTemplate getChunkOperations()
Protected getter for the chunk operations to make them available in subclasses.

Returns:
the step operations

setExceptionHandler

public void setExceptionHandler(ExceptionHandler exceptionHandler)
Public setter for the ExceptionHandler.

Parameters:
exceptionHandler - the exceptionHandler to set

getExceptionHandler

protected ExceptionHandler getExceptionHandler()
Protected getter for the ExceptionHandler.

Returns:
the ExceptionHandler

setTaskExecutor

public void setTaskExecutor(TaskExecutor taskExecutor)
Public setter for the TaskExecutor. If this is set, then it will be used to execute the chunk processing inside the Step.

Parameters:
taskExecutor - the taskExecutor to set

setThrottleLimit

public void setThrottleLimit(int throttleLimit)
Public setter for the throttle limit. This limits the number of tasks queued for concurrent processing to prevent thread pools from being overwhelmed. Defaults to TaskExecutorRepeatTemplate.DEFAULT_THROTTLE_LIMIT.

Parameters:
throttleLimit - the throttle limit to set.

getItemHandler

protected ItemHandler getItemHandler()
Public getter for the ItemHandler.

Returns:
the ItemHandler

setItemHandler

protected void setItemHandler(ItemHandler itemHandler)
Public setter for the ItemHandler.

Parameters:
itemHandler - the ItemHandler to set

applyConfiguration

protected void applyConfiguration(ItemOrientedStep step)
Overrides:
applyConfiguration in class AbstractStepFactoryBean
Parameters:
step -


Copyright © 2009 SpringSource. All Rights Reserved.