接口 ChunkHandler<T>
- 类型参数:
T
- the type of the items to be processed (it is recommended to use a Memento like a primary key)
- 所有已知实现类:
ChunkProcessorChunkHandler
public interface ChunkHandler<T>
Interface for a remote worker in the Remote Chunking pattern. A request comes from a master process containing some items to be processed. Once the items are done with a response needs to be generated containing a summary of the result.- 作者:
- Dave Syer
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 ChunkResponse
handleChunk(ChunkRequest<T> chunk)
Handle the chunk, processing all the items and returning a response summarising the result.
方法详细资料
handleChunk
ChunkResponse handleChunk(ChunkRequest<T> chunk) throws java.lang.Exception
Handle the chunk, 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).- 参数:
chunk
- a request containing the chunk to process- 返回:
- a response summarising the result
- 抛出:
java.lang.Exception
- if the handler needs to roll back a transaction and have the chunk re-delivered