Class AbstractTransaction

  • All Implemented Interfaces:
    Transaction, java.lang.AutoCloseable

    public abstract class AbstractTransaction
    extends java.lang.Object
    implements Transaction
    A convenience base transaction class for multi-operation transactions which maintains the ordered list of operations to commit and provides a default implementation of rollbackOrLog which logs a SEVERE message.
    Author:
    bratseth
    • Constructor Detail

      • AbstractTransaction

        protected AbstractTransaction()
    • Method Detail

      • operations

        public java.util.List<Transaction.Operation> operations()
        Description copied from interface: Transaction
        Returns the operations of this. Ownership of the returned list is transferred to the caller. The ist may be ready only.
        Specified by:
        operations in interface Transaction
      • rollbackOrLog

        public void rollbackOrLog()
        Default implementations which logs a severe message. Operations should implement toString to use this.
        Specified by:
        rollbackOrLog in interface Transaction
      • close

        public void close()
        Default implementation which only clears operations
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface Transaction