com.xenonsoft.bridgetown.aop.transaction.support
Class BasicTransactionContext

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.support.BasicTransactionContext
All Implemented Interfaces:
IMutableTransactionContext, ITransactionContext
Direct Known Subclasses:
JdbcTransactionContext

public class BasicTransactionContext
extends AbstractTransactionContext
implements IMutableTransactionContext

A basic implementation of the platform agnostic global or local session transaction context that is associated per thread with an application.

Version:
$Id: BasicTransactionContext.java,v 1.2 2005/02/23 01:28:14 peter_pilgrim Exp $
Author:
Peter Pilgrim, 10-Feb-2005 16:55:59

Field Summary
protected  ITransactionSession session
          The transaction session
protected  ITransactionServiceManager transactionService
          The transaction management service
 
Fields inherited from class com.xenonsoft.bridgetown.aop.transaction.support.AbstractTransactionContext
attributes, resourceControllers, rollbackOnly, timeout, transactionState
 
Fields inherited from interface com.xenonsoft.bridgetown.aop.transaction.ITransactionContext
STANDARD_RESOURCE
 
Constructor Summary
BasicTransactionContext()
          Default constructo transaction context
 
Method Summary
 void commit()
          Implements / overrides commit
 ITransactionSession getSession()
          Gets the transaction session
 ITransactionServiceManager getTransactionService()
          Gets the transactionService
 boolean isTransactionNew()
          Implements / overrides isTransactionNew.
 void rollback()
          Implements / overrides rollback
 void setSession(ITransactionSession session)
          Sets the transaction session
 void setTransactionService(ITransactionServiceManager transactionService)
          Sets the transactionService
 
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, setRollbackOnly, setTransactionSession, setTransactionState, setTransactionTimeout, 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
 
Methods inherited from interface com.xenonsoft.bridgetown.aop.transaction.IMutableTransactionContext
fireCloseResourceEvent, fireCommitResourceEvent, fireOpenResourceEvent, firePrepareToCommitEvent, fireResumeResourceEvent, fireRollbackResourceEvent, fireSuspendResourceEvent, getResourceCount, getResourceNames, getTransactionSession, setTransactionSession, setTransactionState
 
Methods inherited from interface com.xenonsoft.bridgetown.aop.transaction.ITransactionContext
closeAllResources, delistResource, enlistResource, getAttribute, getAttributeNames, getResource, getTransactionState, isRollbackOnly, setAttribute, setRollbackOnly, setTransactionTimeout
 

Field Detail

transactionService

protected ITransactionServiceManager transactionService
The transaction management service


session

protected ITransactionSession session
The transaction session

Constructor Detail

BasicTransactionContext

public BasicTransactionContext()
Default constructo transaction context

Method Detail

getTransactionService

public ITransactionServiceManager getTransactionService()
Gets the transactionService

Specified by:
getTransactionService in interface IMutableTransactionContext
Returns:
Returns the transactionService.

setTransactionService

public void setTransactionService(ITransactionServiceManager transactionService)
Sets the transactionService

Specified by:
setTransactionService in interface IMutableTransactionContext
Parameters:
transactionService - the new value for transactionService

getSession

public ITransactionSession getSession()
Gets the transaction session

Returns:
Returns the session.

setSession

public void setSession(ITransactionSession session)
Sets the transaction session

Parameters:
session - the new value for session

commit

public void commit()
            throws TransactionException
Implements / overrides commit

Specified by:
commit in interface ITransactionContext
Throws:
TransactionException
See Also:
ITransactionContext.commit()

rollback

public void rollback()
              throws TransactionException
Implements / overrides rollback

Specified by:
rollback in interface ITransactionContext
Throws:
TransactionException
See Also:
ITransactionContext.rollback()

isTransactionNew

public boolean isTransactionNew()
Implements / overrides isTransactionNew.

Specified by:
isTransactionNew in interface ITransactionContext
Returns:
boolean value if this transaction context is a new platform transaction or not.
See Also:
ITransactionContext.isTransactionNew(), ITransactionServiceManager.isTransactionNew(ITransactionContext)


Copyright © 2005 XeNoNSoFT.com. All Rights Reserved.