Class TransactionalBatcher<E extends RuntimeException>
- java.lang.Object
-
- org.wildfly.clustering.ee.cache.tx.TransactionalBatcher<E>
-
- All Implemented Interfaces:
Batcher<TransactionBatch>
public class TransactionalBatcher<E extends RuntimeException> extends Object implements Batcher<TransactionBatch>
ABatcherimplementation based on Infinispan'sorg.infinispan.batch.BatchContainer, except that its transaction reference is stored within the returned Batch object instead of a ThreadLocal. This also allows the user to callBatch.close()from a different thread than the one that created theBatch. In this case, however, the user must first resume the batch viaresumeBatch(TransactionBatch).- Author:
- Paul Ferraro
-
-
Constructor Summary
Constructors Constructor Description TransactionalBatcher(javax.transaction.TransactionManager tm, Function<Throwable,E> exceptionTransformer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TransactionBatchcreateBatch()BatchContextresumeBatch(TransactionBatch batch)TransactionBatchsuspendBatch()
-
-
-
Method Detail
-
createBatch
public TransactionBatch createBatch()
- Specified by:
createBatchin interfaceBatcher<E extends RuntimeException>
-
resumeBatch
public BatchContext resumeBatch(TransactionBatch batch)
- Specified by:
resumeBatchin interfaceBatcher<E extends RuntimeException>
-
suspendBatch
public TransactionBatch suspendBatch()
- Specified by:
suspendBatchin interfaceBatcher<E extends RuntimeException>
-
-