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

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


          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


        SpringXMLComponentTypeLoader springLoader = new SpringXMLComponentTypeLoader(registry);
        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();
        // Set the type to be implementation.spring to avoid heuristic introspection
        javaImplementation.setType(SpringImplementation.TYPE);

        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

        return javaImplementation;

    } // end method introspectBean
View Full Code Here

                        count++;
                    } // end for

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

                            // Introspect the WSDL portType and add the resulting WSDLInterface to the resolver
                            try {
                                wsdlInterface = wsdlFactory.createWSDLInterface(wsdlPortType.getElement(), theWSDL, resolver, context.getMonitor());
                                wsdlInterface.setWsdlDefinition(theWSDL);
                            } catch (InvalidInterfaceException e) {
                                ContributionResolveException ce =
                                  new ContributionResolveException("Unable to create WSDLInterface for portType " + portType.getQName(),e);
                                error(context.getMonitor(), "ContributionResolveException", resolver, ce);
                                throw ce;
                            } // end try
                            resolver.addModel(wsdlInterface, context);
                            theInterfaces.add(wsdlInterface);
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

                WSDLInterface newWSDLInterface = wsdlFactory.createWSDLInterface(portType, wsdlDefinition, resolver, monitor);
                newWSDLInterface.getRequiredIntents().addAll(wsdlInterface.getRequiredIntents());
                newWSDLInterface.getPolicySets().addAll(wsdlInterface.getPolicySets());
                wsdlInterface = newWSDLInterface;
            } catch (InvalidInterfaceException e) {
                ContributionResolveException ce = new ContributionResolveException("Invalid interface when resolving " +
                                                                                    portType.toString(), e);
                error(monitor, "ContributionResolveException", wsdlFactory, ce);
            }   
           
            wsdlInterface.setWsdlDefinition(wsdlDefinition);
View Full Code Here

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

                    implementation.setUnresolved(false);
                } catch (IOException e) {
                  ContributionResolveException ce = new ContributionResolveException(e);
                  error(context.getMonitor(), "ContributionResolveException", resolver, ce);
                    //throw ce;
                }
            } else {
                error(context.getMonitor(), "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(monitor, "ContributionResolveException", javaFactory, ce);
              //throw ce;
              return;
          }

          checkNoStaticAnnotations(monitor, javaImplementation);
         
          javaImplementation.setUnresolved(false);
          mergeComponentType(resolver, javaImplementation, context);

          // FIXME the introspector should always create at least one service
          if (javaImplementation.getServices().isEmpty()) {
              javaImplementation.getServices().add(assemblyFactory.createService());
          }
        } catch (Throwable e) {
            throw new ContributionResolveException("Resolving Java implementation: " + javaImplementation.getName()
                + ", "
                + e.getMessage(), e);
        } // end try
    } // end method
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.