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
ConstructorDescriptionRecoveryAwareRemoteTransaction
(List<org.infinispan.commands.write.WriteCommand> modifications, GlobalTransaction tx, int topologyId, long txCreationTime) -
Method Summary
Modifier and TypeMethodDescriptionvoid
computeOrphan
(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_PREPARED
if the tx is prepared -Status.STATUS_COMMITTED
if the tx is committed -Status.STATUS_ROLLEDBACK
if the tx is rollback - null otherwiseboolean
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
void
markCompleted
(boolean committed) Called when after the 2nd phase of a 2PC is successful.void
setPrepared
(boolean prepared) toString()
Methods inherited from class org.infinispan.transaction.impl.RemoteTransaction
enterSynchronizationAsync, equals, hashCode, lookedUpEntriesTopology, putLookedUpEntries, putLookedUpEntry, setLookedUpEntriesTopology, setStateTransferFlag
Methods 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, setUpdatedEntryVersions
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:
isPrepared
in interfaceRecoveryAwareTransaction
-
setPrepared
public void setPrepared(boolean prepared) - Specified by:
setPrepared
in interfaceRecoveryAwareTransaction
-
toString
- Overrides:
toString
in 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_PREPARED
if the tx is prepared - -
Status.STATUS_COMMITTED
if the tx is committed - -
Status.STATUS_ROLLEDBACK
if the tx is rollback - - null otherwise
- -
-