org.infinispan.transaction.xa
Class TransactionTable

java.lang.Object
  extended by org.infinispan.transaction.xa.TransactionTable

public class TransactionTable
extends Object

Repository for RemoteTransaction and TransactionXaAdapters (locally originated transactions).

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

Nested Class Summary
 class TransactionTable.StaleTransactionCleanup
           
 
Constructor Summary
TransactionTable()
           
 
Method Summary
 boolean containRemoteTx(GlobalTransaction globalTransaction)
           
 RemoteTransaction createRemoteTransaction(GlobalTransaction globalTx)
          Creates and register a RemoteTransaction with no modifications.
 RemoteTransaction createRemoteTransaction(GlobalTransaction globalTx, WriteCommand[] modifications)
          Creates and register a RemoteTransaction based on the supplied params.
 int getLocalTxCount()
           
 TransactionXaAdapter getOrCreateXaAdapter(Transaction transaction, InvocationContext ctx)
          Returns the TransactionXaAdapter corresponding to the supplied transaction.
 RemoteTransaction getRemoteTransaction(GlobalTransaction txId)
          Returns the RemoteTransaction associated with the supplied transaction id.
 int getRemoteTxCount()
           
 TransactionXaAdapter getXaCacheAdapter(Transaction tx)
           
 void initialize(CommandsFactory commandsFactory, RpcManager rpcManager, Configuration configuration, InvocationContextContainer icc, InterceptorChain invoker, CacheNotifier notifier, GlobalTransactionFactory gtf, CacheManager cm)
           
 boolean removeLocalTransaction(Transaction tx)
          Removes the TransactionXaAdapter corresponding to the given tx.
 boolean removeRemoteTransaction(GlobalTransaction txId)
          Removes the RemoteTransaction corresponding to the given tx.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionTable

public TransactionTable()
Method Detail

initialize

public void initialize(CommandsFactory commandsFactory,
                       RpcManager rpcManager,
                       Configuration configuration,
                       InvocationContextContainer icc,
                       InterceptorChain invoker,
                       CacheNotifier notifier,
                       GlobalTransactionFactory gtf,
                       CacheManager cm)

getRemoteTransaction

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


createRemoteTransaction

public RemoteTransaction createRemoteTransaction(GlobalTransaction globalTx,
                                                 WriteCommand[] modifications)
Creates and register a RemoteTransaction based on the supplied params. Returns the created transaction.

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

createRemoteTransaction

public RemoteTransaction createRemoteTransaction(GlobalTransaction globalTx)
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.

getOrCreateXaAdapter

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


removeLocalTransaction

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


removeRemoteTransaction

public boolean removeRemoteTransaction(GlobalTransaction txId)
Removes the RemoteTransaction corresponding to the given tx. Returns true if such an tx exists.


getRemoteTxCount

public int getRemoteTxCount()

getLocalTxCount

public int getLocalTxCount()

getXaCacheAdapter

public TransactionXaAdapter getXaCacheAdapter(Transaction tx)

containRemoteTx

public boolean containRemoteTx(GlobalTransaction globalTransaction)

Google Analytics

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