@Override public String toString() { return "ServiceInterfaceEntry{" + "maybeBaseCache=" + maybeBaseCache + ", qName='" + qName + '\'' + ", fullyQualifiedName='" + getFullyQualifiedName() + '\'' + ", exportedOsgiClassName=" + exportedOsgiClassName + ", nullableDescription='" + nullableDescription + '\'' + '}'; } }
public static Annotation createRequireIfcAnnotation( ServiceInterfaceEntry sie) { String reqIfc = sie.getFullyQualifiedName() + ".class"; return new Annotation(RequireInterface.class.getCanonicalName(), Lists.newArrayList(new Parameter("value", reqIfc))); }
public File writeSie(final ServiceInterfaceEntry sie, final File outputBaseDir) { try { GeneralInterfaceTemplate generalInterfaceTemplate = TemplateFactory.serviceInterfaceFromSie(sie); GeneratedObject go = new GenericGeneratedObjectFactory().toGeneratedObject(generalInterfaceTemplate, COPYRIGHT); return go.persist(outputBaseDir).get().getValue(); } catch (Exception e) { String message = "An error occurred during Service interface generating, sie:" + sie.getTypeName() + ", " + sie.getFullyQualifiedName(); LOG.error(message, e); throw new RuntimeException(message, e); } }
private static Map<String, QName> findProvidedServices(final IdentitySchemaNode moduleIdentity, final Module currentModule, final Map<QName, ServiceInterfaceEntry> qNamesToSIEs, final SchemaContext schemaContext) { Map<String, QName> result = new HashMap<>(); for (UnknownSchemaNode unknownNode : moduleIdentity.getUnknownSchemaNodes()) { if (ConfigConstants.PROVIDED_SERVICE_EXTENSION_QNAME.equals(unknownNode.getNodeType())) { String prefixAndIdentityLocalName = unknownNode.getNodeParameter(); ServiceInterfaceEntry sie = findSIE(prefixAndIdentityLocalName, currentModule, qNamesToSIEs, schemaContext); result.put(sie.getFullyQualifiedName(), sie.getQName()); } } return result; }
public static GeneralInterfaceTemplate serviceInterfaceFromSie( final ServiceInterfaceEntry sie) { List<String> extendedInterfaces = Lists .newArrayList(AbstractServiceInterface.class.getCanonicalName()); if (sie.getBase().isPresent()) { extendedInterfaces.add(sie.getBase().get().getFullyQualifiedName()); } // FIXME header GeneralInterfaceTemplate sieTemplate = new GeneralInterfaceTemplate( getHeaderFromEntry(sie), sie.getPackageName(), sie.getTypeName(), extendedInterfaces, Lists.<MethodDeclaration> newArrayList()); sieTemplate.setJavadoc(sie.getNullableDescription()); if (sie.getNullableDescription() != null) { sieTemplate.getAnnotations().add( Annotation.createDescriptionAnnotation(sie .getNullableDescription())); } sieTemplate.getAnnotations().addAll(Annotation.createSieAnnotations(sie)); return sieTemplate; }
format("for(javax.management.ObjectName dep : %s) {\n", moduleField.getName()) + format(" dependencyResolver.validateDependency(%s.class, dep, %sJmxAttribute);\n", moduleField.getDependency().getSie().getFullyQualifiedName(), moduleField.getName()) + "}\n"; } else { moduleField.getDependency().getSie().getFullyQualifiedName(), moduleField.getName(), moduleField.getName()); if(moduleField.getDependency().isMandatory() == false) { result += "}\n";