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)
ChunkListener
beforeChunk
in interface ChunkListener
context
- The current ChunkContext
public void afterChunk(ChunkContext context)
ChunkListener
afterChunk
in interface ChunkListener
context
- The current ChunkContext
public void afterChunkError(ChunkContext context)
ChunkListener
afterChunkError
in interface ChunkListener
context
- the chunk context containing the exception that caused
the underlying rollback.