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

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


                     error(context.getMonitor(), "FailToResolveLocation", resolver, location);
                    //ContributionResolveException loaderException = new ContributionResolveException("Fail to resolve location: " + location);
                    //throw loaderException;
                }               
            } catch (IOException e) {
              ContributionResolveException ce = new ContributionResolveException(e);
              error(context.getMonitor(), "ContributionResolveException", resolver, ce);
                //throw ce;
            }           
        }
    }
View Full Code Here


                wsdlDefinition.setNameOfPortTypeToResolve(wsdlInterface.getName());
                WSDLDefinition resolved = null;
                try {
                    resolved = resolver.resolveModel(WSDLDefinition.class, wsdlDefinition, context);
                } catch (ContributionRuntimeException e) {
                    ContributionResolveException ce = new ContributionResolveException(e.getCause());
                    error(monitor, "ContributionResolveException", wsdlDefinition, 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);
                    WSDLObject<PortType> portType = wsdlDefinition.getWSDLObject(PortType.class, wsdlInterface.getName());
                    if (portType != null) {                       
                        // Introspect the WSDL portType and add the resulting
                        // WSDLInterface to the resolver
                        try {
                            wsdlDefinition.setDefinition(portType.getDefinition());
                            WSDLInterface newWSDLInterface = wsdlFactory.createWSDLInterface(portType.getElement(), wsdlDefinition, resolver, monitor);
                            newWSDLInterface.setWsdlDefinition(wsdlDefinition);
                            newWSDLInterface.getRequiredIntents().addAll(wsdlInterface.getRequiredIntents());
                            newWSDLInterface.getPolicySets().addAll(wsdlInterface.getPolicySets());
                            resolver.addModel(newWSDLInterface, context);
                            wsdlInterface = newWSDLInterface;
                        } catch (InvalidInterfaceException e) {
                            String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(),
                                                                                   "interface-wsdlxml-validation-messages",
                                                                                   "InvalidInterface");
                            message = message.replace("{0}",  portType.toString());

                          ContributionResolveException ce = new ContributionResolveException(message, 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...
                    String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(),
                                                                           "interface-wsdlxml-validation-messages",
                                                                           "WSDLDefinitionUnresolved");
                    message = message.replace("{0}",  wsdlInterface.getName().toString());

                  ContributionResolveException ce = new ContributionResolveException(message);
                    error(monitor, "ContributionResolveException", wsdlFactory, ce);
                } // end if
            } // end if
        } // end if
        return wsdlInterface;
View Full Code Here

                        } catch (InvalidInterfaceException e) {
                            String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(),
                                                                                   "interface-wsdlxml-validation-messages",
                                                                                   "InvalidInterface");
                            message = message.replace("{0}",  portType.toString());
                          ContributionResolveException ce = new ContributionResolveException(message, 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...
                    String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(),
                                                                           "interface-wsdlxml-validation-messages",
                                                                           "WSDLDefinitionUnresolved");
                    message = message.replace("{0}",  wsdlInterface.getName().toString());
                  ContributionResolveException ce = new ContributionResolveException(message);
                    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

            } catch (InvalidInterfaceException e) {
                String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(),
                                        "interface-wsdlxml-validation-messages",
                                        "InvalidInterface");
                message = message.replace("{0}",  portType.toString());
                ContributionResolveException ce = new ContributionResolveException(message, e);
                error(monitor, "ContributionResolveException", wsdlFactory, ce);
            }   
           
            wsdlInterface.setWsdlDefinition(wsdlDefinition);
            wsdlInterfaceContract.setInterface(wsdlInterface);
View Full Code Here

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

        if (resolved != null && !resolved.isUnresolved()) {
            wsdlDefinition.setDefinition(resolved.getDefinition());
View Full Code Here

                    Field field = factoryClass.getField("NAMESPACE_URI");
                    importSDO.setNamespace((String)field.get(null));
                    register(factoryClass, helperContext);
                    importSDO.setUnresolved(false);
                } catch (Exception e) {
                    ContributionResolveException ce = new ContributionResolveException(e);
                    error(context.getMonitor(), "ContributionResolveException", resolver, ce);
                    //throw ce;
                }
            } else {
                error(context.getMonitor(), "FailToResolveClass", resolver, factoryName);
View Full Code Here

                    error(context.getMonitor(), "FailToResolveLocation", resolver, location);
                    //ContributionResolveException loaderException = new ContributionResolveException("Fail to resolve location: " + location);
                    //throw loaderException;
                }
            } catch (IOException e) {
                ContributionResolveException ce = new ContributionResolveException(e);
                error(context.getMonitor(), "ContributionResolveException", resolver, ce);
                //throw ce;
            }
        } else {
            String ns = importSDO.getNamespace();
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

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.