tyrex.tm.impl
public class TransactionDomainImpl extends TransactionDomain implements Runnable, DomainMetrics
Version: $Revision: 1.34 $ $Date: 2005/11/30 13:21:03 $
Field Summary | |
---|---|
static int | TABLE_SIZE
The size of the hash table. |
protected Category | _category
The log4J category for this transaction domain. |
protected Journal | _journal
The transaction journal used by this domain. |
protected ORB | _orb
The CORBA ORB used by this transaction domain, or null
if no CORBA ORB is used. |
protected TransactionManagerImpl | _txManager
A singleton transaction manager implementation. |
Constructor Summary | |
---|---|
TransactionDomainImpl(DomainConfig config)
Constructs a new transaction domain.
|
Method Summary | |
---|---|
void | addInterceptor(TransactionInterceptor interceptor) |
protected TransactionImpl | createTransaction(TransactionImpl parent, long timeout)
Creates a new transaction. |
protected void | delistThread(ThreadContext context, Thread thread)
Called to dissociatethe transaction from the thread.
|
protected void | dumpTransactionList(PrintWriter writer) |
protected boolean | enlistThread(TransactionImpl tx, ThreadContext context, Thread thread)
Called to associate the transaction with the thread.
|
TransactionImpl | findTransaction(Xid xid) |
TransactionImpl | findTransaction(String xid) |
protected void | forgetTransaction(TransactionImpl tx)
Called by forget to forget about
the transaction once it has been commited/rolledback.
|
int | getActive() |
float | getAvgDuration() |
DomainMetrics | getDomainMetrics() |
String | getDomainName() |
boolean | getNestedTransactions() |
TransactionDomainImpl | getNextDomain() |
Resources | getResources() |
int | getState() |
int | getTotalCommitted() |
int | getTotalRolledback() |
TransactionFactory | getTransactionFactory() |
TransactionManager | getTransactionManager() |
int | getTransactionTimeout() |
protected int | getTransactionTimeout(TransactionImpl tx)
Called by ControlImpl to obtain the timeout on a
transaction for the purpose of the propagation context.
|
UserTransaction | getUserTransaction() |
void | identifyORB(ORB orb, TSIdentification tsi, Properties prop) |
protected Transaction[] | listTransactions() |
protected void | notifyCommit(TransactionImpl tx) |
protected void | notifyCompletion(TransactionImpl tx, int heuristic) |
protected void | notifyRollback(TransactionImpl tx) |
void | recover() |
protected TransactionImpl | recreateTransaction(PropagationContext pgContext)
Creates a new transaction to represent a remote OTS
transaction, but does not activate it yet. |
void | removeInterceptor(TransactionInterceptor interceptor) |
void | reset() |
void | run()
Background thread that looks for transactions that have timed
out and terminates them. |
void | setNextDomain(TransactionDomainImpl nextDomain) |
protected void | setTransactionTimeout(int timeout)
Called to set the timeout of all transactions created from this domain.
|
protected void | setTransactionTimeout(TransactionImpl tx, int timeout)
Called to change the timeout of the transaction and all the resources
enlisted with that transaction.
|
void | terminate() |
String | toString() |
Parameters: config The domain configuration object
Throws: DomainConfigurationException Failed to create the transaction domain
Parameters: parent The parent transaction timeout The default timeout for the new transaction, specified in seconds
Returns: The newly created transaction
Throws: SystemException Reached the quota for new transactions
Parameters: tx The transaction context The thread context thread The thread
See Also: enlistThread
Parameters: tx The transaction context The thread context thread The thread
Returns: True if transaction enlisted in thread, false if failed
forget
to forget about
the transaction once it has been commited/rolledback.
The transaction will no longer be available to findTransaction
. The transaction's association and global identifier
are forgotten as well as all thread associated with it.
Subsequent calls to findTransaction
and getControl
will not be able to locate the
transaction.
If this is the last transaction in a terminating domain, the domain will close some of its resources (e.g. journal) after this method returns.
Parameters: tx The transaction to forget about
Parameters: tx The transaction
Returns: The transaction's timeout in seconds
The newly created transaction will have a non-native Xid, therefore it cannot be distributed across two machines using the RMI interface but only through OTS propagation context.
Parameters: pgContext The OTS propagation context
Returns: The newly created transaction
Throws: SystemException Reached the quota for new transactions, or a transaction with the same identifier already exists
See Also: TransactionFactoryImpl PropagationContext
This thread is terminated by interrupting it. This thread synchronizes on itself (thread instance) to be notified of a changed in the next timeout.
Parameters: timeout The new timeout in seconds, zero to restore the default timeout
Parameters: tx The transaction timeout The new timeout in seconds, zero to use the default timeout for all new transactions.
See Also: TransactionManager#setTransactionTimeout setTransactionTimeout