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

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


                    Composite resolved = resolver.resolveModel(Composite.class, include, context);
                    if (!resolved.isUnresolved()) {
                        if ((composite.isLocal() && resolved.isLocal()) || (!composite.isLocal() && !resolved.isLocal())) {
                            composite.getIncludes().set(i, resolved);
                        } else {
                            ContributionResolveException ce =
                                new ContributionResolveException("[ASM60041] Error: Composite " + composite.getName()
                                    + " can only include another composite with the identical @local attribute value");
                            error(monitor, "ContributionResolveException", include, ce);
                        }
                    } else {
                        ContributionResolveException ce =
                            new ContributionResolveException("[ASM60042] Error: Composite " + include.getName()
                                + " is not a valid composite within the domain");
                        error(monitor, "ContributionResolveException", include, ce);
                    }
                }
            }
View Full Code Here


                    // cache the contribution that was used to resolve the Java interface
                    // in case we need it to reolve a referenced WSDL file
                    javaInterface.setContributionContainingClass(classReference.getContributionContainingClass());
               
                } catch (InvalidInterfaceException e) {
                  ContributionResolveException ce = new ContributionResolveException("Resolving Java interface " + javaInterface.getName(), e);
                  //error("ContributionResolveException", javaFactory, ce);
                  error(monitor, "InvalidInterfaceException", javaFactory, e);
                    return javaInterface;
                  //throw ce;
                } catch ( Exception e ) {
                  throw new ContributionResolveException( "Resolving Java interface " + javaInterface.getName(), e );
                } // end try

                // Cache the resolved interface
                javaInterface.setUnresolved(false);
                resolver.addModel(javaInterface, context);
View Full Code Here

            postJAXWSProcessorResolve(javaInterfaceContract, resolver, context);
         
          checkForbiddenAnnotations(monitor, javaInterfaceContract);
         
        } catch (Exception e) {
            throw new ContributionResolveException("Resolving Java Interface " + javaInterfaceContract.getInterface()
                .toString(), 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

                        String message = context.getMonitor().getMessageString(ContributionContentProcessor.class.getName(),
                                                                               "contribution-xml-validation-messages",
                                                                               "ExportedPackageNotFound");
                        message = message.replace("{0}", packageName);

                        throw new ContributionResolveException(message);
                    }
                }
            }

            // Resolve all artifact models
            for (Artifact artifact : contribution.getArtifacts()) {
                Object model = artifact.getModel();
                if (model != null) {
                    Artifact oldArtifact = context.setArtifact(artifact);
                    try {
                        artifactProcessor.resolve(model, contributionResolver, context);
                    } catch (Throwable e) {
                        throw new ContributionResolveException(e);
                    } finally {
                        context.setArtifact(oldArtifact);
                    }
                }
            }
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);
         
          postJAXWSProcessorResolve(resolver, javaImplementation, context);
         
          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) {
           
            String message = context.getMonitor().getMessageString(JavaImplementationProcessor.class.getName(),
                                                                   "impl-javaxml-validation-messages",
                                                                   "ResolvingJavaImplementation");
            message = message.replace("{0}", javaImplementation.getName());
            message = message.replace("{1}", e.getMessage());

            throw new ContributionResolveException(message, e);
        } // end try
    } // end method
View Full Code Here

                        } else {
                            String message = context.getMonitor().getMessageString(CompositeProcessor.class.getName(),
                                                                                   Messages.RESOURCE_BUNDLE,
                                                                                   "LocalAttibuteMissmatch");
                            message = message.replace("{0}", composite.getName().toString());
                            ContributionResolveException ce = new ContributionResolveException(message);
                            error(monitor, "ContributionResolveException", include, ce);
                        }
                    } else {
                        String message = context.getMonitor().getMessageString(CompositeProcessor.class.getName(),
                                                                               Messages.RESOURCE_BUNDLE,
                                                                               "CompositeNotFound");
                        message = message.replace("{0}", include.getName().toString());
                        ContributionResolveException ce = new ContributionResolveException(message);
                        error(monitor, "ContributionResolveException", include, ce);
                    }
                }
            }
View Full Code Here

        String newMessage = context.getMonitor().getMessageString(CompositeDocumentProcessor.class.getName(),
                                                                  Messages.RESOURCE_BUNDLE,
                                                                      "ProcessingComposite") +
                                " " +
                                composite.getName() + ": " + e.getMessage();
        throw new ContributionResolveException( newMessage, e );
      } // end try
    }
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

              try {
                    Class<?> factoryClass = resolved.getJavaClass();
                    register(factoryClass, importSDO.getHelperContext());
                    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

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.