Class TotalOrderRemoteTransactionState


  • public class TotalOrderRemoteTransactionState
    extends Object
    Represents a state for a Remote Transaction when the Total Order based protocol is used.
    Since:
    5.3
    Author:
    Pedro Ruivo
    • Constructor Detail

      • TotalOrderRemoteTransactionState

        public TotalOrderRemoteTransactionState​(GlobalTransaction globalTransaction)
    • Method Detail

      • isRollbackReceived

        public boolean isRollbackReceived()
        check if the transaction is marked for rollback (by the Rollback Command)
        Returns:
        true if it is marked for rollback, false otherwise
      • isCommitReceived

        public boolean isCommitReceived()
        check if the transaction is marked for commit (by the Commit Command)
        Returns:
        true if it is marked for commit, false otherwise
      • prepared

        public void prepared()
        mark the transaction as prepared (the validation was finished) and notify a possible pending commit or rollback command
      • preparing

        public void preparing()
        mark the transaction as preparing, blocking the commit and rollback commands until the prepared() is invoked
      • waitUntilPrepared

        public final boolean waitUntilPrepared​(boolean commit)
                                        throws InterruptedException
        Commit and rollback commands invokes this method and they are blocked here if the state is PREPARING
        Parameters:
        commit - true if it is a commit command, false otherwise
        Returns:
        true if the command needs to be processed, false otherwise
        Throws:
        InterruptedException - when it is interrupted while waiting
      • isFinished

        public final boolean isFinished()
        Returns:
        true if the transaction has received the prepare and the commit or rollback
      • getLockedKeys

        public final Collection<Object> getLockedKeys()
        Returns:
        the keys locked in org.infinispan.transaction.totalorder.TotalOrderManager
      • getTransactionSynchronizedBlock

        public final TotalOrderLatch getTransactionSynchronizedBlock()
        Returns:
        the TotalOrderLatch associated to this transaction
      • setTransactionSynchronizedBlock

        public final void setTransactionSynchronizedBlock​(TotalOrderLatch block)
        Sets the TotalOrderLatch to be associated to this transaction
      • getGlobalTransaction

        public final GlobalTransaction getGlobalTransaction()
        Returns:
        the global transaction
      • reset

        public final void reset()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • addSynchronizedBlock

        public final void addSynchronizedBlock​(TotalOrderLatch block)
      • addKeysLockedForClear

        public final void addKeysLockedForClear()
      • addLockedKey

        public final void addLockedKey​(Object key)