org.infinispan.transaction.xa.recovery
Class RecoveryAwareRemoteTransaction

java.lang.Object
  extended by org.infinispan.transaction.AbstractCacheTransaction
      extended by org.infinispan.transaction.RemoteTransaction
          extended by org.infinispan.transaction.xa.recovery.RecoveryAwareRemoteTransaction
All Implemented Interfaces:
Cloneable, 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

Field Summary
 
Fields inherited from class org.infinispan.transaction.AbstractCacheTransaction
affectedKeys, lookedUpEntries, modifications, tx
 
Constructor Summary
RecoveryAwareRemoteTransaction(GlobalTransaction tx)
           
RecoveryAwareRemoteTransaction(WriteCommand[] modifications, GlobalTransaction tx)
           
 
Method Summary
 void computeOrphan(Collection<Address> leavers)
          Check's if this transaction's originator is no longer part of the cluster (orphan transaction) and updates isOrphan().
 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
 boolean isInDoubt()
          A transaction is in doubt if it is prepared and and it is orphan.
 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.
 boolean isPrepared()
           
 void markCompleted(boolean committed)
          Called when after the 2nd phase of a 2PC is successful.
 void setPrepared(boolean prepared)
           
 String toString()
           
 
Methods inherited from class org.infinispan.transaction.RemoteTransaction
clone, equals, getLockedKeys, hashCode, invalidate, putLookedUpEntry
 
Methods inherited from class org.infinispan.transaction.AbstractCacheTransaction
clearLookedUpEntries, getAffectedKeys, getGlobalTransaction, getLookedUpEntries, getModifications, lookupEntry, removeLookedUpEntry, setAffectedKeys, setLookedUpEntries, setModifications
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.infinispan.transaction.xa.CacheTransaction
clearLookedUpEntries, getGlobalTransaction, getLookedUpEntries, getModifications, lookupEntry, putLookedUpEntry, removeLookedUpEntry
 

Constructor Detail

RecoveryAwareRemoteTransaction

public RecoveryAwareRemoteTransaction(WriteCommand[] modifications,
                                      GlobalTransaction tx)

RecoveryAwareRemoteTransaction

public RecoveryAwareRemoteTransaction(GlobalTransaction tx)
Method Detail

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> leavers)
Check's if this transaction's originator is no longer part of the cluster (orphan transaction) and updates isOrphan().

Parameters:
leavers - the nodes that left the cluster

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:


-->

Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.