Class TransactionBehaviourQueue

  • All Implemented Interfaces:
    TransactionListener, org.alfresco.util.transaction.TransactionListener

    public class TransactionBehaviourQueue
    extends java.lang.Object
    implements TransactionListener
    Transaction Behaviour Queue. Responsible for keeping a record of behaviours to execute at the end of a transaction.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterCommit()
      Invoked after transaction commit.
      void afterRollback()
      Invoked after transaction rollback.
      void beforeCommit​(boolean readOnly)
      Called before a transaction is committed.
      void beforeCompletion()
      Invoked before transaction commit/rollback.
      boolean equals​(java.lang.Object obj)  
      void flush()  
      int hashCode()  
      <P extends Policy>
      void
      queue​(Behaviour behaviour, PolicyDefinition<P> definition, P policyInterface, java.lang.reflect.Method method, java.lang.Object[] args)
      Queue a behaviour for end-of-transaction execution
      • Methods inherited from class java.lang.Object

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

      • TransactionBehaviourQueue

        public TransactionBehaviourQueue()
    • Method Detail

      • queue

        public <P extends Policy> void queue​(Behaviour behaviour,
                                             PolicyDefinition<P> definition,
                                             P policyInterface,
                                             java.lang.reflect.Method method,
                                             java.lang.Object[] args)
        Queue a behaviour for end-of-transaction execution
        Type Parameters:
        P - P extends Policy
        Parameters:
        behaviour - Behaviour
        definition - PolicyDefinition

        policyInterface - P
        method - Method
        args - Object[]
      • beforeCommit

        public void beforeCommit​(boolean readOnly)
        Description copied from interface: TransactionListener
        Called before a transaction is committed.

        All transaction resources are still available.

        Specified by:
        beforeCommit in interface TransactionListener
        Specified by:
        beforeCommit in interface org.alfresco.util.transaction.TransactionListener
        Parameters:
        readOnly - true if the transaction is read-only
      • afterCommit

        public void afterCommit()
        Description copied from interface: TransactionListener
        Invoked after transaction commit.

        Any exceptions generated here will only be logged and will have no effect on the state of the transaction.

        Although all transaction resources are still available, this method should be used only for cleaning up resources after a commit has occured.

        Specified by:
        afterCommit in interface TransactionListener
        Specified by:
        afterCommit in interface org.alfresco.util.transaction.TransactionListener
      • afterRollback

        public void afterRollback()
        Description copied from interface: TransactionListener
        Invoked after transaction rollback.

        Any exceptions generated here will only be logged and will have no effect on the state of the transaction.

        Although all transaction resources are still available, this method should be used only for cleaning up resources after a rollback has occured.

        Specified by:
        afterRollback in interface TransactionListener
        Specified by:
        afterRollback in interface org.alfresco.util.transaction.TransactionListener
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)