org.infinispan.transaction
Class TransactionTable

java.lang.Object
  extended by org.infinispan.transaction.TransactionTable
Direct Known Subclasses:
XaTransactionTable

public class TransactionTable
extends Object

Repository for RemoteTransaction and TransactionXaAdapters (locally originated transactions).

Since:
4.0
Author:
Mircea.Markus@jboss.com, Galder ZamarreƱo

Field Summary
static int CACHE_STOPPED_VIEW_ID
           
protected  boolean clustered
           
protected  ClusteringDependentLogic clusteringLogic
           
protected  CommandsFactory commandsFactory
           
protected  Configuration configuration
           
protected  InvocationContextContainer icc
           
protected  RpcManager rpcManager
           
protected  TransactionCoordinator txCoordinator
           
protected  TransactionFactory txFactory
           
 
Constructor Summary
TransactionTable()
           
 
Method Summary
 boolean containRemoteTx(GlobalTransaction globalTransaction)
           
 boolean containsLocalTx(Transaction tx)
          Returns true if the given transaction is already registered with the transaction table.
 RemoteTransaction createRemoteTransaction(GlobalTransaction globalTx, WriteCommand[] modifications)
          Creates and register a RemoteTransaction with no modifications.
 void enlist(Transaction transaction, LocalTransaction localTransaction)
           
 void failureCompletingTransaction(Transaction tx)
           
 LocalTransaction getLocalTransaction(Transaction tx)
           
 Collection<LocalTransaction> getLocalTransactions()
           
protected  LocalTransaction getLocalTx(Transaction tx)
           
 int getLocalTxCount()
           
 Set<Object> getLockedKeysForRemoteTransaction(GlobalTransaction gtx)
           
 int getMinViewId()
           
 LocalTransaction getOrCreateLocalTransaction(Transaction transaction, TxInvocationContext ctx)
          Returns the TransactionXaAdapter corresponding to the supplied transaction.
 RemoteTransaction getRemoteTransaction(GlobalTransaction txId)
          Returns the RemoteTransaction associated with the supplied transaction id.
 Collection<RemoteTransaction> getRemoteTransactions()
           
 int getRemoteTxCount()
           
 void initialize(RpcManager rpcManager, Configuration configuration, InvocationContextContainer icc, InterceptorChain invoker, CacheNotifier notifier, TransactionFactory gtf, EmbeddedCacheManager cm, TransactionCoordinator txCoordinator, TransactionSynchronizationRegistry transactionSynchronizationRegistry, CommandsFactory commandsFactory, ClusteringDependentLogic clusteringDependentLogic)
           
 void localTransactionPrepared(LocalTransaction localTransaction)
           
protected  void recalculateMinViewIdIfNeeded(CacheTransaction removedTransaction)
           
 void recalculateMinViewIdOnTopologyChange(ViewChangedEvent vce)
           
 void remoteTransactionCommitted(GlobalTransaction gtx)
          Removes the RemoteTransaction corresponding to the given tx.
 void remoteTransactionPrepared(GlobalTransaction gtx)
           
 void remoteTransactionRollback(GlobalTransaction gtx)
           
 boolean removeLocalTransaction(LocalTransaction localTransaction)
          Removes the TransactionXaAdapter corresponding to the given tx.
 LocalTransaction removeLocalTransaction(Transaction tx)
           
protected  LocalTransaction removeLocalTransactionInternal(Transaction tx)
           
 RemoteTransaction removeRemoteTransaction(GlobalTransaction txId)
           
protected  void updateStateOnNodesLeaving(Collection<Address> leavers)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_STOPPED_VIEW_ID

public static final int CACHE_STOPPED_VIEW_ID
See Also:
Constant Field Values

configuration

protected Configuration configuration

icc

protected InvocationContextContainer icc

txCoordinator

protected TransactionCoordinator txCoordinator

txFactory

protected TransactionFactory txFactory

rpcManager

