Class RecoveryAwareRemoteTransaction
- java.lang.Object
-
- org.infinispan.transaction.impl.AbstractCacheTransaction
-
- org.infinispan.transaction.impl.RemoteTransaction
-
- org.infinispan.transaction.xa.recovery.RecoveryAwareRemoteTransaction
-
- All Implemented Interfaces:
Cloneable,CacheTransaction,RecoveryAwareTransaction
public class RecoveryAwareRemoteTransaction extends org.infinispan.transaction.impl.RemoteTransaction implements RecoveryAwareTransaction
ExtendsRemoteTransactionand adds recovery related information and functionality.- Since:
- 5.0
- Author:
- Mircea.Markus@jboss.com
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.infinispan.transaction.xa.CacheTransaction
CacheTransaction.TransactionCompletedListener
-
-
Constructor Summary
Constructors Constructor Description RecoveryAwareRemoteTransaction(org.infinispan.commands.write.WriteCommand[] modifications, GlobalTransaction tx, int topologyId, long txCreationTime)RecoveryAwareRemoteTransaction(GlobalTransaction tx, int topologyId, long txCreationTime)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomputeOrphan(Collection<Address> currentMembers)Check's if this transaction's originator is no longer part of the cluster (orphan transaction) and updatesisOrphan().IntegergetStatus()Following values might be returned: -Status.STATUS_PREPAREDif the tx is prepared -Status.STATUS_COMMITTEDif the tx is committed -Status.STATUS_ROLLEDBACKif the tx is rollback - null otherwisebooleanisInDoubt()A transaction is in doubt if it is prepared and and it is orphan.booleanisOrphan()A remote transaction is orphan if the node on which the transaction originated (ie the originator) is no longer part of the cluster.booleanisPrepared()voidmarkCompleted(boolean committed)Called when after the 2nd phase of a 2PC is successful.voidsetPrepared(boolean prepared)StringtoString()-
Methods inherited from class org.infinispan.transaction.impl.RemoteTransaction
clone, enterSynchronizationAsync, equals, getTransactionState, hashCode, lookedUpEntriesTopology, putLookedUpEntries, putLookedUpEntry, setLookedUpEntriesTopology, setStateTransferFlag
-
Methods inherited from class org.infinispan.transaction.impl.AbstractCacheTransaction
addAffectedKey, addAllAffectedKeys, addBackupLockForKey, addListener, addVersionRead, areLocksReleased, cleanupBackupLocks, clearLockedKeys, clearLookedUpEntries, containsLockOrBackupLock, findAnyLockedOrBackupLocked, forEachBackupLock, freezeModifications, getAffectedKeys, getAllModifications, getBackupLockedKeys, getCreationTime, getGlobalTransaction, getLockedKeys, getLookedUpEntries, getModifications, getReleaseFutureForKey, getReleaseFutureForKeys, getStateTransferFlag, getTopologyId, getUpdatedEntryVersions, getVersionsRead, hasModification, isFromStateTransfer, isMarkedForRollback, lookupEntry, markForRollback, notifyOnTransactionFinished, ownsLock, registerLockedKey, removeBackupLock, removeBackupLocks, removeLookedUpEntry, setModifications, setUpdatedEntryVersions, waitForLockRelease
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.transaction.xa.CacheTransaction
addBackupLockForKey, addListener, addReadKey, addVersionRead, areLocksReleased, cleanupBackupLocks, clearLockedKeys, clearLookedUpEntries, containsLockOrBackupLock, findAnyLockedOrBackupLocked, forEachBackupLock, freezeModifications, getAllModifications, getBackupLockedKeys, getCreationTime, getGlobalTransaction, getLockedKeys, getLookedUpEntries, getLookedUpRemoteVersion, getModifications, getReleaseFutureForKey, getReleaseFutureForKeys, getTopologyId, getUpdatedEntryVersions, getVersionsRead, hasModification, isMarkedForRollback, keyRead, lookupEntry, markForRollback, notifyOnTransactionFinished, ownsLock, putLookedUpEntries, putLookedUpEntry, putLookedUpRemoteVersion, removeBackupLock, removeBackupLocks, removeLookedUpEntry, replaceVersionRead, setUpdatedEntryVersions, waitForLockRelease
-
-
-
-
Constructor Detail
-
RecoveryAwareRemoteTransaction
public RecoveryAwareRemoteTransaction(org.infinispan.commands.write.WriteCommand[] modifications, GlobalTransaction tx, int topologyId, long txCreationTime)
-
RecoveryAwareRemoteTransaction
public RecoveryAwareRemoteTransaction(GlobalTransaction tx, int topologyId, long txCreationTime)
-
-
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> currentMembers)
Check's if this transaction's originator is no longer part of the cluster (orphan transaction) and updatesisOrphan().- Parameters:
currentMembers- The current members of the cache.
-
isPrepared
public boolean isPrepared()
- Specified by:
isPreparedin interfaceRecoveryAwareTransaction
-
setPrepared
public void setPrepared(boolean prepared)
- Specified by:
setPreparedin interfaceRecoveryAwareTransaction
-
toString
public String toString()
- Overrides:
toStringin classorg.infinispan.transaction.impl.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_PREPAREDif the tx is prepared - -
Status.STATUS_COMMITTEDif the tx is committed - -
Status.STATUS_ROLLEDBACKif the tx is rollback - - null otherwise
- -
-
-