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

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


            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


                            newWSDLInterface.getRequiredIntents().addAll(wsdlInterface.getRequiredIntents());
                            newWSDLInterface.getPolicySets().addAll(wsdlInterface.getPolicySets());
                            resolver.addModel(newWSDLInterface, context);
                            wsdlInterface = newWSDLInterface;
                        } catch (InvalidInterfaceException e) {
                          ContributionResolveException ce = new ContributionResolveException("Invalid interface when resolving " +
                                                                                          portType.toString(), e);
                          error(monitor, "ContributionResolveException", wsdlFactory, ce);
                            //throw ce;
                        } // end try                     
                    }
                    else {
                      warning(monitor, "WsdlInterfaceDoesNotMatch", wsdlDefinition, wsdlInterface.getName());
                    } // end if
                } else {
                  // If we get here, the WSDLDefinition is unresolved...
                  ContributionResolveException ce = new ContributionResolveException("WSDLDefinition unresolved " +
                      wsdlInterface.getName() );
                    error(monitor, "ContributionResolveException", wsdlFactory, ce);
                } // end if
            } // end if
        } // end if
View Full Code Here

                            wsdlDefinition.setDefinition(portType.getDefinition());
                            wsdlInterface = wsdlFactory.createWSDLInterface(portType.getElement(), wsdlDefinition, resolver, monitor);
                            wsdlInterface.setWsdlDefinition(wsdlDefinition);
                            resolver.addModel(wsdlInterface, context);
                        } catch (InvalidInterfaceException e) {
                          ContributionResolveException ce = new ContributionResolveException("Invalid interface when resolving " +
                                                                                          portType.toString(), e);
                          Monitor.error(monitor, WSDLInterfaceProcessor.class.getName(),
                              "interface-wsdlxml-validation-messages", "ContributionResolveException",
                              wsdlFactory.getClass().getName(), ce.getMessage());
                            //throw ce;
                        } // end try                     
                    }
                    else {
                      Monitor.warning(monitor, WSDLInterfaceProcessor.class.getName(),
                          "interface-wsdlxml-validation-messages", "WsdlInterfaceDoesNotMatch",
                          wsdlDefinition.getNamespace(), wsdlInterface.getName().toString() );
                    } // end if
                } else {
                  // If we get here, the WSDLDefinition is unresolved...
                  ContributionResolveException ce = new ContributionResolveException("WSDLDefinition unresolved " +
                      wsdlInterface.getName() );
                    Monitor.error(monitor, WSDLInterfaceProcessor.class.getName(),
                      "interface-wsdlxml-validation-messages", "ContributionResolveException",
                      wsdlFactory.getClass().getName(), ce.getMessage());
                } // end if
            } // end if
        } // end if
        return wsdlInterface;     
    } // end method resolveWSDLInterface
View Full Code Here

                WSDLInterface newWSDLInterface = wsdlFactory.createWSDLInterface(portType, wsdlDefinition, resolver, monitor);
                newWSDLInterface.getRequiredIntents().addAll(wsdlInterface.getRequiredIntents());
                newWSDLInterface.getPolicySets().addAll(wsdlInterface.getPolicySets());
                wsdlInterface = newWSDLInterface;
            } catch (InvalidInterfaceException e) {
                ContributionResolveException ce = new ContributionResolveException("Invalid interface when resolving " +
                                                                                    portType.toString(), e);
                error(monitor, "ContributionResolveException", wsdlFactory, ce);
            }   
           
            wsdlInterface.setWsdlDefinition(wsdlDefinition);
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(monitor, "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(), context);
                                    imp.setDefinition(resolved.getDefinition());
                                    if (!model.getImportedDefinitions().contains(resolved)) {
                                        model.getImportedDefinitions().add(resolved);
                                    }
                                } catch (Exception e) {
                                  ContributionResolveException ce = new ContributionResolveException(e);
                                  error(monitor, "ContributionResolveException", resolver, ce);
                                    //throw ce;
                                }
                            }
                        }
View Full Code Here

        try {
            if (introspect(impl, resolver, context, bundle)) {
                return;
            }
        } catch (ContributionReadException e) {
            throw new ContributionResolveException(e);
        }

        // The bundle may be different from the current contribution
        ComponentType componentType = assemblyFactory.createComponentType();
        // Try to find a bundle.componentType for the target bundle
View Full Code Here

                    Class<?> cls = getJavaClass(resolver, i, context);
                    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

                    Composite resolved = resolver.resolveModel(Composite.class, include, context);
                    if (!resolved.isUnresolved()) {
                        if ((composite.isLocal() && resolved.isLocal()) || (!composite.isLocal() && !resolved.isLocal())) {
                            composite.getIncludes().set(i, resolved);
                        } else {
                            ContributionResolveException ce =
                                new ContributionResolveException("[ASM60041] Error: Composite " + composite.getName()
                                    + " can only include another composite with the identical @local attribute value");
                            error(monitor, "ContributionResolveException", include, ce);
                        }
                    } else {
                        ContributionResolveException ce =
                            new ContributionResolveException("[ASM60042] Error: Composite " + include.getName()
                                + " is not a valid composite within the domain");
                        error(monitor, "ContributionResolveException", include, ce);
                    }
                }
            }
View Full Code Here

                        resource = new URL(new URL(parent.getLocation()), implementation.getLocation());

                        implementation.setLocationURL(resource);

                    } catch (MalformedURLException e) {
                        ContributionResolveException ce = new ContributionResolveException(e);
                        error(context.getMonitor(), "ContributionResolveException", resolver, ce);
                    }
                }
            } else {
                try {
                    implementation.setLocationURL(new URL(resolved.getLocation()));
                } catch (MalformedURLException e) {
                    ContributionResolveException ce = new ContributionResolveException(e);
                    error(context.getMonitor(), "ContributionResolveException", resolver, ce);
                }
            }

            //introspect implementation
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

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.