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):

Transaction State Diagram

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Cleanup.
    default void
    Actually commit the transaction after a successful preparation.
     
    default void
    Try to prevent the end of the universe.
    default void
    Prepare committing a transaction.
    default void
    Rollback the transaction after the preparation failed.
    default void
    Rollback the transaction.
  • Method Details

    • prepareCommit

      default void prepareCommit() throws Exception
      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 successful preparation. 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 the preparation failed. 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()