|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xenonsoft.bridgetown.aop.transaction.support.AbstractTransactionServiceManager
An abstract class that contains the base implementation for a platform transaction service manager.
| Nested Class Summary | |
static class |
AbstractTransactionServiceManager.ConfigStackThreadLocal
A thread local based stack for storing Transaction Configuration object supplied to the transaction manager |
static class |
AbstractTransactionServiceManager.TxStackThreadLocal
A thread local based stack for storing Transaction Objects created by the transaction manager |
| Field Summary | |
protected static AbstractTransactionServiceManager.ConfigStackThreadLocal |
configStackList
The thread local stack that contains all transaction configurations known to the transaction service manager |
protected java.util.List |
participantListeners
A list of participant that interested in transaction manager events |
protected static AbstractTransactionServiceManager.TxStackThreadLocal |
txStackList
The thread local stack that contains all transaction objects known to the transaction service manager |
| Constructor Summary | |
AbstractTransactionServiceManager()
Default constructor |
|
| Method Summary | |
void |
addParticipiant(ITransactionParticipant participant)
Registers a transaction participant for notification of transaction management events. |
void |
begin(ITransactionSession session,
ITransactionConfig config)
Causes the transaction manager to allocate a transaction object from a transaction session using the configuration attributes supplied. |
void |
commit()
This method causes the transaction manager to commit the current transaction object. |
protected abstract void |
commitRollbackTx(TransactionObject tx,
boolean commit)
A refactored method for this implementation that attempts to commit or rollback the supplied transaction object. |
protected abstract void |
executeCommitOrRollback(boolean commit,
boolean debuggable,
java.lang.String identifier,
ITransactionConfig config,
TransactionObject tx)
A refactored method to commit or rollback the transaction object. |
protected abstract TransactionObject |
executeCreate(ITransactionSession session,
ITransactionConfig config,
boolean debuggable,
java.lang.String identifier)
A refactored method to create a transaction context object. |
protected abstract void |
executeResume(boolean debuggable,
java.lang.String identifier,
ITransactionConfig config,
TransactionObject tx)
A refactored method to resume a transaction object Subclasser cannot override this method to perform additional steps. |
protected abstract void |
executeSuspend(ITransactionConfig config,
boolean debuggable,
java.lang.String identifier,
TransactionObject tx)
A refactored method to suspend an existing transaction context object. |
protected void |
fireAfterBegin(TransactionObject tx)
Notify interested listeners (participants) that a transaction has just began with this transaction manager. |
protected void |
fireBeforeCommit(TransactionObject tx)
Notify interested listeners (participants) that a transaction has just about to commit with this transaction manager. |
protected void |
fireBeforeRollback(TransactionObject tx)
Notify interested listeners (participants) that a transaction has just about to roll back this transaction manager. |
protected abstract void |
forceRollbackTx(TransactionObject tx)
A refactored method for this TM implementation that forces rollback of the transaction object. |
protected static java.lang.String |
getThreadName()
Print the current thread name with namespace in order to identify the method calls through the transaction manager |
ITransactionContext |
getTransaction()
Retrieves the current transaction exception, if it exists within the transaction manager |
abstract boolean |
isActive()
Implements / overrides isActive |
abstract boolean |
isTransactionNew(ITransactionContext txRef)
Implements / overrides isTransactionNew |
void |
removeParticipiant(ITransactionParticipant participant)
Unregisters a transaction participant from notification of transaction management events. |
void |
resume(ITransactionContext txRef)
Resumes the transaction object |
void |
rollback()
This method causes the transaction manager to rollback the current transaction object. |
ITransactionContext |
suspend()
Suspends the current transaction context |
protected void |
unallocate(boolean commit)
This method will either commit or rollback the current transaction, if any, and perform unallocation the current transaction. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static transient AbstractTransactionServiceManager.TxStackThreadLocal txStackList
protected static transient AbstractTransactionServiceManager.ConfigStackThreadLocal configStackList
protected java.util.List participantListeners
| Constructor Detail |
public AbstractTransactionServiceManager()
| Method Detail |
protected static java.lang.String getThreadName()
public abstract boolean isActive()
isActive in interface ITransactionServiceManagerITransactionServiceManager.isActive()
public abstract boolean isTransactionNew(ITransactionContext txRef)
throws TransactionException,
java.lang.IllegalArgumentException
isTransactionNew in interface ITransactionServiceManagertxRef - the reference transaction context
TransactionException
java.lang.IllegalArgumentExceptionITransactionServiceManager.isTransactionNew(com.xenonsoft.bridgetown.aop.transaction.ITransactionContext)
public void begin(ITransactionSession session,
ITransactionConfig config)
throws TransactionException
begin in interface ITransactionServiceManagersession - the transaction sessionconfig - the transaction configuration
TransactionException - if there is a transaction operation failure
java.lang.IllegalArgumentException - Unknown transaction demarcation enumerationcommit(),
rollback()
protected void unallocate(boolean commit)
throws TransactionException
commit - parameter is true if commit is the required operation,
otherwise the request is a rollback.
TransactionException - if there is a transaction operation failurecommit(),
rollback()
public ITransactionContext suspend()
throws TransactionException
suspend in interface ITransactionServiceManagerTransactionException - if there is a transaction operation failure
public void resume(ITransactionContext txRef)
throws TransactionException
resume in interface ITransactionServiceManagertxRef - the transaction object as a reference
TransactionException - if there is a transaction operation failure
java.lang.IllegalArgumentException - if the transaction object does not belong to this transaction manager
java.lang.IllegalStateException - if the transaction object was never suspended in the first place
public void commit()
throws TransactionException
commit in interface ITransactionServiceManagerTransactionException - if there is a transaction operation failure
public void rollback()
throws TransactionException
rollback in interface ITransactionServiceManagerTransactionException - if there is a transaction operation failure
protected abstract TransactionObject executeCreate(ITransactionSession session,
ITransactionConfig config,
boolean debuggable,
java.lang.String identifier)
throws TransactionException
session - the transaction session factoryconfig - the transaction configurationdebuggable - if the logging debuggable flag is setidentifier - the transaction service identifier for logging
TransactionException - if there is a transaction operation failure
protected abstract void executeSuspend(ITransactionConfig config,
boolean debuggable,
java.lang.String identifier,
TransactionObject tx)
throws TransactionException
config - the transaction configurationdebuggable - if the logging debuggable flag is setidentifier - the transaction service identifier for loggingtx - the transaction object that represents a transaction
context to suspend
TransactionException - if there is a transaction operation failure
protected abstract void executeCommitOrRollback(boolean commit,
boolean debuggable,
java.lang.String identifier,
ITransactionConfig config,
TransactionObject tx)
throws TransactionException
commit - if true then attempt to commit transaction otherwise rollbackdebuggable - the debuggable flag if this method writes to loggeridentifier - the transaction service manager identifierconfig - the transaction configurationtx - the transaction context
TransactionException - if there is a transaction operation failure
protected abstract void executeResume(boolean debuggable,
java.lang.String identifier,
ITransactionConfig config,
TransactionObject tx)
throws TransactionException
debuggable - the debuggable flag if this method writes to loggeridentifier - the transaction service manager identifierconfig - the transaction configurationtx - the transaction context
TransactionException - if there is a transaction operation failure
protected abstract void commitRollbackTx(TransactionObject tx,
boolean commit)
throws TransactionException
tx - the transaction objectcommit - if true then attempt to commit transaction otherwise rollback
TransactionException - if there is a transaction operation failure
protected abstract void forceRollbackTx(TransactionObject tx)
throws TransactionException
tx - the transaction object
TransactionException - if there is a transaction operation failurepublic void addParticipiant(ITransactionParticipant participant)
addParticipiant in interface ITransactionServiceManagerparticipant - the transaction participantpublic void removeParticipiant(ITransactionParticipant participant)
removeParticipiant in interface ITransactionServiceManagerparticipant - the transaction participant
public ITransactionContext getTransaction()
throws TransactionException
getTransaction in interface ITransactionServiceManagerTransactionException - if there is a transaction operation failureLumberJacqueTransactionManager.isActive()protected void fireAfterBegin(TransactionObject tx)
tx - the transaction objectprotected void fireBeforeCommit(TransactionObject tx)
tx - the transaction objectprotected void fireBeforeRollback(TransactionObject tx)
tx - the transaction object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||