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

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


       
        try {
            Document value = readPropertyValue(reader, prop.getXSDType());
            prop.setValue(value);
        } catch (ParserConfigurationException e) {
            throw new ContributionReadException(e);
        }
    }
View Full Code Here


                }
            }
           
            return scaDefns;
        } catch (XMLStreamException e) {
            throw new ContributionReadException(e);
        } catch (IOException e) {
            throw new ContributionReadException(e);
        } finally {
       
            try {
                if (urlStream != null) {
                    urlStream.close();
View Full Code Here

                }
            }
           
            return implementation;
        } catch (XMLStreamException e) {
            throw new ContributionReadException(e);
        }
    }
View Full Code Here

        File directory = directory(contributionURL);
        File file = new File(directory, artifact);
        try {
            return file.toURI().toURL();
        } catch (MalformedURLException e) {
            throw new ContributionReadException(e);
        }
    }
View Full Code Here

        File directory = directory(contributionURL);
        List<String> artifacts = new ArrayList<String>();
        try {
            traverse(artifacts, directory, directory);
        } catch (IOException e) {
            throw new ContributionReadException(e);
        }
        return artifacts;
    }
View Full Code Here

    private static File directory(URL url) throws ContributionReadException {
        File file;
        try {
            file = new File(url.toURI());
        } catch (URISyntaxException e) {
            throw new ContributionReadException(e);
        }
        if (!file.exists() || !file.isDirectory()) {
            throw new ContributionReadException(url.toString());
        }
        return file;
    }
View Full Code Here

            } else {
                url = new URL("jar:" + contributionURL.toExternalForm() + "!/" + artifact);
            }
            return url;
        } catch (MalformedURLException e) {
            throw new ContributionReadException(e);
        }
    }
View Full Code Here

               
            } finally {
                jar.close();
            }
        } catch (IOException e) {
            throw new ContributionReadException(e);
        }
    }
View Full Code Here

                            if (contract != null) {
                                contract
                                        .setInterfaceContract((InterfaceContract) extension);
                            } else {
                                if (name.getNamespaceURI().equals(SCA10_NS)) {
                                    throw new ContributionReadException(
                                            "Unexpected <interface> element found. It should appear inside a <service> or <reference> element");
                                } else {
                                    composite.getExtensions().add(extension);
                                }
                            }

                        } else if (extension instanceof Binding) {
                            // <service><binding> and
                            // <reference><binding>
                            if (callback != null) {
                                callback.getBindings().add((Binding) extension);
                            } else {
                                if (contract != null) {
                                    contract.getBindings().add(
                                            (Binding) extension);
                                } else {
                                    if (name.getNamespaceURI().equals(SCA10_NS)) {
                                        throw new ContributionReadException(
                                                "Unexpected <binding> element found. It should appear inside a <service> or <reference> element");
                                    } else {
                                        composite.getExtensions()
                                                .add(extension);
                                    }
                                }
                            }

                        } else if (extension instanceof Implementation) {

                            // <component><implementation>
                            if (component != null) {
                                component
                                        .setImplementation((Implementation) extension);
                            } else {
                                if (name.getNamespaceURI().equals(SCA10_NS)) {
                                    throw new ContributionReadException(
                                            "Unexpected <implementation> element found. It should appear inside a <component> element");
                                } else {
                                    composite.getExtensions().add(extension);
                                }
                            }
View Full Code Here

        throws ContributionReadException, XMLStreamException {

        /* Read the location attribute for the xquery implementation  */
        String xqueryLocation = reader.getAttributeValue(null, LOCATION);
        if (xqueryLocation == null) {
            throw new ContributionReadException(MSG_LOCATION_MISSING);
        }
        /* Create the XQuery implementation and set the location into it */
        XQueryImplementation xqueryImplementation =
            XQueryImplementationFactory.INSTANCE.createXQueryImplementation();
        xqueryImplementation.setLocation(xqueryLocation);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.contribution.service.ContributionReadException

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.