Package org.apache.tuscany.sca.contribution.processor

Examples of org.apache.tuscany.sca.contribution.processor.ContributionResolveException


                            try {
                                theWSDL.setDefinition(wsdlPortType.getDefinition());
                                wsdlInterface = WSDLfactory.createWSDLInterface(wsdlPortType.getElement(), theWSDL, resolver);
                                wsdlInterface.setWsdlDefinition(theWSDL);
                            } catch (InvalidInterfaceException e) {
                                ContributionResolveException ce = new ContributionResolveException(e);
                                error("ContributionResolveException", resolver, ce);
                                throw ce;
                            } // end try
                            resolver.addModel(wsdlInterface);
                            theInterfaces.add(wsdlInterface);
View Full Code Here


                    // Introspect the Java interface and populate the interface and
                    // operations
                    javaFactory.createJavaInterface(javaInterface, javaClass);
               
                } catch (InvalidInterfaceException e) {
                  ContributionResolveException ce = new ContributionResolveException(e);
                  error("ContributionResolveException", javaFactory, ce);
                    return javaInterface;
                  //throw ce;
                }
View Full Code Here

                            wsdlDefinition.setDefinition(portType.getDefinition());
                            wsdlInterface = wsdlFactory.createWSDLInterface(portType.getElement(), wsdlDefinition, resolver);
                            wsdlInterface.setWsdlDefinition(wsdlDefinition);
                            resolver.addModel(wsdlInterface);
                        } catch (InvalidInterfaceException e) {
                          ContributionResolveException ce = new ContributionResolveException(e);
                          error("ContributionResolveException", wsdlFactory, ce);
                            //throw ce;
                        }                       
                    }
                    else {
View Full Code Here

                                imp.setDefinition(resolved.getDefinition());
                                if (!model.getImportedDefinitions().contains(resolved)) {
                                    model.getImportedDefinitions().add(resolved);
                                }
                            } catch (Exception e) {
                              ContributionResolveException ce = new ContributionResolveException(e);
                              error("ContributionResolveException", resolver, ce);
                                //throw ce;
                            }
                        } else {
                            if (location.startsWith("/")) {
                                // This is a relative URI against a contribution
                                location = location.substring(1);
                                // TODO: Need to resolve it against the contribution
                            } else {
                                // This is a relative URI against the WSDL document
                                URI baseURI = URI.create(model.getDefinition().getDocumentBaseURI());
                                URI locationURI = baseURI.resolve(location);
                                WSDLDefinition resolved;
                                try {
                                    resolved = read(null, locationURI, locationURI.toURL());
                                    imp.setDefinition(resolved.getDefinition());
                                    if (!model.getImportedDefinitions().contains(resolved)) {
                                        model.getImportedDefinitions().add(resolved);
                                    }
                                } catch (Exception e) {
                                  ContributionResolveException ce = new ContributionResolveException(e);
                                  error("ContributionResolveException", resolver, ce);
                                    //throw ce;
                                }
                            }
                        }
View Full Code Here

                    Class<?> cls = getJavaClass(resolver, i);
                    JavaInterface javaInterface;
                    try {
                        javaInterface = javaInterfaceFactory.createJavaInterface(cls);
                    } catch (InvalidInterfaceException e) {
                        throw new ContributionResolveException(e);
                    }
                    Reference reference = assemblyFactory.createReference();
                    JavaInterfaceContract contract = javaInterfaceFactory.createJavaInterfaceContract();
                    contract.setInterface(javaInterface);
                    reference.setInterfaceContract(contract);
View Full Code Here

        javaImplementation.setJavaClass(javaClass);

        try {
            javaFactory.createJavaImplementation(javaImplementation, javaImplementation.getJavaClass());
        } catch (IntrospectionException e) {
            ContributionResolveException ce = new ContributionResolveException(e);
            error("ContributionResolveException", javaFactory, ce);
            //throw ce;
            return;
        }
View Full Code Here

          javaImplementation.setJavaClass(javaClass);

          try {
              javaFactory.createJavaImplementation(javaImplementation, javaImplementation.getJavaClass());
          } catch (IntrospectionException e) {
              ContributionResolveException ce = new ContributionResolveException(e);
              error(monitor, "ContributionResolveException", javaFactory, ce);
              //throw ce;
              return;
          }

          checkNoStaticAnnotations(monitor, javaImplementation);
         
          postJAXWSProcessorResolve(resolver, javaImplementation, context);
         
          javaImplementation.setUnresolved(false);
         
          mergeComponentType(resolver, javaImplementation, context);

          // FIXME the introspector should always create at least one service
          if (javaImplementation.getServices().isEmpty()) {
              javaImplementation.getServices().add(assemblyFactory.createService());
          }
        } catch (Throwable e) {
            throw new ContributionResolveException("Resolving Java implementation: " + javaImplementation.getName()
                + ", "
                + e.getMessage(), e);
        } // end try
    } // end method
View Full Code Here

                        count++;
                    } // end for

                    if (count == 0) {
                        error(monitor, "PartnerLinkTypeNoRoles", theElement, pLinkElement.getName());
                        throw new ContributionResolveException("partnerLinkType " + pLinkElement.getName() + " has no Roles defined");
                    } else
                        thePLinks.add(pLinkElement);
                } // end if
            } // end for
        } // end for
View Full Code Here

                            // Introspect the WSDL portType and add the resulting WSDLInterface to the resolver
                            try {
                                wsdlInterface = wsdlFactory.createWSDLInterface(wsdlPortType.getElement(), theWSDL, resolver, context.getMonitor());
                                wsdlInterface.setWsdlDefinition(theWSDL);
                            } catch (InvalidInterfaceException e) {
                                ContributionResolveException ce =
                                  new ContributionResolveException("Unable to create WSDLInterface for portType " + portType.getQName(),e);
                                error(context.getMonitor(), "ContributionResolveException", resolver, ce);
                                throw ce;
                            } // end try
                            resolver.addModel(wsdlInterface, context);
                            theInterfaces.add(wsdlInterface);
View Full Code Here

            for (Artifact artifact : contribution.getArtifacts()) {
              if (packageName.equals(artifact.getURI().replace("/", ".")))
                  available = true;
            }
            if (! available)
              throw new ContributionResolveException("[JCI100007] A Java package "+ packageName +" that is specified on an export " +
                  "element MUST be contained within the contribution containing the export element.");
          }
        }       
       
        // Resolve all artifact models
          for (Artifact artifact : contribution.getArtifacts()) {
              Object model = artifact.getModel();
              if (model != null) {
                  Artifact oldArtifact = context.setArtifact(artifact);
                  try {
                     artifactProcessor.resolve(model, contributionResolver, context);
                  } catch (Throwable e) {
                      throw new ContributionResolveException(e);
                  } finally {
                      context.setArtifact(oldArtifact);
                  }
              }
          }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.contribution.processor.ContributionResolveException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.