|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xenonsoft.bridgetown.aop.transaction.support.TransactionObject
com.xenonsoft.bridgetown.aop.transaction.support.AbstractTransactionContext
This is an extension of the virtual transaction object class that
really takes on board the abstract transaction context concept.
This class is a mutable transaction context
IMutableTransactionContext
in terms of the
transaction service manager ITransactionServiceManager
because it is the TSM that actually creates, acquires, releases,
and destroys a transactional context.
The mutable transaction context, then, is not supposed to be
called by the application or user program.
This transactional object type is also directly related to the thread of the control. In other words this class are stored as thread local variables or associated in such as way by the TSM.
| Field Summary | |
protected java.util.Map |
attributes
Attributes for transaction context |
protected java.util.Map |
resourceControllers
A list orderd set collection of resource controllers |
protected boolean |
rollbackOnly
True if the transaction is set to rollback only |
protected ITransactionSession |
session
The transaction session that create this transaction context. |
protected int |
timeout
Transaction timeout |
protected TransactionStateEnum |
transactionState
The current transaction state |
| Fields inherited from interface com.xenonsoft.bridgetown.aop.transaction.ITransactionContext |
STANDARD_RESOURCE |
| Constructor Summary | |
AbstractTransactionContext()
Default constructor |
|
| Method Summary | |
void |
closeAllResources()
Closes all transactional resources |
void |
delistResource(java.lang.String name,
IResourceController resource)
Implements / overrides delistResource Only delist if the resource was already managed by this current transaction context. |
void |
enlistResource(java.lang.String name,
IResourceController resource)
Implements / overrides enlistResource. |
void |
fireCloseResourceEvent()
Notify all registered resource controllers that they should close any resource associated with the transaction |
void |
fireCommitResourceEvent()
Notify all registered resource controllers that they should acquire any resource associated with the transaction |
void |
fireOpenResourceEvent()
Notify all registered resource controllers that they should acquire any resource associated with the transaction |
boolean |
firePrepareToCommitEvent()
Inquire all registered resource controllers if they can commit the transaction. |
void |
fireResumeResourceEvent()
Notify all registered resource controllers that they should resume the transaction state, which was place in suspension |
void |
fireRollbackResourceEvent()
Notify all registered resource controllers that they should acquire any resource associated with the transaction |
void |
fireSuspendResourceEvent()
Notify all registered resource controllers that they should suspend the transaction state until resumption |
java.lang.Object |
getAttribute(java.lang.String key)
Implements / overrides getAttribute |
java.util.Iterator |
getAttributeNames()
Implements / overrides getAttributeNames |
java.lang.Object |
getResource(java.lang.String name)
Implements / overrides getResource |
int |
getResourceCount()
Implements / overrides getResourceCount |
java.util.Iterator |
getResourceNames()
Implements / overrides getResourceNames |
ITransactionSession |
getTransactionSession()
Gets the transaction session that created this transaction context |
TransactionStateEnum |
getTransactionState()
Implements / overrides getTransactionState |
int |
getTransactionTimeout()
Retrieve the transaction timeout |
boolean |
isRollbackOnly()
Implements / overrides isRollbackOnly |
void |
setAttribute(java.lang.String key,
java.lang.Object value)
Implements / overrides setAttribute |
void |
setRollbackOnly()
Implements / overrides setRollbackOnly |
void |
setTransactionSession(ITransactionSession session)
Sets the transaction session that created this transaction context |
void |
setTransactionState(TransactionStateEnum transactionState)
Sets the transactionState |
void |
setTransactionTimeout(int seconds)
Implements / overrides setTransactionTimeout |
java.lang.String |
toString()
Returns a human readable string. |
| 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 |
getTransactionService, setTransactionService |
| Methods inherited from interface com.xenonsoft.bridgetown.aop.transaction.ITransactionContext |
commit, isTransactionNew, rollback |
| Field Detail |
protected java.util.Map resourceControllers
protected ITransactionSession session
protected boolean rollbackOnly
protected int timeout
protected TransactionStateEnum transactionState
protected java.util.Map attributes
| Constructor Detail |
public AbstractTransactionContext()
| Method Detail |
public java.lang.String toString()
Object.toString()public int getResourceCount()
getResourceCount in interface IMutableTransactionContextIMutableTransactionContext.getResourceCount()public java.util.Iterator getResourceNames()
getResourceNames in interface IMutableTransactionContextIMutableTransactionContext.getResourceNames()
public java.lang.Object getResource(java.lang.String name)
throws TransactionException
getResource in interface ITransactionContextname - the transactional resource
TransactionException - if the operation cannot be completed
java.lang.IllegalArgumentException - thrown if the name is blank or nullITransactionContext.getResource(java.lang.String)
public void setRollbackOnly()
throws TransactionException
setRollbackOnly in interface ITransactionContextTransactionExceptionITransactionContext.setRollbackOnly()
public void setTransactionTimeout(int seconds)
throws TransactionException
setTransactionTimeout in interface ITransactionContextseconds -
TransactionExceptionITransactionContext.setTransactionTimeout(int)public int getTransactionTimeout()
public boolean isRollbackOnly()
isRollbackOnly in interface ITransactionContextITransactionContext.isRollbackOnly()public TransactionStateEnum getTransactionState()
getTransactionState in interface ITransactionContextITransactionContext.getTransactionState()public void setTransactionState(TransactionStateEnum transactionState)
setTransactionState in interface IMutableTransactionContexttransactionState - the new value for transactionStatepublic ITransactionSession getTransactionSession()
getTransactionSession in interface IMutableTransactionContextIMutableTransactionContext.getTransactionSession()public void setTransactionSession(ITransactionSession session)
setTransactionSession in interface IMutableTransactionContextsession - the transaction sessionIMutableTransactionContext.setTransactionSession(com.xenonsoft.bridgetown.aop.transaction.ITransactionSession)
public void enlistResource(java.lang.String name,
IResourceController resource)
enlistResource in interface ITransactionContextname - the name of the transactional resourceresource - the resource controller to associate with the transaction
TransactionException - if the enlistment operation cannot be completedcom.xenonsoft.bridgetown.aop.transaction.ITransactionContext#enlistResource(com.xenonsoft.bridgetown.aop.transaction.IResourceController)
public void delistResource(java.lang.String name,
IResourceController resource)
delistResource in interface ITransactionContextname - the name of the transactional resourceresource - the resource controller to associate with the transaction
TransactionException - if the enlistment operation cannot be completedcom.xenonsoft.bridgetown.aop.transaction.ITransactionContext#delistResource(com.xenonsoft.bridgetown.aop.transaction.IResourceController)
public void closeAllResources()
throws TransactionException
closeAllResources in interface ITransactionContextTransactionException - if the operation cannot be completedITransactionContext.closeAllResources(),
fireCloseResourceEvent()public void fireOpenResourceEvent()
fireOpenResourceEvent in interface IMutableTransactionContextpublic void fireCloseResourceEvent()
fireCloseResourceEvent in interface IMutableTransactionContextpublic boolean firePrepareToCommitEvent()
firePrepareToCommitEvent in interface IMutableTransactionContextpublic void fireSuspendResourceEvent()
fireSuspendResourceEvent in interface IMutableTransactionContextpublic void fireCommitResourceEvent()
fireCommitResourceEvent in interface IMutableTransactionContextpublic void fireRollbackResourceEvent()
fireRollbackResourceEvent in interface IMutableTransactionContextpublic void fireResumeResourceEvent()
fireResumeResourceEvent in interface IMutableTransactionContextpublic java.lang.Object getAttribute(java.lang.String key)
getAttribute in interface ITransactionContextkey -
ITransactionContext.getAttribute(java.lang.String)public java.util.Iterator getAttributeNames()
getAttributeNames in interface ITransactionContextITransactionContext.getAttributeNames()
public void setAttribute(java.lang.String key,
java.lang.Object value)
setAttribute in interface ITransactionContextkey - value - ITransactionContext.setAttribute(java.lang.String, java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||