|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tyrex.tm.TransactionDomain
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. |
static TransactionDomain |
createDomain(org.xml.sax.InputSource source)
Creates a new transaction domain from the specified domain configuration file. |
static TransactionDomain |
createDomain(java.io.InputStream stream)
Creates a new transaction domain from the specified domain configuration file. |
static TransactionDomain |
createDomain(java.lang.String url)
Creates a new transaction domain from the specified domain configuration file. |
static TransactionDomain |
getDomain(java.lang.String name)
Returns a transaction domain with the specified name. |
abstract DomainMetrics |
getDomainMetrics()
Returns the transaction domain metrics. |
abstract java.lang.String |
getDomainName()
Returns the transaction domain name. |
abstract Resources |
getResources()
Returns resources installed for this transaction domain. |
abstract int |
getState()
Returns the transaction domain state. |
static javax.transaction.Transaction |
getTransaction(java.lang.String xid)
Returns a transaction based on the transaction identifier. |
static javax.transaction.Transaction |
getTransaction(javax.transaction.xa.Xid xid)
Returns a transaction based on the transaction identifier. |
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. |
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 |
public static final int READY
public static final int RECOVERING
public static final int ACTIVE
public static final int TERMINATED
Constructor Detail |
public TransactionDomain()
Method Detail |
public static TransactionDomain getDomain(java.lang.String name)
name
- The name of the transaction domain
public static TransactionDomain createDomain(java.lang.String url) throws DomainConfigurationException
This method throws an exception if a transaction domain with the same name already exists, or the transaction domain could not be created.
url
- URL for the transaction domain configuration file
DomainConfigurationException
public static TransactionDomain createDomain(java.io.InputStream stream) throws DomainConfigurationException
This method throws an exception if a transaction domain with the same name already exists, or the transaction domain could not be created.
DomainConfigurationException
public static TransactionDomain createDomain(org.xml.sax.InputSource source) throws DomainConfigurationException
This method throws an exception if a transaction domain with the same name already exists, or the transaction domain could not be created.
source
- SAX input source for the transaction domain
configuration file
DomainConfigurationException
public abstract int getState()
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
.
public abstract void recover() throws RecoveryException
RecoveryException
- A chain of errors reported during recoverypublic static javax.transaction.Transaction getTransaction(javax.transaction.xa.Xid xid)
Returns the transaction object is the transaction is known to any transaction domain. The transaction may be in the prepared or complete state.
xid
- The transaction identifier
public static javax.transaction.Transaction getTransaction(java.lang.String xid)
Returns the transaction object is the transaction is known to any transaction domain. The transaction may be in the prepared or complete state.
The transaction identifier is a string obtained by calling toString() on the transaction or Xid object.
xid
- The transaction identifier
public abstract javax.transaction.TransactionManager getTransactionManager()
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.
public abstract javax.transaction.UserTransaction getUserTransaction()
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.
public abstract org.omg.CosTransactions.TransactionFactory getTransactionFactory()
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.
public abstract void addInterceptor(TransactionInterceptor interceptor)
interceptor
- The transaction interceptorpublic abstract void removeInterceptor(TransactionInterceptor interceptor)
interceptor
- The transaction interceptorpublic abstract void terminate()
public abstract DomainMetrics getDomainMetrics()
public abstract java.lang.String getDomainName()
public abstract Resources getResources()
Initially the resource list is based on resources defined in the domain configuration file. This method can be used to add new resources or disable existing resources.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |