Class Transaction.CallbackAdapter

java.lang.Object
io.permazen.core.Transaction.CallbackAdapter
All Implemented Interfaces:
Transaction.Callback
Enclosing class:
Transaction

public static class Transaction.CallbackAdapter extends Object implements Transaction.Callback
Adapter class for Transaction.Callback.

All the implementations in this class do nothing.

  • Constructor Details

    • CallbackAdapter

      public CallbackAdapter()
  • Method Details

    • beforeCommit

      public void beforeCommit(boolean readOnly)
      Description copied from interface: Transaction.Callback
      Invoked before transaction commit (and before Transaction.Callback.beforeCompletion()). This method is invoked when a transaction is intended to be committed; it may however still be rolled back.

      Any exceptions thrown will result in a transaction rollback and be propagated to the caller.

      Specified by:
      beforeCommit in interface Transaction.Callback
      Parameters:
      readOnly - true if the transaction is marked read-only
    • beforeCompletion

      public void beforeCompletion()
      Description copied from interface: Transaction.Callback
      Invoked before transaction completion in any case (but after any beforeCommit()). This method is invoked whether the transaction is going to be committed or rolled back, and is invoked even if beforeCommit() throws an exception. Typically used to clean up resources before transaction completion.

      Any exceptions thrown will be logged but will not propagate to the caller.

      Specified by:
      beforeCompletion in interface Transaction.Callback
    • afterCommit

      public void afterCommit()
      Description copied from interface: Transaction.Callback
      Invoked after successful transaction commit (and before afterCompletion()).

      Any exceptions thrown will propagate to the caller.

      Specified by:
      afterCommit in interface Transaction.Callback
    • afterCompletion

      public void afterCompletion(boolean committed)
      Description copied from interface: Transaction.Callback
      Invoked after transaction completion (but after any Transaction.Callback.afterCommit()). This method is invoked in any case, whether the transaction was committed or rolled back. Typically used to clean up resources after transaction completion.

      Any exceptions thrown will be logged but will not propagate to the caller.

      Specified by:
      afterCompletion in interface Transaction.Callback
      Parameters:
      committed - true if transaction was commited, false if transaction was rolled back