use of javax.ejb.TransactionManagement in project wildfly by wildfly.
the class TransactionManagementMergingProcessor method handleAnnotations.
@Override
protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription componentConfiguration) throws DeploymentUnitProcessingException {
final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName());
// we only care about annotations on the bean class itself
if (clazz == null) {
return;
}
ClassAnnotationInformation<TransactionManagement, TransactionManagementType> management = clazz.getAnnotationInformation(TransactionManagement.class);
if (management == null) {
return;
}
if (!management.getClassLevelAnnotations().isEmpty()) {
componentConfiguration.setTransactionManagementType(management.getClassLevelAnnotations().get(0));
}
}
use of javax.ejb.TransactionManagement 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();
}
Aggregations