|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.util.TransactionContextFactory<T>
T - a type of transaction contextpublic abstract class TransactionContextFactory<T extends TransactionContext>
Utility class for participating in a transaction, parameterized by
a type of TransactionContext to be used with a participant.
| Nested Class Summary | |
|---|---|
protected class |
TransactionContextFactory.NonDurableParticipant
Provides a non-durable transaction participant. |
protected class |
TransactionContextFactory.Participant
Provides a durable transaction participant. |
| Constructor Summary | |
|---|---|
protected |
TransactionContextFactory(TransactionContextMap<T> contextMap,
String participantName)
Constructs an instance of this class with the given TransactionContextMap. |
protected |
TransactionContextFactory(TransactionProxy txnProxy,
String participantName)
Constructs an instance of this class, using the specified TransactionProxy to create the TransactionContextMap. |
| Method Summary | |
|---|---|
protected abstract T |
createContext(Transaction txn)
Returns a new TransactionContext to hold state for the
specified transaction, txn. |
protected TransactionParticipant |
createParticipant()
Returns a new transaction participant that operates on the currently active transaction context. |
TransactionParticipant |
getParticipant()
Returns the transaction participant for use with this factory. |
T |
joinTransaction()
Makes sure the participant 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 |
|---|
protected TransactionContextFactory(TransactionContextMap<T> contextMap,
String participantName)
TransactionContextMap.
contextMap - the transaction context mapparticipantName - the type name of the transaction participants
protected TransactionContextFactory(TransactionProxy txnProxy,
String participantName)
TransactionProxy to create the TransactionContextMap. Use this
constructor if access to the TransactionContextMap is not
needed.
txnProxy - the transaction proxyparticipantName - the type name of the transaction participants| Method Detail |
|---|
public T joinTransaction()
The default implementation calls joinTransaction on the TransactionContextMap supplied to, or created by, the constructor,
passing this instance as the argument.
TransactionNotActiveException - if no transaction is active
IllegalStateException - if there is a problem with the
state of the transaction.public TransactionParticipant getParticipant()
The default implementation creates a new transaction participant by
calling createParticipant the first time the
participant is requested.
protected abstract T createContext(Transaction txn)
TransactionContext to hold state for the
specified transaction, txn.
txn - a transaction
protected TransactionParticipant createParticipant()
The default implementation of this method returns a transaction
participant that implements NonDurableTransactionParticipant.
|
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 | |||||||||