|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.util.TransactionContextMap<T>
T - the type of transaction contextpublic class TransactionContextMap<T extends TransactionContext>
Utility class for maintaining the association between transactions and
instances of TransactionContext.
TransactionContextFactory| Constructor Summary | |
|---|---|
TransactionContextMap(TransactionProxy txnProxy)
Constructs an instance of this class with the given TransactionProxy. |
|
| Method Summary | |
|---|---|
void |
checkContext(T context)
Checks that the specified context is currently active,
throwing TransactionNotActiveException if it isn't. |
T |
checkTransaction(Transaction txn)
Checks the specified transaction, throwing IllegalStateException if the current context is null
or if the specified transaction is not equal to the transaction
in the current context. |
void |
clearContext()
Removes the currently active transaction context. |
T |
getContext()
Returns the context for the current transaction. |
T |
joinTransaction(TransactionContextFactory<T> contextFactory)
Makes sure the participant obtained from contextFactory is
joined to the current transaction and returns the associated
context. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TransactionContextMap(TransactionProxy txnProxy)
TransactionProxy.
txnProxy - the transaction proxy| Method Detail |
|---|
public T joinTransaction(TransactionContextFactory<T> contextFactory)
contextFactory is
joined to the current transaction and returns the associated
context. If the participant has not yet joined the current
transaction, creates a new context by invoking createContext on contextFactory, passing the current transaction, sets that
context as the current context for the current thread, and joins
the transaction. Returns the context for the current transaction.
contextFactory - the context factory
TransactionNotActiveException - if no transaction is active
IllegalStateException - if there is a problem with the
state of the transaction.public void clearContext()
public T getContext()
TransactionNotActiveException - if no transaction is active
IllegalStateException - if there is a problem with the
state of the transaction.public void checkContext(T context)
context is currently active,
throwing TransactionNotActiveException if it isn't.
context - a context
TransactionNotActiveException - if the specified
context is not currently activepublic T checkTransaction(Transaction txn)
IllegalStateException if the current context is null
or if the specified transaction is not equal to the transaction
in the current context.
txn - a transaction
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||