Search in sources :

Example 51 with EjbDescriptor

use of org.glassfish.ejb.deployment.descriptor.EjbDescriptor in project Payara by payara.

the class TransactionManagementHandler method processAnnotation.

protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbContext[] ejbContexts) throws AnnotationProcessorException {
    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 = (EjbDescriptor) ejbContext.getDescriptor();
        // override by xml
        if (ejbDesc.getTransactionType() == null) {
            ejbDesc.setTransactionType(tmType);
        }
    }
    return getDefaultProcessedResult();
}
Also used : EjbContext(com.sun.enterprise.deployment.annotation.context.EjbContext) EjbDescriptor(org.glassfish.ejb.deployment.descriptor.EjbDescriptor) TransactionManagement(javax.ejb.TransactionManagement)

Aggregations

EjbDescriptor (org.glassfish.ejb.deployment.descriptor.EjbDescriptor)51 Iterator (java.util.Iterator)19 EjbBundleDescriptorImpl (org.glassfish.ejb.deployment.descriptor.EjbBundleDescriptorImpl)19 ComponentNameConstructor (com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor)16 Result (com.sun.enterprise.tools.verifier.Result)14 Method (java.lang.reflect.Method)13 MethodDescriptor (com.sun.enterprise.deployment.MethodDescriptor)12 EjbContext (com.sun.enterprise.deployment.annotation.context.EjbContext)10 Set (java.util.Set)8 EjbEntityDescriptor (org.glassfish.ejb.deployment.descriptor.EjbEntityDescriptor)7 EjbSessionDescriptor (org.glassfish.ejb.deployment.descriptor.EjbSessionDescriptor)7 EjbCMPEntityDescriptor (org.glassfish.ejb.deployment.descriptor.EjbCMPEntityDescriptor)5 Container (com.sun.ejb.Container)4 Field (java.lang.reflect.Field)4 DummyEjbDescriptor (org.glassfish.ejb.deployment.descriptor.DummyEjbDescriptor)4 VerifierTestContext (com.sun.enterprise.tools.verifier.VerifierTestContext)3 Constructor (java.lang.reflect.Constructor)3 Vector (java.util.Vector)3 Descriptor (org.glassfish.deployment.common.Descriptor)3 ContainerTransaction (org.glassfish.ejb.deployment.descriptor.ContainerTransaction)3