Package org.apache.tuscany.spi.loader

Examples of org.apache.tuscany.spi.loader.MissingResourceException


    public JavaScriptImplementation load(CompositeComponent parent, XMLStreamReader reader, DeploymentContext deploymentContext)
            throws XMLStreamException, LoaderException {

        String script = reader.getAttributeValue(null, "script");
        if (script == null) {
            throw new MissingResourceException("No script supplied");
        }

        ClassLoader cl = deploymentContext.getClassLoader();
        String source = loadSource(cl, script);
View Full Code Here


    }

    protected String loadSource(ClassLoader cl, String resource) throws LoaderException {
        URL url = cl.getResource(resource);
        if (url == null) {
            throw new MissingResourceException(resource);
        }
        InputStream is;
        try {
            is = url.openStream();
        } catch (IOException e) {
            MissingResourceException mre = new MissingResourceException(resource, e);
            mre.setIdentifier(resource);
            throw mre;
        }
        try {
            Reader reader = new InputStreamReader(is, "UTF-8");
            char[] buffer = new char[1024];
View Full Code Here

            artifact.setName(name);
            artifact.setVersion(version);
            artifact.setType("jar");
            artifactRepository.resolve(artifact);
            if (artifact.getUrl() == null) {
                MissingResourceException mre = new MissingResourceException(artifact.toString());
                mre.setIdentifier(name);
                throw mre;
            }
            try {
                impl.setScdlLocation(new URL("jar:" + artifact.getUrl() + "!/META-INF/sca/default.scdl"));
            } catch (MalformedURLException e) {
View Full Code Here

        RubyImplementationLoader mockLoader = new RubyImplementationLoader(registry) {
            protected String loadSource(ClassLoader cl, String resource) throws LoaderException {
                assertSame(classLoader, cl);
                assertEquals("foo.groovy", resource);
                throw new MissingResourceException(resource);
            }
        };
        try {
            mockLoader.load(parent, reader, deploymentContext);
            fail();
View Full Code Here

        JavaScriptImplementationLoader mockLoader = new JavaScriptImplementationLoader(registry) {
            protected String loadSource(ClassLoader cl, String resource) throws LoaderException {
                assertSame(classLoader, cl);
                assertEquals("foo.groovy", resource);
                throw new MissingResourceException(resource);
            }
        };
        try {
            mockLoader.load(parent, reader, deploymentContext);
            fail();
View Full Code Here

                                     DeploymentContext deploymentContext)
        throws XMLStreamException, LoaderException {

        String script = reader.getAttributeValue(null, "script");
        if (script == null) {
            throw new MissingResourceException("No script supplied");
        }
        String source = loadSource(deploymentContext.getClassLoader(), script);

        LoaderUtil.skipToEndElement(reader);
View Full Code Here

    }

    protected String loadSource(ClassLoader cl, String resource) throws LoaderException {
        URL url = cl.getResource(resource);
        if (url == null) {
            throw new MissingResourceException(resource);
        }
        InputStream is;
        try {
            is = url.openStream();
        } catch (IOException e) {
            MissingResourceException mre = new MissingResourceException(resource, e);
            mre.setIdentifier(resource);
            throw mre;
        }
        try {
            Reader reader = new InputStreamReader(is, "UTF-8");
            char[] buffer = new char[1024];
View Full Code Here

TOP

Related Classes of org.apache.tuscany.spi.loader.MissingResourceException

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.