类 PartitionCollectorAdapter

  • 所有已实现的接口:
    ChunkListener, StepListener

    public class PartitionCollectorAdapter
    extends java.lang.Object
    implements ChunkListener
    Adapter class used to wrap a 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.
    从以下版本开始:
    3.0
    作者:
    Michael Minella, Mahmoud Ben Hassine
    • 构造器概要

      构造器 
      构造器说明
      PartitionCollectorAdapter​(java.util.Queue<java.io.Serializable> queue, javax.batch.api.partition.PartitionCollector collector) 
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型方法说明
      voidafterChunk​(ChunkContext context)
      Callback after the chunk is executed, outside the transaction.
      voidafterChunkError​(ChunkContext context)
      Callback after a chunk has been marked for rollback.
      voidbeforeChunk​(ChunkContext context)
      Callback before the chunk is executed, but inside the transaction.
      voidsetPartitionLock​(java.util.concurrent.locks.ReentrantLock lock) 
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • PartitionCollectorAdapter

        public PartitionCollectorAdapter​(java.util.Queue<java.io.Serializable> queue,
                                         javax.batch.api.partition.PartitionCollector collector)
    • 方法详细资料

      • setPartitionLock

        public void setPartitionLock​(java.util.concurrent.locks.ReentrantLock lock)
      • afterChunkError

        public void afterChunkError​(ChunkContext context)
        从接口复制的说明: ChunkListener
        Callback after a chunk has been marked for rollback. It is invoked after transaction rollback. While the rollback will have occurred, transactional resources might still be active and accessible. Due to this, data access code within this callback will still "participate" in the original transaction unless it declares that it runs in its own transaction. Hence: Use PROPAGATION_REQUIRES_NEW for any transactional operation that is called from here.
        指定者:
        afterChunkError 在接口中 ChunkListener
        参数:
        context - the chunk context containing the exception that caused the underlying rollback.