com.xenonsoft.bridgetown.aop.transaction
Class TransactionDemarcationEnum

java.lang.Object
  extended byorg.apache.commons.lang.enum.Enum
      extended bycom.xenonsoft.bridgetown.aop.transaction.TransactionDemarcationEnum
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public final class TransactionDemarcationEnum
extends org.apache.commons.lang.enum.Enum

Transaction demarcation enumeration denotes the process when a taransaction is started, resumed, committed, and rolled back. The EJB specification defines several attributes for container managed transactons, and they control how EJBs participate in transactions. These specifications are followed in the IoC Framework.

XA interface and Two Phase Commit Protocol
Two phase commit is a protocol used to control distributed transactions. It specifies a flow of command and states that execute during a distributed transaction context between the transaction session and the resource managers. The standard defined by the X/Open Group follows a so-called two phase commit process.

In the first phase, updates that will be written to the resources are sent to the resource managements and stored in a transaction log. Each resource in turn is asked to confirm whether it can guarantee the successful completion of its part of the transaction. The confirmation must be ACID: atomic, consistent, isolated and durable.

In the second phase, if the resource managers report that the their transaction portion will be successfully stored then the transaction session notifies all the resources to commit, and the effects of the distributed transaction are applied permanently. Should the a resource session reply with no guarantee, the transaction session notifies all the resources to roll back their transaction parts. The effect overall is a distributed transaction reversed out.

This enumeration type follows the J2EE specification.

Version:
$Id: TransactionDemarcationEnum.java,v 1.2 2004/11/03 04:35:37 peter_pilgrim Exp $
Author:
Peter Pilgrim, 20-Oct-2004
See Also:
Serialized Form

Field Summary
static TransactionDemarcationEnum CMTX_MANDATORY
          This attribute applies to AOP transaction methods that must already have an existing transaction context underway.
static TransactionDemarcationEnum CMTX_NEVER
          This attribute applies to AOP transaction methods that must NOT already have an existing transaction context underway.
static TransactionDemarcationEnum CMTX_NOT_SUPPORTED
          This attribute applies to AOP transaction methods that do not support transaction.
static TransactionDemarcationEnum CMTX_REQUIRED
          This attribute applies to AOP transaction methods that require a transaction context.
static TransactionDemarcationEnum CMTX_REQUIRES_NEW
          This attribute applies to AOP transaction methods that requires a brand new transaction context.
static TransactionDemarcationEnum CMTX_SUPPORTS
          This attribute applies to AOP transaction methods that can operate with or without a transaction context.
 
Fields inherited from class org.apache.commons.lang.enum.Enum
iToString
 
Method Summary
static TransactionDemarcationEnum getEnum(java.lang.String textValue)
           
static java.util.List getEnumList()
           
static java.util.Map getEnumMap()
           
static java.util.Iterator iterator()
           
 
Methods inherited from class org.apache.commons.lang.enum.Enum
compareTo, equals, getEnum, getEnumClass, getEnumList, getEnumMap, getName, hashCode, iterator, readResolve, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CMTX_NOT_SUPPORTED

public static final TransactionDemarcationEnum CMTX_NOT_SUPPORTED
This attribute applies to AOP transaction methods that do not support transaction. If the caller has a transaction in progress then the IoC Framework assembly factory suspends the transaction until the method complets. The container resumes the transaction after the method returns.


CMTX_REQUIRED

public static final TransactionDemarcationEnum CMTX_REQUIRED
This attribute applies to AOP transaction methods that require a transaction context. If a transaction is already underway, the container associate the method with that transcation. Otherwise, the container will start a brand new transaction, invoke the method, and then commit the transaction when the method completes normally.


CMTX_SUPPORTS

public static final TransactionDemarcationEnum CMTX_SUPPORTS
This attribute applies to AOP transaction methods that can operate with or without a transaction context. You can think of this attribute as a hybrid between CMTX_NOT_SUPPORTED and CMTX_REQUIRED.


CMTX_REQUIRES_NEW

public static final TransactionDemarcationEnum CMTX_REQUIRES_NEW
This attribute applies to AOP transaction methods that requires a brand new transaction context. This attribute always forces the container to start a new transaction for the target method. If there is current transaction underway, then that transaction is suspended until the aspected method returns. Afterwards it then resumes.


CMTX_MANDATORY

public static final TransactionDemarcationEnum CMTX_MANDATORY
This attribute applies to AOP transaction methods that must already have an existing transaction context underway. If no transaction is underway, the container throws an exception.


CMTX_NEVER

public static final TransactionDemarcationEnum CMTX_NEVER
This attribute applies to AOP transaction methods that must NOT already have an existing transaction context underway. If a transaction is underway, the container throws an exception.

Method Detail

getEnum

public static TransactionDemarcationEnum getEnum(java.lang.String textValue)

getEnumMap

public static java.util.Map getEnumMap()

getEnumList

public static java.util.List getEnumList()

iterator

public static java.util.Iterator iterator()


Copyright © 2005 XeNoNSoFT.com. All Rights Reserved.