Class StagingItemProcessor<T>
- java.lang.Object
- org.springframework.batch.sample.common.StagingItemProcessor<T>
- Type Parameters:
T
- item type
- All Implemented Interfaces:
ItemProcessor<ProcessIndicatorItemWrapper<T>,T>
,org.springframework.beans.factory.InitializingBean
public class StagingItemProcessor<T> extends java.lang.Object implements ItemProcessor<ProcessIndicatorItemWrapper<T>,T>, org.springframework.beans.factory.InitializingBean
Marks the input row as 'processed'. (This change will rollback if there is problem later)- Author:
- Robert Kasanicky
- See Also:
StagingItemReader
,StagingItemWriter
,ProcessIndicatorItemWrapper
Constructor Summary
Constructors Constructor Description StagingItemProcessor()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
T
process(ProcessIndicatorItemWrapper<T> wrapper)
Use the technical identifier to mark the input row as processed and return unwrapped item.void
setDataSource(javax.sql.DataSource dataSource)
void
setJdbcTemplate(org.springframework.jdbc.core.JdbcOperations jdbcTemplate)
Method Detail
setJdbcTemplate
public void setJdbcTemplate(org.springframework.jdbc.core.JdbcOperations jdbcTemplate)
setDataSource
public void setDataSource(javax.sql.DataSource dataSource)
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
process
public T process(ProcessIndicatorItemWrapper<T> wrapper) throws java.lang.Exception
Use the technical identifier to mark the input row as processed and return unwrapped item.- Specified by:
process
in interfaceItemProcessor<ProcessIndicatorItemWrapper<T>,T>
- Parameters:
wrapper
- to be processed- Returns:
- potentially modified or new item for continued processing,
null
if processing of the provided item should not continue. - Throws:
java.lang.Exception
- thrown if exception occurs during processing.