Package com.gruelbox.transactionoutbox
Class StubThreadLocalTransactionManager
java.lang.Object
com.gruelbox.transactionoutbox.spi.AbstractThreadLocalTransactionManager<SimpleTransaction>
com.gruelbox.transactionoutbox.StubThreadLocalTransactionManager
- All Implemented Interfaces:
ThreadLocalContextTransactionManager
,TransactionManager
public class StubThreadLocalTransactionManager
extends AbstractThreadLocalTransactionManager<SimpleTransaction>
A stub transaction manager that assumes no underlying database and thread local transaction
management.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.gruelbox.transactionoutbox.spi.AbstractThreadLocalTransactionManager
AbstractThreadLocalTransactionManager.AbstractThreadLocalTransactionManagerBuilder<TX extends SimpleTransaction,
C extends AbstractThreadLocalTransactionManager<TX>, B extends AbstractThreadLocalTransactionManager.AbstractThreadLocalTransactionManagerBuilder<TX, C, B>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T,
E extends Exception>
TShould do any work necessary to start a (new) transaction, callwork
and then either commit on success or rollback on failure, flushing and closing any prepared statements prior to a commit and firing post commit hooks immediately afterwards.Methods inherited from class com.gruelbox.transactionoutbox.spi.AbstractThreadLocalTransactionManager
inTransaction, inTransaction, inTransactionReturns, inTransactionThrows, peekTransaction, popTransaction, pushTransaction, requireTransactionReturns
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.gruelbox.transactionoutbox.ThreadLocalContextTransactionManager
extractTransaction, injectTransaction, requireTransaction
-
Constructor Details
-
StubThreadLocalTransactionManager
public StubThreadLocalTransactionManager()
-
-
Method Details
-
inTransactionReturnsThrows
public <T,E extends Exception> T inTransactionReturnsThrows(ThrowingTransactionalSupplier<T, E> work) throws EDescription copied from interface:TransactionManager
Should do any work necessary to start a (new) transaction, callwork
and then either commit on success or rollback on failure, flushing and closing any prepared statements prior to a commit and firing post commit hooks immediately afterwards.- Type Parameters:
T
- The type returned.E
- The exception type.- Parameters:
work
- Code which must be called while the transaction is active.- Returns:
- The result of
supplier
. - Throws:
E
- If any exception is thrown byRunnable
.
-