public class StagingItemWriter<T> extends org.springframework.jdbc.core.support.JdbcDaoSupport implements StepExecutionListener, ItemWriter<T>
ItemWriter
implementing the process indicator pattern.Modifier and Type | Field and Description |
---|---|
static String |
DONE |
static String |
NEW |
static Object |
WORKING |
Constructor and Description |
---|
StagingItemWriter() |
Modifier and Type | Method and Description |
---|---|
ExitStatus |
afterStep(StepExecution stepExecution)
Give a listener a chance to modify the exit status from a step.
|
void |
beforeStep(StepExecution stepExecution)
Initialize the state of the listener with the
StepExecution from
the current scope. |
protected void |
initDao()
Check mandatory properties.
|
void |
setIncrementer(org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer incrementer)
Setter for the key generator for the staging table.
|
void |
write(List<? extends T> items)
Serialize the item to the staging table, and add a NEW processed flag.
|
public static final String NEW
public static final String DONE
public static final Object WORKING
protected void initDao() throws Exception
initDao
in class org.springframework.dao.support.DaoSupport
Exception
DaoSupport.initDao()
public void setIncrementer(org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer incrementer)
incrementer
- the DataFieldMaxValueIncrementer
to setpublic void write(List<? extends T> items)
write
in interface ItemWriter<T>
ItemWriter.write(java.util.List)
public ExitStatus afterStep(StepExecution stepExecution)
StepExecutionListener
ExitStatus.and(ExitStatus)
.
Called after execution of step's processing logic (both successful or
failed). Throwing exception in this method has no effect, it will only be
logged.afterStep
in interface StepExecutionListener
ExitStatus
to combine with the normal value. Return
null to leave the old value unchanged.public void beforeStep(StepExecution stepExecution)
StepExecutionListener
StepExecution
from
the current scope.beforeStep
in interface StepExecutionListener
Copyright © 2014 Pivotal. All rights reserved.