org.infinispan.transaction.xa.recovery
Class RecoveryAwareTransactionTable

java.lang.Object
  extended by org.infinispan.transaction.TransactionTable
      extended by org.infinispan.transaction.xa.XaTransactionTable
          extended by org.infinispan.transaction.xa.recovery.RecoveryAwareTransactionTable

public class RecoveryAwareTransactionTable
extends XaTransactionTable

Transaction table that delegates prepared transaction's management to the RecoveryManager.

Since:
5.0
Author:
Mircea.Markus@jboss.com

Field Summary
 
Fields inherited from class org.infinispan.transaction.xa.XaTransactionTable
xid2LocalTx
 
Fields inherited from class org.infinispan.transaction.TransactionTable
CACHE_STOPPED_VIEW_ID, clustered, clusteringLogic, commandsFactory, configuration, icc, rpcManager, txCoordinator, txFactory
 
Constructor Summary
RecoveryAwareTransactionTable()
           
 
Method Summary
 void failureCompletingTransaction(Transaction tx)
           
 List<Xid> getLocalPreparedXids()
           
 Set<RecoveryAwareLocalTransaction> getLocalTxThatFailedToComplete()
           
 RemoteTransaction getRemoteTransaction(GlobalTransaction txId)
          Returns the RemoteTransaction associated with the supplied transaction id.
 Xid 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.
 void initialize(RecoveryManager recoveryManager)
           
 void localTransactionPrepared(LocalTransaction localTransaction)
           
 void remoteTransactionCommitted(GlobalTransaction gtx)
          Removes the RemoteTransaction corresponding to the given tx.
 void remoteTransactionPrepared(GlobalTransaction gtx)
          Marks the transaction as prepared.
 void remoteTransactionRollback(GlobalTransaction gtx)
           
 RemoteTransaction removeRemoteTransaction(Xid xid)
           
protected  void updateStateOnNodesLeaving(Collection<Address> leavers)
          First moves the prepared transactions originated on the leavers into the recovery cache and then cleans up the transactions that are not yet prepared.
 
Methods inherited from class org.infinispan.transaction.xa.XaTransactionTable
addLocalTransactionMapping, enlist, getLocalTransaction, getLocalTxCount, getRecoveryManager, init, removeLocalTransaction, removeLocalTransaction, setRecoveryManager
 
Methods inherited from class org.infinispan.transaction.TransactionTable
containRemoteTx, containsLocalTx, createRemoteTransaction, getLocalTransaction, getLocalTransactions, getLocalTx, getLockedKeysForRemoteTransaction, getMinViewId, getOrCreateLocalTransaction, getRemoteTransactions, getRemoteTxCount, initialize, recalculateMinViewIdIfNeeded, recalculateMinViewIdOnTopologyChange, removeLocalTransactionInternal, removeRemoteTransaction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecoveryAwareTransactionTable

public RecoveryAwareTransactionTable()
Method Detail

initialize

public void initialize(RecoveryManager recoveryManager)

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. See updateStateOnNodesLeaving(java.util.Collection)

Overrides:
remoteTransactionPrepared in class TransactionTable

localTransactionPrepared

public void localTransactionPrepared(LocalTransaction localTransaction)
Overrides:
localTransactionPrepared in class TransactionTable
See Also:
localTransactionPrepared(org.infinispan.transaction.LocalTransaction)

updateStateOnNodesLeaving

protected void updateStateOnNodesLeaving(Collection<Address> leavers)
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:
updateStateOnNodesLeaving in class TransactionTable

getRemoteTransaction

public RemoteTransaction getRemoteTransaction(GlobalTransaction txId)
Description copied from class: TransactionTable
Returns the RemoteTransaction associated with the supplied transaction id. Returns null if no such association exists.

Overrides:
getRemoteTransaction in class TransactionTable

remoteTransactionRollback

public void remoteTransactionRollback(GlobalTransaction gtx)
Overrides:
remoteTransactionRollback in class TransactionTable

remoteTransactionCommitted

public void remoteTransactionCommitted(GlobalTransaction gtx)
Description copied from class: TransactionTable
Removes the RemoteTransaction corresponding to the given tx.

Overrides:
remoteTransactionCommitted in class TransactionTable

getLocalPreparedXids

public List<Xid> getLocalPreparedXids()

failureCompletingTransaction

public void failureCompletingTransaction(Transaction tx)
Overrides:
failureCompletingTransaction in class TransactionTable

getLocalTxThatFailedToComplete

public Set<RecoveryAwareLocalTransaction> getLocalTxThatFailedToComplete()

getRemoteTransactionXid

public Xid 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(Xid xid)

-->

Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.