|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.tm.TransactionLocal
public class TransactionLocal
A TransactionLocal is similar to ThreadLocal except it is keyed on the Transactions. A transaction local variable is cleared after the transaction completes.
| Field Summary | |
|---|---|
protected TransactionLocalDelegate |
delegate
The delegate |
protected TransactionManager |
transactionManager
The transaction manager is maintained by the system and manges the assocation of transaction to threads. |
| Constructor Summary | |
|---|---|
TransactionLocal()
Creates a thread local variable. |
|
TransactionLocal(TransactionManager tm)
Creates a transaction local variable. |
|
| Method Summary | |
|---|---|
protected boolean |
containsValue(Transaction tx)
does Transaction contain object? |
Object |
get()
Returns the value of this TransactionLocal variable associated with the thread context transaction. |
Object |
get(Transaction transaction)
Returns the value of this TransactionLocal variable associated with the specified transaction. |
Transaction |
getTransaction()
|
protected Object |
getValue(Transaction tx)
get the transaction local value. |
protected void |
initDelegate()
Initialise the delegate |
protected Object |
initialValue()
Returns the initial value for this thransaction local. |
void |
lock()
Lock the TransactionLocal using the current transaction |
void |
lock(Transaction transaction)
Lock the TransactionLocal using the provided transaction |
void |
set(Object value)
Sets the value of this TransactionLocal variable associtated with the thread context transaction. |
void |
set(Transaction transaction,
Object value)
Sets the value of this TransactionLocal variable associtated with the specified transaction. |
protected void |
storeValue(Transaction tx,
Object value)
put the value in the TransactionImpl map |
void |
unlock()
Unlock the TransactionLocal using the current transaction |
void |
unlock(Transaction transaction)
Unlock the ThreadLocal using the provided transaction |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final TransactionManager transactionManager
protected TransactionLocalDelegate delegate
| Constructor Detail |
|---|
public TransactionLocal()
IllegalStateException - if there is no system transaction managerpublic TransactionLocal(TransactionManager tm)
tm - the transaction manager| Method Detail |
|---|
public void lock()
throws InterruptedException
WARN: The current implemention just "locks the transactions"
IllegalStateException - if the transaction is not active
InterruptedException - if the thread is interrupted
public void lock(Transaction transaction)
throws InterruptedException
WARN: The current implemention just "locks the transactions"
transaction - the transaction
IllegalStateException - if the transaction is not active
InterruptedException - if the thread is interruptedpublic void unlock()
public void unlock(Transaction transaction)
transaction - the transactionprotected Object initialValue()
protected Object getValue(Transaction tx)
protected void storeValue(Transaction tx,
Object value)
protected boolean containsValue(Transaction tx)
public Object get()
public Object get(Transaction transaction)
transaction - the transaction for which the variable it to
be retrieved
IllegalStateException - if an error occures while registering
a synchronization callback with the transactionpublic void set(Object value)
value - the value to be associated with the thread context
transactions's TransactionLocal
public void set(Transaction transaction,
Object value)
transaction - the transaction for which the value will be setvalue - the value to be associated with the thread context
transactions's TransactionLocalpublic Transaction getTransaction()
protected void initDelegate()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||