protected RpcManager rpcManager

commandsFactory

protected CommandsFactory commandsFactory

clusteringLogic

protected ClusteringDependentLogic clusteringLogic

clustered

protected boolean clustered
Constructor Detail

TransactionTable

public TransactionTable()
Method Detail

initialize

public void initialize(RpcManager rpcManager,
                       Configuration configuration,
                       InvocationContextContainer icc,
                       InterceptorChain invoker,
                       CacheNotifier notifier,
                       TransactionFactory gtf,
                       EmbeddedCacheManager cm,
                       TransactionCoordinator txCoordinator,
                       TransactionSynchronizationRegistry transactionSynchronizationRegistry,
                       CommandsFactory commandsFactory,
                       ClusteringDependentLogic clusteringDependentLogic)

getLockedKeysForRemoteTransaction

public Set<Object> getLockedKeysForRemoteTransaction(GlobalTransaction gtx)

remoteTransactionPrepared

public void remoteTransactionPrepared(GlobalTransaction gtx)

localTransactionPrepared

public void localTransactionPrepared(LocalTransaction localTransaction)

enlist

public void enlist(Transaction transaction,
                   LocalTransaction localTransaction)

failureCompletingTransaction

public void failureCompletingTransaction(Transaction tx)

containsLocalTx

public boolean containsLocalTx(Transaction tx)
Returns true if the given transaction is already registered with the transaction table.

Parameters:
tx - if null false is returned

getMinViewId

public int getMinViewId()

updateStateOnNodesLeaving

protected void updateStateOnNodesLeaving(Collection<Address> leavers)

getRemoteTransaction

public RemoteTransaction getRemoteTransaction(GlobalTransaction txId)
Returns the RemoteTransaction associated with the supplied transaction id. Returns null if no such association exists.


remoteTransactionRollback

public void remoteTransactionRollback(GlobalTransaction gtx)

createRemoteTransaction

public RemoteTransaction createRemoteTransaction(GlobalTransaction globalTx,
                                                 WriteCommand[] modifications)
Creates and register a RemoteTransaction with no modifications. Returns the created transaction.

Throws:
IllegalStateException - if an attempt to create a RemoteTransaction for an already registered id is made.

getOrCreateLocalTransaction

public LocalTransaction getOrCreateLocalTransaction(Transaction transaction,
                                                    TxInvocationContext ctx)
Returns the TransactionXaAdapter corresponding to the supplied transaction. If none exists, will be created first.


removeLocalTransaction

public boolean removeLocalTransaction(LocalTransaction localTransaction)
Removes the TransactionXaAdapter corresponding to the given tx. Returns true if such an tx exists.


removeLocalTransaction

public LocalTransaction removeLocalTransaction(Transaction tx)

removeLocalTransactionInternal

protected final LocalTransaction removeLocalTransactionInternal(Transaction tx)

remoteTransactionCommitted

public void remoteTransactionCommitted(GlobalTransaction gtx)
Removes the RemoteTransaction corresponding to the given tx.


removeRemoteTransaction

public final RemoteTransaction removeRemoteTransaction(GlobalTransaction txId)

getRemoteTxCount

public int getRemoteTxCount()

getLocalTxCount

public int getLocalTxCount()

getLocalTransaction

public LocalTransaction getLocalTransaction(Transaction tx)

containRemoteTx

public boolean containRemoteTx(GlobalTransaction globalTransaction)

getRemoteTransactions

public Collection<RemoteTransaction> getRemoteTransactions()

getLocalTx

protected final LocalTransaction getLocalTx(Transaction tx)

getLocalTransactions

public final Collection<LocalTransaction> getLocalTransactions()

recalculateMinViewIdIfNeeded

protected final void recalculateMinViewIdIfNeeded(CacheTransaction removedTransaction)

recalculateMinViewIdOnTopologyChange

public void recalculateMinViewIdOnTopologyChange(ViewChangedEvent vce)

-->

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