FileDocCategorySizeDatePackage
ContainerTransaction.javaAPI DocGlassfish v2 API5528Fri May 04 22:31:20 BST 2007com.sun.enterprise.deployment

ContainerTransaction

public final class ContainerTransaction extends Descriptor
This descriptor represents a specification of a transactional behavior.
author
Danny Coward

Fields Summary
private String
transactionAttribute
public static final String
NOT_SUPPORTED
Transactions are not supported.
public static final String
SUPPORTS
Transactions need support.
public static final String
REQUIRED
A transaction is required.
public static final String
REQUIRES_NEW
A new transaction must be created.
public static final String
MANDATORY
Transaction is mandatory.
public static final String
NEVER
Never supply a transaction.
private static final com.sun.enterprise.util.LocalStringManagerImpl
localStrings
Constructors Summary
public ContainerTransaction(ContainerTransaction other)
Copy constructor.

    
           
       
	if (other != null) {
	    this.transactionAttribute = other.transactionAttribute;
	    this.setDescription(other.getDescription());
	}
    
public ContainerTransaction(String transactionAttribute, String description)
Create a new transaction descriptor with the given attribute. Throws an IllegalArgumentException if the attribute is not an allowed type. The allowed types are enumeration ny this class.

param
the transaction attribute.
param
the description.

	super("a Container Transaction", description);
	boolean isValidAttribute = (NOT_SUPPORTED.equals(transactionAttribute)
	    || SUPPORTS.equals(transactionAttribute)
		|| REQUIRED.equals(transactionAttribute)
		    || REQUIRED.equals(transactionAttribute)
			|| REQUIRES_NEW.equals(transactionAttribute)
			    || MANDATORY.equals(transactionAttribute)
				|| NEVER.equals(transactionAttribute) );
	if (!isValidAttribute && this.isBoundsChecking()) {
	    throw new IllegalArgumentException(localStrings.getLocalString(
			"enterprise.deployment.exceptionunknowncontainertxtype",
			"Unknown ContainerTransaction type: {0}", 
			new Object[] {transactionAttribute}));
	} else {
	    this.transactionAttribute = transactionAttribute;
	}
    
Methods Summary
public booleanequals(java.lang.Object other)
Equality iff the other object is another container transaction with the same transaction attribute.

return
true if the objects are equal, false otherwise.

	if (other != null && other instanceof ContainerTransaction) {
	    ContainerTransaction otherContainerTransaction = 
			    (ContainerTransaction) other;
	    if (otherContainerTransaction.getTransactionAttribute().equals(
					this.getTransactionAttribute())) {
		return true;
	    }
	}
	return false;
    
public java.lang.StringgetTransactionAttribute()
The transaction attribute that I specify.

return
the transaction attribute.

	return this.transactionAttribute;
    
public inthashCode()

        int result = 17;
        result = 37*result + getTransactionAttribute().hashCode();
        return result;
    
public voidprint(java.lang.StringBuffer toStringBuffer)
Returns a formatted String representing my state.

	toStringBuffer.append("Container Transaction: ").append(this.getTransactionAttribute()).append("@").append(this.getDescription());