com.xenonsoft.bridgetown.aop.transaction.lumberjacque
Class LumberJacqueTransactionManager

java.lang.Object
  extended bycom.xenonsoft.bridgetown.aop.transaction.support.AbstractTransactionServiceManager
      extended bycom.xenonsoft.bridgetown.aop.transaction.lumberjacque.LumberJacqueTransactionManager
All Implemented Interfaces:
ITransactionServiceManager

public class LumberJacqueTransactionManager
extends AbstractTransactionServiceManager

LumberJacque is "Straw-Man" transaction manager, it is really an emulation of an real implementation of a J2EE / EJB 2.0 propogation transaction monitor. If you are looking for JTA support then look elsewhere, because you will not find XAResource helpful, OMG, X/Open compliant distributed transaction manager here in within LumberJacque.

Version:
$Id: LumberJacqueTransactionManager.java,v 1.5 2005/03/20 17:43:35 peter_pilgrim Exp $
Author:
Peter Pilgrim, 04-Nov-2004 20:10:07

Nested Class Summary
 
Nested classes inherited from class com.xenonsoft.bridgetown.aop.transaction.support.AbstractTransactionServiceManager
AbstractTransactionServiceManager.ConfigStackThreadLocal, AbstractTransactionServiceManager.TxStackThreadLocal
 
Field Summary
 
Fields inherited from class com.xenonsoft.bridgetown.aop.transaction.support.AbstractTransactionServiceManager
configStackList, participantListeners, txStackList
 
Constructor Summary
LumberJacqueTransactionManager()
           
 
Method Summary
protected  void commitRollbackTx(TransactionObject tx, boolean commit)
          A refactored method for this implementation that attempts to commit or rollback the supplied transaction object.
protected  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  TransactionObject executeCreate(ITransactionSession session, ITransactionConfig config, boolean debuggable, java.lang.String identifier)
          A refactored method to create a transaction context object.
protected  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  void executeSuspend(ITransactionConfig config, boolean debuggable, java.lang.String identifier, TransactionObject tx)
          A refactored method to suspend an existing transaction context object.
protected  void forceRollbackTx(TransactionObject tx)
          A refactored method for this TM implementation that forces rollback of the transaction object.
 boolean isActive()
          Returns a boolean value if the current global transaction currently active.
 boolean isTransactionNew(ITransactionContext txRef)
          Gets the boolean flag if the supplied transaction associated with this manager and with the current thread is a brand new creation or not.
 java.lang.String toString()
          Returns a human readable string.
 
Methods inherited from class com.xenonsoft.bridgetown.aop.transaction.support.AbstractTransactionServiceManager
addParticipiant, begin, commit, fireAfterBegin, fireBeforeCommit, fireBeforeRollback, getThreadName, getTransaction, removeParticipiant, resume, rollback, suspend, unallocate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LumberJacqueTransactionManager

public LumberJacqueTransactionManager()
Method Detail

toString

public java.lang.String toString()
Returns a human readable string. Implements / overrides toString

Returns:
See Also:
Object.toString()

executeCreate

protected TransactionObject executeCreate(ITransactionSession session,
                                          ITransactionConfig config,
                                          boolean debuggable,
                                          java.lang.String identifier)
                                   throws TransactionException
A refactored method to create a transaction context object. Subclasser cannot override this method to perform additional steps.

Specified by:
executeCreate in class AbstractTransactionServiceManager
Parameters:
session - the transaction session factory
config - the transaction configuration
debuggable - if the logging debuggable flag is set
identifier - the transaction service identifier for logging
Returns:
the brand new transaction object
Throws:
TransactionException - if there is a transaction operation failure

executeSuspend

protected void executeSuspend(ITransactionConfig config,
                              boolean debuggable,
                              java.lang.String identifier,
                              TransactionObject tx)
                       throws TransactionException
A refactored method to suspend an existing transaction context object. Subclasser cannot override this method to perform additional steps.

Specified by:
executeSuspend in class AbstractTransactionServiceManager
Parameters:
config - the transaction configuration
debuggable - if the logging debuggable flag is set
identifier - the transaction service identifier for logging
tx - the transaction object that represents a transaction context to suspend
Throws:
TransactionException - if there is a transaction operation failure

executeCommitOrRollback

protected void executeCommitOrRollback(boolean commit,
                                       boolean debuggable,
                                       java.lang.String identifier,
                                       ITransactionConfig config,
                                       TransactionObject tx)
                                throws TransactionException
A refactored method to commit or rollback the transaction object. Subclasser cannot override this method to perform additional steps.

Specified by:
executeCommitOrRollback in class AbstractTransactionServiceManager
Parameters:
commit - if true then attempt to commit transaction otherwise rollback
debuggable - the debuggable flag if this method writes to logger
identifier - the transaction service manager identifier
config - the transaction configuration
tx - the transaction context
Throws:
TransactionException - if there is a transaction operation failure

executeResume

protected void executeResume(boolean debuggable,
                             java.lang.String identifier,
                             ITransactionConfig config,
                             TransactionObject tx)
                      throws TransactionException
A refactored method to resume a transaction object Subclasser cannot override this method to perform additional steps.

Specified by:
executeResume in class AbstractTransactionServiceManager
Parameters:
debuggable - the debuggable flag if this method writes to logger
identifier - the transaction service manager identifier
config - the transaction configuration
tx - the transaction context
Throws:
TransactionException - if there is a transaction operation failure

commitRollbackTx

protected void commitRollbackTx(TransactionObject tx,
                                boolean commit)
                         throws TransactionException
A refactored method for this implementation that attempts to commit or rollback the supplied transaction object.

Specified by:
commitRollbackTx in class AbstractTransactionServiceManager
Parameters:
tx - the transaction object
commit - if true then attempt to commit transaction otherwise rollback
Throws:
TransactionException - if there is a transaction operation failure

forceRollbackTx

protected void forceRollbackTx(TransactionObject tx)
                        throws TransactionException
A refactored method for this TM implementation that forces rollback of the transaction object.

Specified by:
forceRollbackTx in class AbstractTransactionServiceManager
Parameters:
tx - the transaction object
Throws:
TransactionException - if there is a transaction operation failure

isActive

public boolean isActive()
Returns a boolean value if the current global transaction currently active.

The transaction is not active if it is one of the following states:

Specified by:
isActive in interface ITransactionServiceManager
Specified by:
isActive in class AbstractTransactionServiceManager
Returns:
the active state
See Also:
TransactionStateEnum

isTransactionNew

public boolean isTransactionNew(ITransactionContext txRef)
                         throws TransactionException,
                                java.lang.IllegalArgumentException
Gets the boolean flag if the supplied transaction associated with this manager and with the current thread is a brand new creation or not.

Specified by:
isTransactionNew in interface ITransactionServiceManager
Specified by:
isTransactionNew in class AbstractTransactionServiceManager
Parameters:
txRef - the reference transaction context
Returns:
boolean true if the current transaction is new.
Throws:
TransactionException - thrown if there is a transaction operation failure
java.lang.IllegalArgumentException - thrown if the transaction is not associated with this service manager.
See Also:
ITransactionServiceManager.isTransactionNew(com.xenonsoft.bridgetown.aop.transaction.ITransactionContext)


Copyright © 2005 XeNoNSoFT.com. All Rights Reserved.