private void extractMessageDrivenMetadata(GraphRewrite event, JavaTypeReferenceModel javaTypeReference) { javaTypeReference.getFile().setGenerateSourceReport(true); JavaAnnotationTypeReferenceModel annotationTypeReference = (JavaAnnotationTypeReferenceModel) javaTypeReference; JavaClassModel ejbClass = getJavaClass(javaTypeReference); String ejbName = getAnnotationLiteralValue(annotationTypeReference, "name"); if (Strings.isNullOrEmpty(ejbName)) { ejbName = ejbClass.getClassName(); } JavaAnnotationTypeValueModel activationConfigAnnotation = annotationTypeReference.getAnnotationValues().get("activationConfig"); String destination = getAnnotationLiteralValue(annotationTypeReference, "mappedName"); if (StringUtils.isBlank(destination)) { destination = getDestinationFromActivationConfig(activationConfigAnnotation); } Service<EjbMessageDrivenModel> messageDrivenService = new GraphService<>(event.getGraphContext(), EjbMessageDrivenModel.class); EjbMessageDrivenModel messageDrivenBean = messageDrivenService.create(); Set<ProjectModel> applications = ProjectTraversalCache.getApplicationsForProject(event.getGraphContext(), javaTypeReference.getFile().getProjectModel()); messageDrivenBean.setApplications(applications); messageDrivenBean.setBeanName(ejbName); messageDrivenBean.setEjbClass(ejbClass); if (StringUtils.isNotBlank(destination)) { String destinationType = getPropertyFromActivationConfig(activationConfigAnnotation, "destinationType"); JmsDestinationService jmsDestinationService = new JmsDestinationService(event.getGraphContext()); messageDrivenBean.setDestination(jmsDestinationService.createUnique(applications, destination, destinationType)); } }
private void extractMessageDrivenMetadata(GraphRewrite event, JavaTypeReferenceModel javaTypeReference) { javaTypeReference.getFile().setGenerateSourceReport(true); JavaAnnotationTypeReferenceModel annotationTypeReference = (JavaAnnotationTypeReferenceModel) javaTypeReference; JavaClassModel ejbClass = getJavaClass(javaTypeReference); String ejbName = getAnnotationLiteralValue(annotationTypeReference, "name"); if (Strings.isNullOrEmpty(ejbName)) { ejbName = ejbClass.getClassName(); } JavaAnnotationTypeValueModel activationConfigAnnotation = annotationTypeReference.getAnnotationValues().get("activationConfig"); String destination = getAnnotationLiteralValue(annotationTypeReference, "mappedName"); if (StringUtils.isBlank(destination)) { destination = getDestinationFromActivationConfig(activationConfigAnnotation); } Service<EjbMessageDrivenModel> messageDrivenService = new GraphService<>(event.getGraphContext(), EjbMessageDrivenModel.class); EjbMessageDrivenModel messageDrivenBean = messageDrivenService.create(); Set<ProjectModel> applications = ProjectTraversalCache.getApplicationsForProject(event.getGraphContext(), javaTypeReference.getFile().getProjectModel()); messageDrivenBean.setApplications(applications); messageDrivenBean.setBeanName(ejbName); messageDrivenBean.setEjbClass(ejbClass); if (StringUtils.isNotBlank(destination)) { String destinationType = getPropertyFromActivationConfig(activationConfigAnnotation, "destinationType"); JmsDestinationService jmsDestinationService = new JmsDestinationService(event.getGraphContext()); messageDrivenBean.setDestination(jmsDestinationService.createUnique(applications, destination, destinationType)); } }
mdb.setApplications(applications); mdb.setEjbClass(ejb); mdb.setBeanName(ejbName);
mdb.setApplications(applications); mdb.setEjbClass(ejb); mdb.setBeanName(ejbName);