|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.infinispan.transaction.TransactionTable
public class TransactionTable
Maintains the mapping between a local Transaction
and a GlobalTransaction
. Also stores TransactionContext
instances under a given transaction.
Field Summary | |
---|---|
protected Map<GlobalTransaction,TransactionContext> |
gtxMapping
Mappong between GlobalTransaction and a TransactionContext |
protected Map<Transaction,TransactionContext> |
txMapping
Mapping between local (javax.transaction.Transaction) and a TransactionContext |
Constructor Summary | |
---|---|
TransactionTable()
|
Method Summary | |
---|---|
static void |
assertTransactionValid(InvocationContext ctx)
Tests whether the caller is in a valid transaction. |
void |
associateTransaction(Transaction tx,
GlobalTransaction gtx,
TransactionContext ctx)
Associates 3 elements of a transaction - a local Transaction, a GlobalTransaction and a TransactionContext - with each other. |
void |
cleanup(GlobalTransaction gtx)
|
GlobalTransaction |
get(Transaction tx)
Returns the global transaction associated with the local transaction. |
GlobalTransaction |
getCurrentTransaction()
Returns the transaction associated with the current thread. |
GlobalTransaction |
getCurrentTransaction(boolean createIfNotExists)
Returns the transaction associated with the thread; optionally creating it if is does not exist. |
GlobalTransaction |
getCurrentTransaction(Transaction tx)
Returns the global transaction for this local transaction. |
GlobalTransaction |
getCurrentTransaction(Transaction tx,
boolean createIfNotExists)
Returns the global transaction for this local transaction. |
protected Transaction |
getLocalTransaction()
Returns the transaction associated with the current thread. |
Transaction |
getLocalTransaction(GlobalTransaction gtx)
|
Transaction |
getLocalTransaction(GlobalTransaction gtx,
boolean assertExists)
If assers exists is true and the coresponding local transaction is null an IllegalStateExcetpion is being thrown. |
int |
getNumGlobalTransactions()
Returns the number of global transactions. |
int |
getNumLocalTransactions()
Returns the number of local transactions. |
TransactionContext |
getTransactionContext(GlobalTransaction gtx)
|
void |
initialize(TransactionManager transactionManager,
RpcManager rpcManager,
ContextFactory contextFactory)
|
static boolean |
isActive(Transaction tx)
Returns true if transaction is ACTIVE, false otherwise |
static boolean |
isPreparing(Transaction tx)
Returns true if transaction is PREPARING, false otherwise |
static boolean |
isValid(Transaction tx)
Return s true of tx's status is ACTIVE or PREPARING |
void |
start()
|
String |
toString()
Returns summary debug information. |
String |
toString(boolean printDetails)
Returns detailed debug information. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Map<Transaction,TransactionContext> txMapping
protected final Map<GlobalTransaction,TransactionContext> gtxMapping
Constructor Detail |
---|
public TransactionTable()
Method Detail |
---|
public void initialize(TransactionManager transactionManager, RpcManager rpcManager, ContextFactory contextFactory)
public void start()
public int getNumLocalTransactions()
public int getNumGlobalTransactions()
public GlobalTransaction get(Transaction tx)
public Transaction getLocalTransaction(GlobalTransaction gtx, boolean assertExists)
public void associateTransaction(Transaction tx, GlobalTransaction gtx, TransactionContext ctx)
tx
- transaction to associategtx
- global transaction to associatectx
- transaction context to associatepublic Transaction getLocalTransaction(GlobalTransaction gtx)
public String toString()
toString
in class Object
public String toString(boolean printDetails)
public GlobalTransaction getCurrentTransaction()
public GlobalTransaction getCurrentTransaction(boolean createIfNotExists)
protected Transaction getLocalTransaction()
getCurrentTransaction()
public static boolean isActive(Transaction tx)
public static boolean isPreparing(Transaction tx)
public static boolean isValid(Transaction tx)
tx
-
public static void assertTransactionValid(InvocationContext ctx)
public GlobalTransaction getCurrentTransaction(Transaction tx)
public GlobalTransaction getCurrentTransaction(Transaction tx, boolean createIfNotExists)
createIfNotExists
- if true, if a global transaction is not found; one is createdpublic TransactionContext getTransactionContext(GlobalTransaction gtx)
public void cleanup(GlobalTransaction gtx)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |