org.beanlet.transaction
Enum TransactionAttributeType

java.lang.Object
  extended by java.lang.Enum<TransactionAttributeType>
      extended by org.beanlet.transaction.TransactionAttributeType
All Implemented Interfaces:
Serializable, Comparable<TransactionAttributeType>

public enum TransactionAttributeType
extends Enum<TransactionAttributeType>

Defines all possible transaction types.


Enum Constant Summary
MANDATORY
          The mandatory attribute indicates that the business method must be called in the context of an active transaction.
NEVER
          Business methods annotated with this attribute must not be called within the scope of an active transaction.
NOT_SUPPORTED
          This attribute indicates that a business method should never be executed in the context of a transaction by the container.
REQUIRED
          This attribute indicates that the business method must be invoked in the context of a transaction.
REQUIRES_NEW
          This attribute indicates that the business method will always be invoked in the context of a new transaction.
SUPPORTS
          This attribute indicates that the container should defer the creation of a transaction to the caller.
 
Method Summary
static TransactionAttributeType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static TransactionAttributeType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NEVER

public static final TransactionAttributeType NEVER
Business methods annotated with this attribute must not be called within the scope of an active transaction. An unchecked exception is thrown if the method is called within the scope of an active transaction. The method will be invoked in an unspecified transaction context, similar to NEVER_SUPPORTED.


NOT_SUPPORTED

public static final TransactionAttributeType NOT_SUPPORTED
This attribute indicates that a business method should never be executed in the context of a transaction by the container. If a transaction is already active for the running thread, the transaction is suspended during the lifetime of the underlying method. The business method runs in an unspecified transaction context.


MANDATORY

public static final TransactionAttributeType MANDATORY
The mandatory attribute indicates that the business method must be called in the context of an active transaction. If not, an unchecked exception is thrown.


SUPPORTS

public static final TransactionAttributeType SUPPORTS
This attribute indicates that the container should defer the creation of a transaction to the caller. The container may allow the invocation of the business method within the transaction context of a caller. The method may also be called with no transaction context associated with the caller.


REQUIRED

public static final TransactionAttributeType REQUIRED
This attribute indicates that the business method must be invoked in the context of a transaction. If there is a transaction associated with the caller, that transaction is associated with the method invocation. If the caller does not have an associated transaction, the container starts a new transaction prior to invoking the business method, and subsequently terminates the transaction when the business method has returned.


REQUIRES_NEW

public static final TransactionAttributeType REQUIRES_NEW
This attribute indicates that the business method will always be invoked in the context of a new transaction. If the caller invokes the method within a transaction, the container will suspend that transaction and start a new transaction before calling the actual business method. When the business method completes, the container will terminate the newly created transaction and resume the caller's transaction.

Method Detail

values

public static TransactionAttributeType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (TransactionAttributeType c : TransactionAttributeType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static TransactionAttributeType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2006-2012. All Rights Reserved.