Class RecoveryAwareRemoteTransaction

All Implemented Interfaces:
CacheTransaction, RecoveryAwareTransaction

public class RecoveryAwareRemoteTransaction extends RemoteTransaction implements RecoveryAwareTransaction
Extends RemoteTransaction and adds recovery related information and functionality.
Since:
5.0
Author:
Mircea.Markus@jboss.com
  • Constructor Details

    • RecoveryAwareRemoteTransaction

      public RecoveryAwareRemoteTransaction(List<org.infinispan.commands.write.WriteCommand> modifications, GlobalTransaction tx, int topologyId, long txCreationTime)
  • Method Details

    • isInDoubt

      public boolean isInDoubt()
      A transaction is in doubt if it is prepared and and it is orphan.
    • isOrphan

      public boolean isOrphan()
      A remote transaction is orphan if the node on which the transaction originated (ie the originator) is no longer part of the cluster.
    • computeOrphan

      public void computeOrphan(Collection<Address> currentMembers)
      Check's if this transaction's originator is no longer part of the cluster (orphan transaction) and updates isOrphan().
      Parameters:
      currentMembers - The current members of the cache.
    • isPrepared

      public boolean isPrepared()
      Specified by:
      isPrepared in interface RecoveryAwareTransaction
    • setPrepared

      public void setPrepared(boolean prepared)
      Specified by:
      setPrepared in interface RecoveryAwareTransaction
    • toString

      public String toString()
      Overrides:
      toString in class RemoteTransaction
    • markCompleted

      public void markCompleted(boolean committed)
      Called when after the 2nd phase of a 2PC is successful.
      Parameters:
      committed - true if tx successfully committed, false if tx successfully rolled back.
    • getStatus

      public Integer getStatus()
      Following values might be returned:
      • - Status.STATUS_PREPARED if the tx is prepared
      • - Status.STATUS_COMMITTED if the tx is committed
      • - Status.STATUS_ROLLEDBACK if the tx is rollback
      • - null otherwise