Class RecoveryAwareRemoteTransaction
java.lang.Object
org.infinispan.transaction.impl.AbstractCacheTransaction
org.infinispan.transaction.impl.RemoteTransaction
org.infinispan.transaction.xa.recovery.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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.infinispan.transaction.xa.CacheTransaction
CacheTransaction.TransactionCompletedListener -
Field Summary
Fields inherited from class org.infinispan.transaction.impl.AbstractCacheTransaction
affectedKeys, lookedUpEntries, modifications, topologyId, tx -
Constructor Summary
ConstructorsConstructorDescriptionRecoveryAwareRemoteTransaction(List<org.infinispan.commands.write.WriteCommand> modifications, GlobalTransaction tx, int topologyId, long txCreationTime) -
Method Summary
Modifier and TypeMethodDescriptionvoidcomputeOrphan(Collection<Address> currentMembers) Check's if this transaction's originator is no longer part of the cluster (orphan transaction) and updatesisOrphan().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 otherwisebooleanA 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.booleanvoidmarkCompleted(boolean committed) Called when after the 2nd phase of a 2PC is successful.voidsetPrepared(boolean prepared) toString()Methods inherited from class org.infinispan.transaction.impl.RemoteTransaction
enterSynchronizationAsync, equals, hashCode, lookedUpEntriesTopology, putLookedUpEntries, putLookedUpEntry, setLookedUpEntriesTopology, setStateTransferFlagMethods inherited from class org.infinispan.transaction.impl.AbstractCacheTransaction
addAffectedKey, addAllAffectedKeys, addBackupLockForKey, addListener, addVersionRead, checkIfRolledBack, cleanupBackupLocks, clearLockedKeys, clearLookedUpEntries, forEachBackupLock, forEachLock, freezeModifications, getAffectedKeys, getAllModifications, getBackupLockedKeys, getCreationTime, getGlobalTransaction, getLockedKeys, getLookedUpEntries, getModifications, getReleaseFutureForKey, getReleaseFutureForKeys, getStateTransferFlag, getTopologyId, getUpdatedEntryVersions, getVersionsRead, hasModifications, isFromStateTransfer, isMarkedForRollback, lookupEntry, markForRollback, notifyOnTransactionFinished, ownsLock, registerLockedKey, removeBackupLock, removeBackupLocks, removeLookedUpEntry, setModifications, setUpdatedEntryVersionsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.infinispan.transaction.xa.CacheTransaction
addBackupLockForKey, addListener, addVersionRead, cleanupBackupLocks, clearLockedKeys, clearLookedUpEntries, forEachBackupLock, forEachLock, freezeModifications, getAllModifications, getCreationTime, getGlobalTransaction, getLockedKeys, getLookedUpEntries, getModifications, getReleaseFutureForKey, getReleaseFutureForKeys, getTopologyId, getUpdatedEntryVersions, getVersionsRead, hasModification, isMarkedForRollback, lookupEntry, markForRollback, notifyOnTransactionFinished, ownsLock, putLookedUpEntries, putLookedUpEntry, removeBackupLock, removeBackupLocks, removeLookedUpEntry, setUpdatedEntryVersions
-
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
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
- Overrides:
toStringin classRemoteTransaction
-
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
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
- -
-