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

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


          javaInterfaceContract.setInterface(javaInterface);
         
          JavaInterface javaCallbackInterface = resolveJavaInterface((JavaInterface)javaInterfaceContract.getCallbackInterface(), resolver);
          javaInterfaceContract.setCallbackInterface(javaCallbackInterface);
        } catch (Exception e) {
          throw new ContributionResolveException( "Resolving Java Interface " + javaInterfaceContract.getInterface().toString(), e );
        } // end try
    }
View Full Code Here


        try {
            if (introspect(impl, resolver, 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);
                    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

            Object model = artifact.getModel();
            if (model != null) {
                try {
                   artifactProcessor.resolve(model, contributionResolver);
                } catch (Throwable e) {
                    throw new ContributionResolveException(e);
                }
            }
        }

        // Resolve deployable composites
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

                            wsdlDefinition.setDefinition(portType.getDefinition());
                            wsdlInterface = wsdlFactory.createWSDLInterface(portType.getElement(), wsdlDefinition, resolver);
                            wsdlInterface.setWsdlDefinition(wsdlDefinition);
                            resolver.addModel(wsdlInterface);
                        } catch (InvalidInterfaceException e) {
                          ContributionResolveException ce = new ContributionResolveException("Invalid interface when resolving " +
                                                                                          portType.toString(), e);
                          error("ContributionResolveException", wsdlFactory, ce);
                            //throw ce;
                        }                       
                    }
                    else {
                      warning("WsdlInterfaceDoesNotMatch", wsdlDefinition, wsdlInterface.getName());
                    } // end if
                } else {
                  // If we get here, the WSDLDefinition is unresolved...
                  ContributionResolveException ce = new ContributionResolveException("WSDLDefinition unresolved " +
                      wsdlInterface.getName().getNamespaceURI() );
                    error("ContributionResolveException", wsdlFactory, ce);
                }// end if
            } // end if
        } // end if
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("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());
                                    imp.setDefinition(resolved.getDefinition());
                                    if (!model.getImportedDefinitions().contains(resolved)) {
                                        model.getImportedDefinitions().add(resolved);
                                    }
                                } catch (Exception e) {
                                  ContributionResolveException ce = new ContributionResolveException(e);
                                  error("ContributionResolveException", resolver, ce);
                                    //throw ce;
                                }
                            }
                        }
View Full Code Here

          if (composite != null)
            extensionProcessor.resolve(composite, resolver);
      } 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

                                } // end if
                            } // end for

                            if (count == 0) {
                                error("PartnerLinkTypeNoRoles", theElement, pLinkElement.getName());
                                throw new ContributionResolveException("partnerLinkType " + pLinkElement.getName() + " has no Roles defined");
                            } else
                                thePLinks.add(pLinkElement);
                        } // end if

                    } // end for
View Full Code Here

                            try {
                                theWSDL.setDefinition(wsdlPortType.getDefinition());
                                wsdlInterface = WSDLfactory.createWSDLInterface(wsdlPortType.getElement(), theWSDL, resolver);
                                wsdlInterface.setWsdlDefinition(theWSDL);
                            } catch (InvalidInterfaceException e) {
                                ContributionResolveException ce = new ContributionResolveException(e);
                                error("ContributionResolveException", resolver, ce);
                                throw ce;
                            } // end try
                            resolver.addModel(wsdlInterface);
                            theInterfaces.add(wsdlInterface);
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.