|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.cache.transaction.TransactionTable
public class TransactionTable
Maintains the mapping between a local Transaction
and a GlobalTransaction
.
Also stores TransactionEntry
instances under a given transaction.
Field Summary | |
---|---|
protected Map<GlobalTransaction,TransactionEntry> |
gtx2EntryMap
Mappings between GlobalTransactions and modifications. |
protected Map<GlobalTransaction,Transaction> |
gtx2TxMap
|
protected Map<Transaction,GlobalTransaction> |
tx2gtxMap
Mapping between local (javax.transaction.Transaction) and GlobalTransactions. |
Constructor Summary | |
---|---|
TransactionTable()
|
Method Summary | |
---|---|
static void |
assertTransactionValid(InvocationContext ctx)
Tests whether the caller is in a valid transaction. |
TransactionEntry |
get(GlobalTransaction gtx)
Returns the local transaction entry for the global transaction. |
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)
Returns the local transaction associated with a GlobalTransaction. |
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. |
void |
initialize(TransactionManager transactionManager,
RPCManager rpcManager,
Configuration configuration)
|
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 |
put(GlobalTransaction tx,
TransactionEntry entry)
Associates the global transaction with a transaction entry. |
void |
put(Transaction tx,
GlobalTransaction gtx)
Associates the global transaction with the local transaction. |
TransactionEntry |
remove(GlobalTransaction tx)
Removes a global transation, returns the old transaction entry. |
void |
remove(GlobalTransaction gtx,
Transaction tx)
|
GlobalTransaction |
remove(Transaction tx)
Removes a local transation, returns the global transaction entry. |
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,GlobalTransaction> tx2gtxMap
protected final Map<GlobalTransaction,TransactionEntry> gtx2EntryMap
protected final Map<GlobalTransaction,Transaction> gtx2TxMap
Constructor Detail |
---|
public TransactionTable()
Method Detail |
---|
public void initialize(TransactionManager transactionManager, RPCManager rpcManager, Configuration configuration)
public void start()
public int getNumLocalTransactions()
public int getNumGlobalTransactions()
public GlobalTransaction get(Transaction tx)
public Transaction getLocalTransaction(GlobalTransaction gtx)
gtx
- The GlobalTransaction
public Transaction getLocalTransaction(GlobalTransaction gtx, boolean assertExists)
public void put(Transaction tx, GlobalTransaction gtx)
public TransactionEntry get(GlobalTransaction gtx)
public void put(GlobalTransaction tx, TransactionEntry entry)
public TransactionEntry remove(GlobalTransaction tx)
public GlobalTransaction remove(Transaction tx)
public void remove(GlobalTransaction gtx, Transaction tx)
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 created
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |