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
-
-
Field Summary
-
Fields inherited from class org.infinispan.transaction.xa.XaTransactionTable
cacheName, recoveryManager, xid2LocalTx
-
-
Constructor Summary
Constructors Constructor Description RecoveryAwareTransactionTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanupLeaverTransactions(java.util.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(javax.transaction.Transaction tx)java.util.List<javax.transaction.xa.Xid>getLocalPreparedXids()java.util.Set<RecoveryAwareLocalTransaction>getLocalTxThatFailedToComplete()org.infinispan.transaction.impl.RemoteTransactiongetRemoteTransaction(GlobalTransaction txId)Returns theRemoteTransactionassociated with the supplied transaction id.javax.transaction.xa.XidgetRemoteTransactionXid(java.lang.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(org.infinispan.transaction.impl.LocalTransaction localTransaction)voidremoteTransactionCommitted(GlobalTransaction gtx, boolean onePc)Removes theRemoteTransactioncorresponding to the given tx.voidremoteTransactionPrepared(GlobalTransaction gtx)Marks the transaction as prepared.voidremoteTransactionRollback(GlobalTransaction gtx)org.infinispan.transaction.impl.RemoteTransactionremoveRemoteTransaction(javax.transaction.xa.Xid 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 classorg.infinispan.transaction.impl.TransactionTable
-
localTransactionPrepared
public void localTransactionPrepared(org.infinispan.transaction.impl.LocalTransaction localTransaction)
- Overrides:
localTransactionPreparedin classorg.infinispan.transaction.impl.TransactionTable- See Also:
localTransactionPrepared(org.infinispan.transaction.impl.LocalTransaction)
-
cleanupLeaverTransactions
public void cleanupLeaverTransactions(java.util.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 classorg.infinispan.transaction.impl.TransactionTable- Parameters:
members- The list of cluster members
-
getRemoteTransaction
public org.infinispan.transaction.impl.RemoteTransaction getRemoteTransaction(GlobalTransaction txId)
Description copied from class:org.infinispan.transaction.impl.TransactionTableReturns theRemoteTransactionassociated with the supplied transaction id. Returns null if no such association exists.- Overrides:
getRemoteTransactionin classorg.infinispan.transaction.impl.TransactionTable
-
remoteTransactionRollback
public void remoteTransactionRollback(GlobalTransaction gtx)
- Overrides:
remoteTransactionRollbackin classorg.infinispan.transaction.impl.TransactionTable
-
remoteTransactionCommitted
public void remoteTransactionCommitted(GlobalTransaction gtx, boolean onePc)
Description copied from class:org.infinispan.transaction.impl.TransactionTableRemoves theRemoteTransactioncorresponding to the given tx.- Overrides:
remoteTransactionCommittedin classorg.infinispan.transaction.impl.TransactionTable
-
getLocalPreparedXids
public java.util.List<javax.transaction.xa.Xid> getLocalPreparedXids()
-
failureCompletingTransaction
public void failureCompletingTransaction(javax.transaction.Transaction tx)
- Overrides:
failureCompletingTransactionin classorg.infinispan.transaction.impl.TransactionTable
-
getLocalTxThatFailedToComplete
public java.util.Set<RecoveryAwareLocalTransaction> getLocalTxThatFailedToComplete()
-
getRemoteTransactionXid
public javax.transaction.xa.Xid getRemoteTransactionXid(java.lang.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 org.infinispan.transaction.impl.RemoteTransaction removeRemoteTransaction(javax.transaction.xa.Xid xid)
-
-