org.infinispan.transaction.xa.recovery
Class RecoveryManagerImpl

java.lang.Object
  extended by org.infinispan.transaction.xa.recovery.RecoveryManagerImpl
All Implemented Interfaces:
RecoveryManager

public class RecoveryManagerImpl
extends Object
implements RecoveryManager

Default implementation for RecoveryManager

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.infinispan.transaction.xa.recovery.RecoveryManager
RecoveryManager.RecoveryIterator
 
Constructor Summary
RecoveryManagerImpl(ConcurrentMap<RecoveryInfoKey,RecoveryAwareRemoteTransaction> recoveryHolder, String cacheName)
           
 
Method Summary
 List<Xid> getLocalInDoubtTransactions()
          A transaction is in doubt if it is org.infinispan.transaction.RemoteTransaction#isInDoubt().
 RemoteTransaction getPreparedTransaction(Xid xid)
           
 ConcurrentMap<RecoveryInfoKey,RecoveryAwareRemoteTransaction> getPreparedTransactions()
           
 RecoveryManager.RecoveryIterator getPreparedTransactionsFromCluster()
          Returns the list of transactions in prepared state both from local and remote cluster nodes.
 void init(RpcManager rpcManager, CommandsFactory commandsFactory, TransactionTable txTable)
           
 void nodesLeft(List<Address> leavers)
           
 void registerPreparedTransaction(RecoveryAwareRemoteTransaction remoteTransaction)
           
 void removeLocalRecoveryInformation(List<Xid> xids)
          Remove recovery information stored on this node (doesn't involve any rpc).
 void removeRecoveryInformation(Collection<Address> lockOwners, Xid xid, boolean sync)
          Removes from the specified nodes (or all nodes if value of param 'where' is null) the recovery information associated with these Xids.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecoveryManagerImpl

public RecoveryManagerImpl(ConcurrentMap<RecoveryInfoKey,RecoveryAwareRemoteTransaction> recoveryHolder,
                           String cacheName)
Method Detail

init

public void init(RpcManager rpcManager,
                 CommandsFactory commandsFactory,
                 TransactionTable txTable)

getPreparedTransactionsFromCluster

public RecoveryManager.RecoveryIterator getPreparedTransactionsFromCluster()
Description copied from interface: RecoveryManager
Returns the list of transactions in prepared state both from local and remote cluster nodes. Implementation can take advantage of several optimisations:
 - in order to get all tx from the cluster a broadcast is performed. This can be performed only once (assuming the call
   is successful), the first time this method is called. After that a local, cached list of tx prepared on this node is returned.
 - during the broadcast just return the list of prepared transactions that are not originated on other active nodes of the
 cluster.
 

Specified by:
getPreparedTransactionsFromCluster in interface RecoveryManager

removeRecoveryInformation

public void removeRecoveryInformation(Collection<Address> lockOwners,
                                      Xid xid,
                                      boolean sync)
Description copied from interface: RecoveryManager
Removes from the specified nodes (or all nodes if value of param 'where' is null) the recovery information associated with these Xids.

Specified by:
removeRecoveryInformation in interface RecoveryManager
Parameters:
lockOwners - on which nodes should this be executed.
xid - the list of xids to be removed.
sync - weather or not this call should be executed sync

removeLocalRecoveryInformation

public void removeLocalRecoveryInformation(List<Xid> xids)
Description copied from interface: RecoveryManager
Remove recovery information stored on this node (doesn't involve any rpc).

Specified by:
removeLocalRecoveryInformation in interface RecoveryManager
Parameters:
xids - which recovery info to remove
See Also:
RecoveryManager.removeRecoveryInformation(java.util.Collection, javax.transaction.xa.Xid, boolean)

getLocalInDoubtTransactions

public List<Xid> getLocalInDoubtTransactions()
A transaction is in doubt if it is org.infinispan.transaction.RemoteTransaction#isInDoubt().

Specified by:
getLocalInDoubtTransactions in interface RecoveryManager
See Also:
org.infinispan.transaction.RemoteTransaction#isInDoubt()

registerPreparedTransaction

public void registerPreparedTransaction(RecoveryAwareRemoteTransaction remoteTransaction)

nodesLeft

public void nodesLeft(List<Address> leavers)

getPreparedTransaction

public RemoteTransaction getPreparedTransaction(Xid xid)

getPreparedTransactions

public ConcurrentMap<RecoveryInfoKey,RecoveryAwareRemoteTransaction> getPreparedTransactions()

-->

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