org.springframework.batch.core.step.item
Interface ItemHandler

All Known Implementing Classes:
ItemSkipPolicyItemHandler, SimpleItemHandler

public interface ItemHandler

Strategy for processing a single item in an item-oriented step. Extends ItemReader and ItemWriter because part of the contract of the processor is that it should delegate calls to those interfaces.

Author:
Dave Syer

Method Summary
 void clear()
          Implementations should delegate to an ItemWriter.
 void flush()
          Implementations should delegate to an ItemWriter.
 ExitStatus handle(StepContribution contribution)
          Given the current context in the form of a step contribution, do whatever is necessary to process this unit inside a chunk.
 void mark()
          Implementations should delegate to an ItemReader.
 void reset()
          Implementations should delegate to an ItemReader.
 

Method Detail

handle

ExitStatus handle(StepContribution contribution)
                  throws Exception
Given the current context in the form of a step contribution, do whatever is necessary to process this unit inside a chunk. Implementations obtain the item and return ExitStatus.FINISHED if it is null. If it is not null process the item and return ExitStatus.CONTINUABLE. On failure throws an exception.

Parameters:
contribution - the current step context
Returns:
an ExitStatus indicating whether processing is continuable.
Throws:
Exception

mark

void mark()
          throws MarkFailedException
Implementations should delegate to an ItemReader.

Throws:
MarkFailedException
See Also:
ItemReader.mark()

reset

void reset()
           throws ResetFailedException
Implementations should delegate to an ItemReader.

Throws:
ResetFailedException
See Also:
ItemReader.reset()

flush

void flush()
           throws FlushFailedException
Implementations should delegate to an ItemWriter.

Throws:
FlushFailedException
See Also:
ItemWriter.flush()

clear

void clear()
           throws ClearFailedException
Implementations should delegate to an ItemWriter.

Throws:
ClearFailedException
See Also:
ItemWriter.clear()


Copyright © 2009 SpringSource. All Rights Reserved.