Class RecoveryAwareTransactionTable
- java.lang.Object
-
- org.infinispan.transaction.impl.TransactionTable
-
- org.infinispan.transaction.xa.XaTransactionTable
-
- org.infinispan.transaction.xa.recovery.RecoveryAwareTransactionTable
-
- All Implemented Interfaces:
TransactionTable
public class RecoveryAwareTransactionTable extends XaTransactionTable
Transaction table that delegates prepared transaction's management to theRecoveryManager.- Since:
- 5.0
- Author:
- Mircea.Markus@jboss.com
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.infinispan.transaction.impl.TransactionTable
TransactionTable.CompletedTransactionStatus
-
-
Field Summary
-
Fields inherited from class org.infinispan.transaction.xa.XaTransactionTable
cacheName, recoveryManager, xid2LocalTx
-
Fields inherited from class org.infinispan.transaction.impl.TransactionTable
CACHE_STOPPED_TOPOLOGY_ID, clustered, commandsFactory, configuration, partitionHandlingManager, rpcManager, running, transactionOriginatorChecker, txCoordinator
-
-
Constructor Summary
Constructors Constructor Description RecoveryAwareTransactionTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanupLeaverTransactions(List<Address> members)First moves the prepared transactions originated on the leavers into the recovery cache and then cleans up the transactions that are not yet prepared.voidfailureCompletingTransaction(Transaction tx)List<org.infinispan.commons.tx.XidImpl>getLocalPreparedXids()Set<RecoveryAwareLocalTransaction>getLocalTxThatFailedToComplete()RemoteTransactiongetRemoteTransaction(GlobalTransaction txId)Returns theRemoteTransactionassociated with the supplied transaction id.org.infinispan.commons.tx.XidImplgetRemoteTransactionXid(Long internalId)Iterates over the remote transactions and returns the XID of the one that has an internal id equal with the supplied internal Id.voidlocalTransactionPrepared(LocalTransaction localTransaction)voidremoteTransactionCommitted(GlobalTransaction gtx, boolean onePc)Removes theRemoteTransactioncorresponding to the given tx.voidremoteTransactionPrepared(GlobalTransaction gtx)Marks the transaction as prepared.voidremoteTransactionRollback(GlobalTransaction gtx)RemoteTransactionremoveRemoteTransaction(org.infinispan.commons.tx.XidImpl xid)-
Methods inherited from class org.infinispan.transaction.xa.XaTransactionTable
commit, enlist, enlistClientTransaction, getLocalTransaction, getLocalTxCount, prepare, removeLocalTransaction, startXidMapping
-
Methods inherited from class org.infinispan.transaction.impl.TransactionTable
afterCompletion, beforeCompletion, containRemoteTx, containsLocalTx, getCompletedTransactionStatus, getGlobalTransaction, getLocalGlobalTransaction, getLocalTransaction, getLocalTransaction, getLocalTransactions, getMinTopologyId, getOrCreateLocalTransaction, getOrCreateLocalTransaction, getOrCreateRemoteTransaction, getRemoteGlobalTransaction, getRemoteTransactions, getRemoteTxCount, isTransactionCompleted, markTransactionCompleted, onTopologyChange, onViewChange, recalculateMinTopologyIdIfNeeded, releaseLocksForCompletedTransaction, removeRemoteTransaction, start
-
-
-
-
Method Detail
-
remoteTransactionPrepared
public void remoteTransactionPrepared(GlobalTransaction gtx)
Marks the transaction as prepared. If at a further point the originator fails, the transaction is removed form the "normal" transactions collection and moved into the cache that holds in-doubt transactions. SeecleanupLeaverTransactions(java.util.List)- Overrides:
remoteTransactionPreparedin classTransactionTable
-
localTransactionPrepared
public void localTransactionPrepared(LocalTransaction localTransaction)
- Overrides:
localTransactionPreparedin classTransactionTable- See Also:
localTransactionPrepared(org.infinispan.transaction.impl.LocalTransaction)
-
cleanupLeaverTransactions
public void cleanupLeaverTransactions(List<Address> members)
First moves the prepared transactions originated on the leavers into the recovery cache and then cleans up the transactions that are not yet prepared.- Overrides:
cleanupLeaverTransactionsin classTransactionTable- Parameters:
members- The list of cluster members
-
getRemoteTransaction
public RemoteTransaction getRemoteTransaction(GlobalTransaction txId)
Description copied from class:TransactionTableReturns theRemoteTransactionassociated with the supplied transaction id. Returns null if no such association exists.- Overrides:
getRemoteTransactionin classTransactionTable
-
remoteTransactionRollback
public void remoteTransactionRollback(GlobalTransaction gtx)
- Overrides:
remoteTransactionRollbackin classTransactionTable
-
remoteTransactionCommitted
public void remoteTransactionCommitted(GlobalTransaction gtx, boolean onePc)
Description copied from class:TransactionTableRemoves theRemoteTransactioncorresponding to the given tx.- Overrides:
remoteTransactionCommittedin classTransactionTable
-
getLocalPreparedXids
public List<org.infinispan.commons.tx.XidImpl> getLocalPreparedXids()
-
failureCompletingTransaction
public void failureCompletingTransaction(Transaction tx)
- Overrides:
failureCompletingTransactionin classTransactionTable
-
getLocalTxThatFailedToComplete
public Set<RecoveryAwareLocalTransaction> getLocalTxThatFailedToComplete()
-
getRemoteTransactionXid
public org.infinispan.commons.tx.XidImpl getRemoteTransactionXid(Long internalId)
Iterates over the remote transactions and returns the XID of the one that has an internal id equal with the supplied internal Id.
-
removeRemoteTransaction
public RemoteTransaction removeRemoteTransaction(org.infinispan.commons.tx.XidImpl xid)
-
-