Class Transactional.AbstractTransactional

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void abort()  
      java.lang.Throwable abort​(java.lang.Throwable accumulate)
      rollback any effects of this transaction object graph; delegates first to doCleanup, then to doAbort
      void close()  
      void commit()  
      java.lang.Throwable commit​(java.lang.Throwable accumulate)
      commit any effects of this transaction object graph, then cleanup; delegates first to doCommit, then to doCleanup
      protected abstract java.lang.Throwable doAbort​(java.lang.Throwable accumulate)  
      protected abstract java.lang.Throwable doCommit​(java.lang.Throwable accumulate)  
      protected java.lang.Throwable doPostCleanup​(java.lang.Throwable accumulate)
      perform an exception-safe post-abort cleanup
      protected java.lang.Throwable doPreCleanup​(java.lang.Throwable accumulate)
      perform an exception-safe pre-abort/commit cleanup; this will be run after prepareToCommit (so before commit), and before abort
      protected abstract void doPrepare()
      Do any preparatory work prior to commit.
      java.lang.Object finish()
      convenience method to both prepareToCommit() and commit() in one operation; only of use to outer-most transactional object of an object graph
      void prepareToCommit()
      The first phase of commit: delegates to doPrepare(), with valid state transition enforcement.
      Transactional.AbstractTransactional.State state()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractTransactional

        public AbstractTransactional()
    • Method Detail

      • doCommit

        protected abstract java.lang.Throwable doCommit​(java.lang.Throwable accumulate)
      • doAbort

        protected abstract java.lang.Throwable doAbort​(java.lang.Throwable accumulate)
      • doPreCleanup

        protected java.lang.Throwable doPreCleanup​(java.lang.Throwable accumulate)
        perform an exception-safe pre-abort/commit cleanup; this will be run after prepareToCommit (so before commit), and before abort
      • doPostCleanup

        protected java.lang.Throwable doPostCleanup​(java.lang.Throwable accumulate)
        perform an exception-safe post-abort cleanup
      • doPrepare

        protected abstract void doPrepare()
        Do any preparatory work prior to commit. This method should throw any exceptions that can be encountered during the finalization of the behaviour.
      • commit

        public final java.lang.Throwable commit​(java.lang.Throwable accumulate)
        commit any effects of this transaction object graph, then cleanup; delegates first to doCommit, then to doCleanup
        Specified by:
        commit in interface Transactional
      • abort

        public final java.lang.Throwable abort​(java.lang.Throwable accumulate)
        rollback any effects of this transaction object graph; delegates first to doCleanup, then to doAbort
        Specified by:
        abort in interface Transactional
      • close

        public final void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface Transactional
      • prepareToCommit

        public final void prepareToCommit()
        The first phase of commit: delegates to doPrepare(), with valid state transition enforcement. This call should be propagated onto any child objects participating in the transaction
        Specified by:
        prepareToCommit in interface Transactional
      • finish

        public java.lang.Object finish()
        convenience method to both prepareToCommit() and commit() in one operation; only of use to outer-most transactional object of an object graph
      • abort

        public final void abort()
      • commit

        public final void commit()