private void extractMessageDrivenMetadata(GraphRewrite event, JavaTypeReferenceModel javaTypeReference) { ((SourceFileModel) javaTypeReference.getFile()).setGenerateSourceReport(true); JavaAnnotationTypeReferenceModel annotationTypeReference = (JavaAnnotationTypeReferenceModel) javaTypeReference; JavaClassModel ejbClass = getJavaClass(javaTypeReference); String ejbName = annotationTypeReference.getAnnotationValues().get("name"); String destination = annotationTypeReference.getAnnotationValues().get("mappedName"); if (StringUtils.isBlank(destination)) { String activationConfig = annotationTypeReference.getAnnotationValues().get("activationConfig"); Pattern p = Pattern .compile(".*propertyName[ \\t\\n]*=[ \\t\\n]*\"destination\"[ \\t\\n]*,[ \\t\\n]*propertyValue[ \\t\\n]*=[ \\t\\n]*\"(.*?)\".*"); Matcher m = p.matcher(activationConfig); if (m.matches()) { destination = m.group(1); } } Service<EjbMessageDrivenModel> messageDrivenService = new GraphService<>(event.getGraphContext(), EjbMessageDrivenModel.class); EjbMessageDrivenModel messageDrivenBean = messageDrivenService.create(); messageDrivenBean.setBeanName(ejbName); messageDrivenBean.setEjbClass(ejbClass); messageDrivenBean.setDestination(destination); }
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.setDisplayName(displayName); mdb.setEjbId(ejbId);
mdb.setApplications(applications); mdb.setEjbClass(ejb); mdb.setBeanName(ejbName); mdb.setDisplayName(displayName); mdb.setEjbId(ejbId);
EjbMessageDrivenModel mdb = sessionBeanService.create(); mdb.setEjbClass(ejb); mdb.setBeanName(ejbName); mdb.setDisplayName(displayName); mdb.setEjbId(ejbId);