public class PartitionCollectorAdapter extends java.lang.Object implements ChunkListener
PartitionCollector so that it can be consumed
as a ChunkListener. A thread-safe Queue is required along with the
PartitionCollector. The Queue is where the result of the call to
the PartitionCollector will be placed.ROLLBACK_EXCEPTION_KEY| Constructor and Description |
|---|
PartitionCollectorAdapter(java.util.Queue<java.io.Serializable> queue,
javax.batch.api.partition.PartitionCollector collector) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterChunk(ChunkContext context)
Callback after the chunk is executed, outside the transaction.
|
void |
afterChunkError(ChunkContext context)
Callback after a chunk has been marked for rollback.
|
void |
beforeChunk(ChunkContext context)
Callback before the chunk is executed, but inside the transaction.
|
void |
setPartitionLock(java.util.concurrent.locks.ReentrantLock lock) |
public PartitionCollectorAdapter(java.util.Queue<java.io.Serializable> queue,
javax.batch.api.partition.PartitionCollector collector)
public void setPartitionLock(java.util.concurrent.locks.ReentrantLock lock)
public void beforeChunk(ChunkContext context)
ChunkListenerbeforeChunk in interface ChunkListenercontext - The current ChunkContextpublic void afterChunk(ChunkContext context)
ChunkListenerafterChunk in interface ChunkListenercontext - The current ChunkContextpublic void afterChunkError(ChunkContext context)
ChunkListenerafterChunkError in interface ChunkListenercontext - the chunk context containing the exception that caused
the underlying rollback.