org.jboss.soa.esb.common
Class TransactionStrategy

java.lang.Object
  extended by org.jboss.soa.esb.common.TransactionStrategy

public abstract class TransactionStrategy
extends java.lang.Object

This class represents the transaction strategy that is currently in force within the ESB. At present there are two strategies employed, a null strategy when running outside of an application server environment and a JTA strategy when running within.

Author:
Kevin Conner

Constructor Summary
TransactionStrategy()
           
 
Method Summary
abstract  void begin()
          Begin a transaction on the current thread.
static TransactionStrategy getTransactionStrategy(boolean transacted)
          Get the active transaction strategy.
abstract  void rollbackOnly()
          Mark the current transaction for rollback.
static void setTransactionStrategy(TransactionStrategy transactionStrategy)
          Set the active transaction strategy.
abstract  void terminate()
          Terminate the transaction on the current thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionStrategy

public TransactionStrategy()
Method Detail

getTransactionStrategy

public static TransactionStrategy getTransactionStrategy(boolean transacted)
Get the active transaction strategy.

Parameters:
transacted - True if the current transacted strategy is required, false for a null strategy.
Returns:
The transaction strategy.

setTransactionStrategy

public static void setTransactionStrategy(TransactionStrategy transactionStrategy)
Set the active transaction strategy.

Parameters:
transactionStrategy - The transaction strategy.

begin

public abstract void begin()
                    throws TransactionStrategyException
Begin a transaction on the current thread.

Throws:
TransactionStrategyException

terminate

public abstract void terminate()
                        throws TransactionStrategyException
Terminate the transaction on the current thread. If the transaction has been marked for rollback then it will be rolled back, otherwise it will be committed.

Throws:
TransactionStrategyException

rollbackOnly

public abstract void rollbackOnly()
                           throws TransactionStrategyException
Mark the current transaction for rollback.

Throws:
TransactionStrategyException