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

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


                                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


                            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

            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) {
                  try {
                     artifactProcessor.resolve(model, contributionResolver, context);
                  } catch (Throwable e) {
                      throw new ContributionResolveException(e);
                  }
              }
          }
 
          // Resolve deployable composites
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("Resolving Java interface " + javaInterface.getName(), e);
                  //error("ContributionResolveException", javaFactory, ce);
                  error(monitor, "InvalidInterfaceException", javaFactory, e);
                    return javaInterface;
                  //throw ce;
                } catch ( Exception e ) {
                  throw new ContributionResolveException( "Resolving Java interface " + javaInterface.getName(), e );
                } // end try

                // Cache the resolved interface
                javaInterface.setUnresolved(false);
                resolver.addModel(javaInterface, context);
View Full Code Here

            javaInterfaceContract.setCallbackInterface(javaCallbackInterface);
         
          checkForbiddenAnnotations(monitor, javaInterfaceContract);
         
        } catch (Exception e) {
            throw new ContributionResolveException("Resolving Java Interface " + javaInterfaceContract.getInterface()
                .toString(), e);
        } // end try
    }
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

          if (composite != null)
            extensionProcessor.resolve(composite, resolver, context);
      } catch (Throwable e ) {
        // Add information about which composite was being processed when the exception occurred
        String newMessage = "Processing composite " + composite.getName() + ": " + e.getMessage();
        throw new ContributionResolveException( newMessage, e );
      } // end try
    }
View Full Code Here

            new SpringXMLComponentTypeLoader(registry, monitor);
        try {
            // Load the Spring Implementation information from its application context file...
            springLoader.load(springImplementation, resolver, context);
        } catch (ContributionReadException e) {
          ContributionResolveException ce = new ContributionResolveException(e);
          error(monitor, "ContributionResolveException", resolver, ce);
            throw ce;
        }

        ComponentType ct = springImplementation.getComponentType();
View Full Code Here

     *
     */
    public JavaImplementation introspectBean(Class<?> beanClass, ComponentType componentType) throws ContributionResolveException
    {
        if (componentType == null)
            throw new ContributionResolveException("Introspect Spring bean: supplied componentType is null");

        // Create a Java implementation ready for the introspection
        JavaImplementation javaImplementation = javaImplementationFactory.createJavaImplementation();

        try {
            // Introspect the bean...the results of the introspection are placed into the Java implementation
            javaImplementationFactory.createJavaImplementation(javaImplementation, beanClass);

            // Extract the services, references & properties found through introspection
            // put the services, references and properties into the component type
            componentType.getServices().addAll(javaImplementation.getServices());
            componentType.getReferences().addAll(javaImplementation.getReferences());
            componentType.getProperties().addAll(javaImplementation.getProperties());
           
        } catch (IntrospectionException e) {
            throw new ContributionResolveException(e);
        } // end try

        /* List<Service> services = javaImplementation.getServices();
        for (Service service : services) {
            String name = service.getName();
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.