Class ChunkProcessorChunkRequestHandler<S>
java.lang.Object
org.springframework.batch.integration.chunk.ChunkProcessorChunkRequestHandler<S>
- Type Parameters:
S
- the type of the items in the chunk to be handled
- All Implemented Interfaces:
ChunkRequestHandler<S>
,org.springframework.beans.factory.InitializingBean
@MessageEndpoint
@NullUnmarked
public class ChunkProcessorChunkRequestHandler<S>
extends Object
implements ChunkRequestHandler<S>, org.springframework.beans.factory.InitializingBean
A
ChunkRequestHandler
based on a ChunkProcessor
. Knows how to
distinguish between a processor that is fault tolerant, and one that is not. If the
processor is fault tolerant then exceptions can be propagated on the assumption that
there will be a roll back and the request will be re-delivered.- Author:
- Dave Syer, Michael Minella, Mahmoud Ben Hassine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
handle
(ChunkRequest<S> chunkRequest) Handle the chunk request, processing all the items and returning a response summarising the result.void
setChunkProcessor
(ChunkProcessor<S> chunkProcessor) Public setter for theChunkProcessor
.
-
Constructor Details
-
ChunkProcessorChunkRequestHandler
public ChunkProcessorChunkRequestHandler()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
setChunkProcessor
Public setter for theChunkProcessor
.- Parameters:
chunkProcessor
- the chunkProcessor to set
-
handle
Description copied from interface:ChunkRequestHandler
Handle the chunk request, processing all the items and returning a response summarising the result. If the result is a failure then the response should say so. The handler only throws an exception if it needs to roll back a transaction and knows that the request will be re-delivered (if not to the same handler then to one processing the same Step).- Specified by:
handle
in interfaceChunkRequestHandler<S>
- Parameters:
chunkRequest
- a request containing the chunk to process- Returns:
- a response summarising the result
- Throws:
Exception
- if the handler needs to roll back a transaction and have the chunk re-delivered- See Also:
-