com.xenonsoft.bridgetown.aop.transaction.jta
Class JtaTransactionContext

java.lang.Object
  extended bycom.xenonsoft.bridgetown.aop.transaction.support.TransactionObject
      extended bycom.xenonsoft.bridgetown.aop.transaction.support.AbstractTransactionContext
          extended bycom.xenonsoft.bridgetown.aop.transaction.jta.JtaTransactionContext
All Implemented Interfaces:
IMutableTransactionContext, ITransactionContext

public class JtaTransactionContext
extends AbstractTransactionContext

A transaction context that delegates the Java Transaction API service.

The J2EE 1.3/1.4 transaction session does have one limitation -- it does not support nested transactions. In other words, it cannot start a transaction for an instance until the previous transaction has ended.

Version:
$Id: JtaTransactionContext.java,v 1.4 2005/02/23 01:27:28 peter_pilgrim Exp $
Author:
Peter Pilgrim, 24-Oct-2004

Field Summary
protected  ITransactionServiceManager transactionService
          The transaction management service
protected  javax.transaction.UserTransaction tx
          The JTA user transaction delegate
 
Fields inherited from class com.xenonsoft.bridgetown.aop.transaction.support.AbstractTransactionContext
attributes, resourceControllers, rollbackOnly, session, timeout, transactionState
 
Fields inherited from interface com.xenonsoft.bridgetown.aop.transaction.ITransactionContext
STANDARD_RESOURCE
 
Constructor Summary
JtaTransactionContext()
          Default constructor
 
Method Summary
 void commit()
          Implements / overrides commit
 ITransactionServiceManager getTransactionService()
          Implements / overrides getTransactionService
 javax.transaction.UserTransaction getUserTransaction()
          Gets the application server specific user transaction object
 boolean isTransactionNew()
          Implements / overrides isTransactionNew
 void rollback()
          Implements / overrides rollback
 void setRollbackOnly()
          Implements / overrides setRollbackOnly
 void setTransactionService(ITransactionServiceManager transactionService)
          Implements / overrides setTransactionService
 void setTransactionTimeout(int seconds)
          Implements / overrides setTransactionTimeout
 void setUserTransaction(javax.transaction.UserTransaction tx)
          Sets the application server specific user transaction object
 
Methods inherited from class com.xenonsoft.bridgetown.aop.transaction.support.AbstractTransactionContext
closeAllResources, delistResource, enlistResource, fireCloseResourceEvent, fireCommitResourceEvent, fireOpenResourceEvent, firePrepareToCommitEvent, fireResumeResourceEvent, fireRollbackResourceEvent, fireSuspendResourceEvent, getAttribute, getAttributeNames, getResource, getResourceCount, getResourceNames, getTransactionSession, getTransactionState, getTransactionTimeout, isRollbackOnly, setAttribute, setTransactionSession, setTransactionState, toString
 
Methods inherited from class com.xenonsoft.bridgetown.aop.transaction.support.TransactionObject
decrementUsageCount, getSavedConfiguration, getUsageCount, incrementUsageCount, isSuspended, setSavedConfiguration, setSuspended, setUsageCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

transactionService

protected ITransactionServiceManager transactionService
The transaction management service


tx

protected javax.transaction.UserTransaction tx
The JTA user transaction delegate

Constructor Detail

JtaTransactionContext

public JtaTransactionContext()
Default constructor

Method Detail

getUserTransaction

public javax.transaction.UserTransaction getUserTransaction()
Gets the application server specific user transaction object

Returns:
Returns the tx.

setUserTransaction

public void setUserTransaction(javax.transaction.UserTransaction tx)
Sets the application server specific user transaction object

Parameters:
tx - the new value for tx

commit

public void commit()
            throws TransactionException
Implements / overrides commit

Throws:
TransactionException
See Also:
ITransactionContext.commit()

rollback

public void rollback()
              throws TransactionException
Implements / overrides rollback

Throws:
TransactionException
See Also:
ITransactionContext.rollback()

setRollbackOnly

public void setRollbackOnly()
                     throws TransactionException
Implements / overrides setRollbackOnly

Specified by:
setRollbackOnly in interface ITransactionContext
Overrides:
setRollbackOnly in class AbstractTransactionContext
Throws:
TransactionException
See Also:
ITransactionContext.setRollbackOnly()

setTransactionTimeout

public void setTransactionTimeout(int seconds)
                           throws TransactionException
Implements / overrides setTransactionTimeout

Specified by:
setTransactionTimeout in interface ITransactionContext
Overrides:
setTransactionTimeout in class AbstractTransactionContext
Parameters:
seconds -
Throws:
TransactionException
See Also:
ITransactionContext.setTransactionTimeout(int)

getTransactionService

public ITransactionServiceManager getTransactionService()
Implements / overrides getTransactionService

Returns:
See Also:
IMutableTransactionContext.getTransactionService()

setTransactionService

public void setTransactionService(ITransactionServiceManager transactionService)
Implements / overrides setTransactionService

Parameters:
transactionService -
See Also:
IMutableTransactionContext.setTransactionService(com.xenonsoft.bridgetown.aop.transaction.ITransactionServiceManager)

isTransactionNew

public boolean isTransactionNew()
Implements / overrides isTransactionNew

Returns:
See Also:
ITransactionContext.isTransactionNew()


Copyright © 2005 XeNoNSoFT.com. All Rights Reserved.