Package org.apache.tuscany.sca.contribution.service

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


                            }
                        }
                    }
                }
            } catch ( PolicyValidationException e ) {
                throw new ContributionResolveException("PolicyValidation exceptions when processing service/reference '"
                                                       + contract.getName() + "' in '" + parentName + "'");
            }
        }
    }
View Full Code Here


                    //java implementation).  This has to be consolidated in to the component.
                    copyPoliciesToComponent(component, implementation, resolver, false);
                   
                    component.setImplementation(implementation);
                } catch ( PolicyValidationException e ) {
                    throw new ContributionResolveException("PolicyValidation exception when processing implementation of component '"
                                                           + component.getName() + "' due to " + e.getMessage(), e);
                }
           
            }
        }
View Full Code Here

                            WSDLDefinition resolved;
                            try {
                                resolved = read(null, uri, uri.toURL());
                                imp.setDefinition(resolved.getDefinition());
                            } catch (Exception e) {
                                throw new ContributionResolveException(e);
                            }
                        } 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());
                                } catch (Exception e) {
                                    throw new ContributionResolveException(e);
                                }
                            }
                        }
                    }
                }
View Full Code Here

                //introspect implementation
                WidgetImplementationIntrospector widgetIntrospector = new WidgetImplementationIntrospector(assemblyFactory, implementation);
                widgetIntrospector.introspectImplementation();

            } catch (IOException e) {
                throw new ContributionResolveException(e);
            }
        }
    }
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

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

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

        wsdlDefinition.setNamespace(model.getNamespace());
        WSDLDefinition resolved = null;
        try {
            resolved = resolver.resolveModel(WSDLDefinition.class, wsdlDefinition);
        } catch (ContributionRuntimeException e) {
            ContributionResolveException ce = new ContributionResolveException(e.getCause());
            error("ContributionResolveException", wsdlDefinition, ce);
            //throw ce;
        }

        if (resolved != null && !resolved.isUnresolved()) {
            wsdlDefinition.setDefinition(resolved.getDefinition());
            wsdlDefinition.setLocation(resolved.getLocation());
            wsdlDefinition.setURI(resolved.getURI());
            wsdlDefinition.getImportedDefinitions().addAll(resolved.getImportedDefinitions());
            wsdlDefinition.getXmlSchemas().addAll(resolved.getXmlSchemas());
            wsdlDefinition.setUnresolved(false);
            model.setDefinition(wsdlDefinition);
            if (model.getBindingName() != null) {
                WSDLObject<Binding> binding = wsdlDefinition.getWSDLObject(Binding.class, model.getBindingName());
                if (binding != null) {
                    wsdlDefinition.setDefinition(binding.getDefinition());
                    model.setBinding(binding.getElement());
                } else {
                  warning("WsdlBindingDoesNotMatch", wsdlDefinition, model.getBindingName());
                }
            }
            if (model.getServiceName() != null) {
                WSDLObject<Service> service = wsdlDefinition.getWSDLObject(Service.class, model.getServiceName());
                if (service != null) {
                    wsdlDefinition.setDefinition(service.getDefinition());
                    model.setService(service.getElement());
                    if (model.getPortName() != null) {
                        Port port = service.getElement().getPort(model.getPortName());
                        if (port != null) {
                            model.setPort(port);
                            model.setBinding(port.getBinding());
                        } else {
                            warning("WsdlPortTypeDoesNotMatch", wsdlDefinition, model.getPortName());
                        }
                    }
                } else {
                  warning("WsdlServiceDoesNotMatch", wsdlDefinition, model.getServiceName());
                }
            }

            PortType portType = getPortType(model);
            if (portType != null) {
              // Introspect the WSDL portType and validate the input/output messages.
              List<OperationImpl> operations = portType.getOperations();
              for (OperationImpl operation : operations) {
                if (operation.getInput() != null && operation.getInput().getMessage() == null) {
                  ContributionResolveException ce = new ContributionResolveException("WSDL binding operation input name " + operation.getInput().getName() + " does not match with PortType Definition");
                        error("ContributionResolveException", wsdlDefinition, ce);
                }
                if (operation.getOutput() != null && operation.getOutput().getMessage() == null) {
                  ContributionResolveException ce = new ContributionResolveException("WSDL binding operation output name " + operation.getOutput().getName() + " does not match with PortType Definition");
                        error("ContributionResolveException", wsdlDefinition, ce);
                }
              }

                WSDLInterfaceContract interfaceContract = wsdlFactory.createWSDLInterfaceContract();
View Full Code Here

        if (resolved.getLocation() != null) {
            try {
                implementation.setLocationURL(new URL(resolved.getLocation()));
                implementation.setUnresolved(false);
            } catch (IOException e) {
              ContributionResolveException ce = new ContributionResolveException(e);
              error("ContributionResolveException", resolver, ce);
                //throw ce;
            }
        } else {
            error("CouldNotResolveLocation", resolver, implementation.getLocation());
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

                      new WidgetImplementationIntrospector(assemblyFactory, implementation);
                    widgetIntrospector.introspectImplementation();

                    implementation.setUnresolved(false);
                } catch (IOException e) {
                  ContributionResolveException ce = new ContributionResolveException(e);
                  error("ContributionResolveException", resolver, ce);
                    //throw ce;
                }
            } else {
                error("CouldNotResolveLocation", resolver, implementation.getLocation());
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.contribution.service.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.