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

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


        Artifact artifact = contributionFactory.createArtifact();
        artifact.setURI(xqueryImplementation.getLocation());
      artifact = resolver.resolveModel(Artifact.class, artifact);
      if (artifact.getLocation() == null) {
            throw new ContributionResolveException("Could not locate file: " + xqueryImplementation.getLocation());
        }
      xqueryImplementation.setLocationURL(artifact.getLocation());

        XQueryIntrospector introspector = new XQueryIntrospector(assemblyFactory, javaFactory);
View Full Code Here


        String xqExpression = null;
        try {
            URL url = new URL(xqueryImplementation.getLocationURL());
            xqExpression = loadXQExpression(url);
        } catch (FileNotFoundException e) {
            throw new ContributionResolveException(e);
        } catch (IOException e) {
            throw new ContributionResolveException(e);
        }

        if (xqExpression == null) {
            return false;
        }

        xqueryImplementation.setXqExpression(xqExpression);

        xqExpression += "\r\n<dummy></dummy>";

        Configuration config = new Configuration();
        StaticQueryContext sqc = new StaticQueryContext(config);
        XQueryExpression exp = null;
        try {
            exp = sqc.compileQuery(xqExpression);
        } catch (XPathException e) {
            throw new ContributionResolveException(e);
        }

        if (exp == null) {
            return false;
        }
        xqueryImplementation.getCompiledExpressionsCache().put(xqExpression, exp);

        try {
            introspectServicesAndReferences(xqueryImplementation, exp, resolver);
        } catch (ClassNotFoundException e) {
            throw new ContributionResolveException(e);
        } catch (InvalidInterfaceException e) {
            throw new ContributionResolveException(e);
        }

        fillExpressionExtensions(xqueryImplementation);

        return true;
View Full Code Here

            try {
                Artifact artifact = contributionFactory.createArtifact();
                artifact.setURI(location);
                artifact = resolver.resolveModel(Artifact.class, artifact);
                if (artifact.getLocation() == null) {
                    ContributionResolveException loaderException =
                        new ContributionResolveException("Fail to resolve location: " + location);
                    throw loaderException;
                }

                String wsdlURL = artifact.getLocation();
                URLConnection connection = new URL(wsdlURL).openConnection();
                connection.setUseCaches(false);
                InputStream xsdInputStream = connection.getInputStream();
                try {
                    XSDHelper xsdHelper = importSDO.getHelperContext().getXSDHelper();
                    xsdHelper.define(xsdInputStream, wsdlURL);
                } finally {
                    xsdInputStream.close();
                }
            } catch (IOException e) {
                throw new ContributionResolveException(e);
            }
            importSDO.setUnresolved(false);
        }
    }
View Full Code Here

                            }
                        }
                    }
                }
            } catch ( PolicyValidationException e ) {
                throw new ContributionResolveException("PolicyValidation exceptions when processing service/reference '"
                                                       + contract.getName() + "' in '" + parentName + "'");
            }
        }
    }
View Full Code Here

        String factoryName = importSDO.getFactoryClassName();
        if (factoryName != null) {
            ClassReference reference = new ClassReference(factoryName);
            ClassReference resolved = resolver.resolveModel(ClassReference.class, reference);
            if (resolved == null || resolved.isUnresolved()) {
                ContributionResolveException loaderException =
                    new ContributionResolveException("Fail to resolve class: " + factoryName);
                throw loaderException;
            }
            try {
                Class<?> factoryClass = resolved.getJavaClass();
                register(factoryClass, importSDO.getHelperContext());
            } catch (Exception e) {
                throw new ContributionResolveException(e);
            }
            importSDO.setUnresolved(false);
        }
    }
View Full Code Here

    public void resolve(BPELImplementation impl, ModelResolver resolver) throws ContributionResolveException {
        if( impl != null && impl.isUnresolved()) {
            BPELProcessDefinition processDefinition = resolveBPELProcessDefinition(impl, resolver);
            if(processDefinition.isUnresolved()) {
                throw new ContributionResolveException("Can't find BPEL Process : " + processDefinition.getName());
            }
           
            impl.setProcessDefinition(processDefinition);
           
            //resolve component type
View Full Code Here

                //introspect implementation
                WidgetImplementationIntrospector widgetIntrospector = new WidgetImplementationIntrospector(assemblyFactory, implementation);
                widgetIntrospector.introspectImplementation();

            } catch (IOException e) {
                throw new ContributionResolveException(e);
            }
        }
    }
View Full Code Here

                if (providedIntent.isUnresolved()) {
                    Intent resolvedProvidedIntent = resolver.resolveModel(Intent.class, providedIntent);
                    if (resolvedProvidedIntent != null) {
                        providedIntents.add(resolvedProvidedIntent);
                    } else {
                        throw new ContributionResolveException("Provided Intent - " + providedIntent
                            + " not found for PolicySet "
                            + policySet);

                    }
                } else {
View Full Code Here

                Intent resolvedMappedIntent = resolver.resolveModel(Intent.class, mappedIntent);
   
                if (resolvedMappedIntent != null) {
                    mappedPolicies.put(resolvedMappedIntent, entry.getValue());
                } else {
                    throw new ContributionResolveException("Mapped Intent - " + mappedIntent
                        + " not found for PolicySet "
                        + policySet);
   
                }
            } else {
View Full Code Here

            if (referredPolicySet.isUnresolved()) {
                PolicySet resolvedReferredPolicySet = resolver.resolveModel(PolicySet.class, referredPolicySet);
                if (resolvedReferredPolicySet != null) {
                    referredPolicySets.add(resolvedReferredPolicySet);
                } else {
                    throw new ContributionResolveException("Referred PolicySet - " + referredPolicySet
                        + "not found for PolicySet - "
                        + policySet);
                }
            } else {
                referredPolicySets.add(referredPolicySet);
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.