|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.core.step.item.SimpleItemHandler
public class SimpleItemHandler
Simplest possible implementation of ItemHandler
with no skipping or
recovering. Just delegates all calls to the provided ItemReader
and
ItemWriter
.
Provides extension points by protected read(StepContribution)
and
write(Object, StepContribution)
methods that can be overriden to
provide more sophisticated behavior (e.g. skipping).
Constructor Summary | |
---|---|
SimpleItemHandler(ItemReader itemReader,
ItemWriter itemWriter)
|
Method Summary | |
---|---|
void |
clear()
Implementations should delegate to an ItemWriter . |
protected Object |
doRead()
|
protected void |
doWrite(Object item)
|
void |
flush()
Implementations should delegate to an ItemWriter . |
ExitStatus |
handle(StepContribution contribution)
Get the next item from read(StepContribution) and if not null
pass the item to write(Object, StepContribution) . |
void |
mark()
Implementations should delegate to an ItemReader . |
protected Object |
read(StepContribution contribution)
|
void |
reset()
Implementations should delegate to an ItemReader . |
protected void |
write(Object item,
StepContribution contribution)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleItemHandler(ItemReader itemReader, ItemWriter itemWriter)
itemReader
- itemWriter
- Method Detail |
---|
public ExitStatus handle(StepContribution contribution) throws Exception
read(StepContribution)
and if not null
pass the item to write(Object, StepContribution)
.
handle
in interface ItemHandler
contribution
- the current step context
ExitStatus
indicating whether processing is
continuable.
Exception
ItemHandler.handle(org.springframework.batch.core.StepContribution)
protected Object read(StepContribution contribution) throws Exception
contribution
- current context
Exception
protected final Object doRead() throws Exception
Exception
protected void write(Object item, StepContribution contribution) throws Exception
item
- the item to writecontribution
- current context
Exception
protected final void doWrite(Object item) throws Exception
item
-
Exception
public void mark() throws MarkFailedException
ItemHandler
ItemReader
.
mark
in interface ItemHandler
MarkFailedException
ItemReader.mark()
public void reset() throws ResetFailedException
ItemHandler
ItemReader
.
reset
in interface ItemHandler
ResetFailedException
ItemReader.reset()
public void clear() throws ClearFailedException
ItemHandler
ItemWriter
.
clear
in interface ItemHandler
ClearFailedException
ItemWriter.clear()
public void flush() throws FlushFailedException
ItemHandler
ItemWriter
.
flush
in interface ItemHandler
FlushFailedException
ItemWriter.flush()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |