Source:
protected abstract Object doIntercept(TransactionManager tm, Transaction tx, InvocationContext ic) throws Exception; private Transactional getTransactional(InvocationContext ic) { Transactional transactional = ic.getMethod().getAnnotation(Transactional.class); if (transactional != null) { return transactional; } Class<?> targetClass = ic.getTarget().getClass(); transactional = targetClass.getAnnotation(Transactional.class); if (transactional != null) { return transactional; } Transactional transactionalMethod = getTransactionalAnnotationRecursive(ic.getMethod().getAnnotations()); if(transactionalMethod != null) return transactionalMethod; AnnotatedType<?> annTypeBean = extension.getBeanToAnnotatedTypeMapping().get(interceptedBean); Transactional transactionalExtension = getTransactionalAnnotationRecursive(annTypeBean.getAnnotations()); if(transactionalExtension != null) return transactionalExtension; Transactional transactionalBasedOnStereotype = null; for(Class<? extends Annotation> stereotype: interceptedBean.getStereotypes()) { transactionalBasedOnStereotype = stereotype.getAnnotation(Transactional.class); if(transactionalBasedOnStereotype != null) return transactionalBasedOnStereotype; } Annotation stereotypeBeanAnnotation = interceptedBean.getBeanClass().getAnnotation(Stereotype.class); if(stereotypeBeanAnnotation != null) { Transactional transactionalBasedOnDefinedStereotype = getTransactionalAnnotationRecursive( beanManager.getStereotypeDefinition(stereotypeBeanAnnotation.annotationType())); if(transactionalBasedOnDefinedStereotype != null) return transactionalBasedOnDefinedStereotype; } Transactional transactionalNonContextual = getTransactionalAnnotationRecursive( interceptedBean.getClass().getAnnotations()); if(transactionalNonContextual != null) return transactionalNonContextual; throw new RuntimeException(jtaLogger.i18NLogger.get_expected_transactional_annotation()); }

Target:
protected abstract Object doIntercept(TransactionManager tm, Transaction tx, InvocationContext ic) throws Exception; private Transactional getTransactional(InvocationContext ic) { if(interceptedBean != null) { AnnotatedType<?> currentAnnotatedType = extension.getBeanToAnnotatedTypeMapping().get(interceptedBean); AnnotatedMethod<?> currentAnnotatedMethod = null; for(AnnotatedMethod<?> methodInSearch: currentAnnotatedType.getMethods()) { if(methodInSearch.getJavaMember().equals(ic.getMethod())) { currentAnnotatedMethod = methodInSearch; break; } } Transactional transactionalMethod = getTransactionalAnnotationRecursive(currentAnnotatedMethod.getAnnotations()); if(transactionalMethod != null) return transactionalMethod; Transactional transactionalExtension = getTransactionalAnnotationRecursive(currentAnnotatedType.getAnnotations()); if(transactionalExtension != null) return transactionalExtension; for(Class<? extends Annotation> stereotype: interceptedBean.getStereotypes()) { Transactional transactionalAnn = stereotype.getAnnotation(Transactional.class); if(transactionalAnn != null) return transactionalAnn; } } else { Transactional transactional = ic.getMethod().getAnnotation(Transactional.class); if (transactional != null) { return transactional; } Class<?> targetClass = ic.getTarget().getClass(); transactional = targetClass.getAnnotation(Transactional.class); if (transactional != null) { return transactional; } } throw new RuntimeException(jtaLogger.i18NLogger.get_expected_transactional_annotation()); }