jrunx.tyrex.tm
Class TransactionDomain

java.lang.Object
  |
  +--jrunx.tyrex.tm.TransactionDomain
Direct Known Subclasses:
TransactionDomainImpl

public abstract class TransactionDomain
extends java.lang.Object

A transaction domain provides centralized management for transactions.

A transaction domain defines the policy for all transactions created from that domain, such as default timeout, maximum number of open transactions, IIOP support, and journaling. In addition, the domain maintains resource managers such as JDBC data sources and JCA connectors.

The application server obtains a transaction manager or user transaction object, and managed resources from the transaction domain.

Transaction domains are created from a domain configuration file. For more information about domain configuration files, refer to the relevant documentation and domain.xsd.

A newly created transaction domain is in the state READY. The recover method must be called in order to make it active (ACTIVE). The domain can be deactivated by calling terminate.


Field Summary
static int ACTIVE
          Domain active status.
static int READY
          Domain ready status.
static int RECOVERING
          Domain recovery status.
static int TERMINATED
          Domain terminated status.
 
Constructor Summary
TransactionDomain()
           
 
Method Summary
abstract  void addInterceptor(TransactionInterceptor interceptor)
          Adds a transaction interceptor to this transaction domain.
abstract  DomainMetrics getDomainMetrics()
          Returns the transaction domain metrics.
abstract  java.lang.String getDomainName()
          Returns the transaction domain name.
abstract  int getState()
          Returns the transaction domain state.
abstract  org.omg.CosTransactions.TransactionFactory getTransactionFactory()
          Returns an OTS transaction factory for this transaction domain.
abstract  javax.transaction.TransactionManager getTransactionManager()
          Returns a transaction manager for this transaction domain.
abstract  javax.transaction.UserTransaction getUserTransaction()
          Returns a user transaction for this transaction domain.
 void logError(java.lang.String msg, java.lang.Throwable e)
           
abstract  void recover()
          Called to initiate recovery.
abstract  void removeInterceptor(TransactionInterceptor interceptor)
          Removes a transaction interceptor to this transaction domain.
abstract  void terminate()
          Terminates the transaction domain.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READY

public static final int READY
Domain ready status. This status is reported for a newly created transaction domain that has not been recovered yet. The domain cannot be used to create or import new transactions until is has been recovered.

RECOVERING

public static final int RECOVERING
Domain recovery status. This status is reported for a transaction domain during recovery.

ACTIVE

public static final int ACTIVE
Domain active status. This status is reported for a transaction domain after it has been recovered and before it is terminated. The domain can be used to create and import new transactions.

TERMINATED

public static final int TERMINATED
Domain terminated status. This status is reported for a transaction domain after it has been terminated. The domain is no longer useable.
Constructor Detail

TransactionDomain

public TransactionDomain()
Method Detail

logError

public void logError(java.lang.String msg,
                     java.lang.Throwable e)

getState

public abstract int getState()
Returns the transaction domain state.

The initial state for a transaction domain is READY. The domain transitions to ACTIVE after recovery has completed by calling recover.

The domain transitions to TERMINATED after it has been terminated by calling terminate.

Returns:
The transaction domain state

recover

public abstract void recover()
                      throws RecoveryException
Called to initiate recovery. This method must be called before the transaction domain is active and can be used to create new transactions. This method may be called multiple times, but will initiate recovery only the first time.
Throws:
RecoveryException - A chain of errors reported during recovery

getTransactionManager

public abstract javax.transaction.TransactionManager getTransactionManager()
Returns a transaction manager for this transaction domain.

The transaction managed can be used to begin, commit and rollback transactions in this domain only.

Calling this method multiple times will return the same instance of the transaction manager.

Returns:
The transaction manager for this domain

getUserTransaction

public abstract javax.transaction.UserTransaction getUserTransaction()
Returns a user transaction for this transaction domain.

The user transaction can be used to begin, commit and rollback transactions in this domain only.

Calling this method multiple times will return the same instance of the user transaction.

Returns:
The user transaction for this domain

getTransactionFactory

public abstract org.omg.CosTransactions.TransactionFactory getTransactionFactory()
Returns an OTS transaction factory for this transaction domain.

The transaction factory can be used to create and re-create OTS transactions in this domain only. It is also used to identify the ORB by implementing TransactionService.

Calling this method multiple times will return the same instance of the transaction factory.

Returns:
The transaction factory for this domain

terminate

public abstract void terminate()
Terminates the transaction domain. After this method returns, the transaction manager is no longer able to begin new transactions in this domain.

getDomainMetrics

public abstract DomainMetrics getDomainMetrics()
Returns the transaction domain metrics.
Returns:
The transaction domain metrics

getDomainName

public abstract java.lang.String getDomainName()
Returns the transaction domain name.
Returns:
The transaction domain name

addInterceptor

public abstract void addInterceptor(TransactionInterceptor interceptor)
Adds a transaction interceptor to this transaction domain. The interceptor will be notified of all transactional activities within this domain.
Parameters:
interceptor - The transaction interceptor

removeInterceptor

public abstract void removeInterceptor(TransactionInterceptor interceptor)
Removes a transaction interceptor to this transaction domain.
Parameters:
interceptor - The transaction interceptor


Copyright � 2002 Macromedia Corporation. All Rights Reserved.