FileDocCategorySizeDatePackage
TransactionManagementHandler.javaAPI DocGlassfish v2 API4058Fri May 04 22:31:34 BST 2007com.sun.enterprise.deployment.annotation.handlers

TransactionManagementHandler

public class TransactionManagementHandler extends AbstractAttributeHandler
This handler is responsible for handling the javax.ejb.TransactionManagement.
author
Shing Wai Chan

Fields Summary
Constructors Summary
public TransactionManagementHandler()

    
Methods Summary
public java.lang.ClassgetAnnotationType()

return
the annoation type this annotation handler is handling

        return TransactionManagement.class;
    
public java.lang.Class[]getTypeDependencies()

return
an array of annotation types this annotation handler would require to be processed (if present) before it processes it's own annotation type.

        return getEjbAnnotationTypes();
    
protected com.sun.enterprise.deployment.annotation.HandlerProcessingResultprocessAnnotation(com.sun.enterprise.deployment.annotation.AnnotationInfo ainfo, com.sun.enterprise.deployment.annotation.context.EjbContext[] ejbContexts)

        
        TransactionManagement tmAn = (TransactionManagement)ainfo.getAnnotation();

        String tmType =
                TransactionManagementType.CONTAINER.equals(tmAn.value())?
                EjbDescriptor.CONTAINER_TRANSACTION_TYPE :
                EjbDescriptor.BEAN_TRANSACTION_TYPE;

        for (EjbContext ejbContext : ejbContexts) {
            EjbDescriptor ejbDesc = ejbContext.getDescriptor();
            // override by xml
            if (ejbDesc.getTransactionType() == null) {
                ejbDesc.setTransactionType(tmType);
            }
        }

        return getDefaultProcessedResult();