Interface TransactionAware
public interface TransactionAware
Transaction callback object that can be registered on 
Transactions.
Interface for transaction-aware objects. The following state diagram shows the states of a transaction and the actions taken on the different states (method calls on all registered TransactionAware objects):

-
Method Summary
Modifier and TypeMethodDescriptiondefault voidcleanup()Cleanup.default voidcommit()Actually commit the transaction after a successfulpreparation.default voidpanic()Try to prevent the end of the universe.default voidPrepare committing a transaction.default voidRollback the transaction after thepreparationfailed.default voidrollback()Rollback the transaction.
-
Method Details
-
prepareCommit
Prepare committing a transaction. Any actions that may well go wrong should be taken here. During this phase, anything may go wrong, therefore, any exception may be thrown during prepare.- Throws:
Exception
-
commit
default void commit()Actually commit the transaction after a successfulpreparation. This should succeed, if any exception is thrown, the transaction will panic. -
rollback
default void rollback()Rollback the transaction. This should succeed, if any exception is thrown, the transaction will panic. -
prepareFailed
default void prepareFailed()Rollback the transaction after thepreparationfailed. This should succeed, if any exception is thrown, the transaction will panic. -
panic
default void panic()Try to prevent the end of the universe. -
cleanup
default void cleanup()Cleanup. Whatever happened, this method will always be called last. -
getContext
Context getContext()
-