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

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


     *
     */
    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


                    // 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.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

                wsdlDefinition.setNamespace(wsdlInterface.getName().getNamespaceURI());
                WSDLDefinition resolved = null;
                try {
                    resolved = resolver.resolveModel(WSDLDefinition.class, wsdlDefinition);
                } catch (ContributionRuntimeException e) {
                    ContributionResolveException ce = new ContributionResolveException(e.getCause());
                    error("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 validate
                      // the input/output messages.
                      List<OperationImpl> operations = portType.getElement().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);
                        }
                      }
                     
                        // Introspect the WSDL portType and add the resulting
                        // WSDLInterface to the resolver
                        try {
                            wsdlDefinition.setDefinition(portType.getDefinition());
                            wsdlInterface = wsdlFactory.createWSDLInterface(portType.getElement(), wsdlDefinition, resolver);
                            wsdlInterface.setWsdlDefinition(wsdlDefinition);
                            resolver.addModel(wsdlInterface);
                        } catch (ContributionRuntimeException e) {
                            ContributionResolveException ce = new ContributionResolveException(e.getCause());
                            error("ContributionResolveException", wsdlDefinition, ce);
                        } catch (InvalidInterfaceException e) {
                          ContributionResolveException ce = new ContributionResolveException(e);
                          error("ContributionResolveException", wsdlDefinition, ce);
                            //throw ce;
                        }                       
                    }
                    else {
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

                try {
                   artifactProcessor.resolve(model, contributionResolver);
                } catch (ContributionResolveException e) {
                    throw e;
                } catch (Exception e) {
                    throw new ContributionResolveException(e);
                }
            }
        }

        // Resolve deployable composites
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("ContributionResolveException", resolver, ce);
                    //throw ce;
                }
            } else {
                error("FailToResolveClass", resolver, factoryName);
View Full Code Here

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

                try {
                    wsdlInterface = introspector.introspect(portType,
                                                                          wsdlDefinition.getInlinedSchemas(),
                                                                          resolver);
                } catch (InvalidInterfaceException e) {
                    throw new ContributionResolveException(e);
                }
                interfaceContract.setInterface(wsdlInterface);
                model.setBindingInterfaceContract(interfaceContract);
            }
        }
View Full Code Here

     *
     */
    public Map<String, JavaElementImpl> 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
            classIntrospector.introspect( beanClass, javaImplementation);
           
            // 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.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.