Package org.apache.tuscany.spi.loader

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


        String host = reader.getAttributeValue(null, "host");
        int port;
        try {
            port = Integer.parseInt(reader.getAttributeValue(null, "port"));
        } catch (NumberFormatException e) {
            throw new LoaderException("Invalid port specified", e);
        }
        return new TestSocketBinding(host, port);
    }
View Full Code Here


                Class serviceInterface = Class.forName(serviceTypeName, true, deploymentContext.getClassLoader());
                componentType.addServiceType(serviceName, serviceInterface);
                //ServiceDefinition service = createService(serviceInterface);
                //componentType.getServices().put(serviceName, service);
            } catch (ClassNotFoundException e) {
                throw new LoaderException(e);
            }
        }
        // if no service tags are specified, expose all beans
        componentType.setExposeAllBeans(componentType.getServiceTypes().isEmpty());
        implementation.setComponentType(componentType);
View Full Code Here

                        BoundServiceDefinition service =
                            (BoundServiceDefinition) registry.load(parent, reader, deploymentContext);
                        if (!type.isExposeAllBeans()) {
                            String name = service.getName();
                            if (!type.getServiceTypes().containsKey(name)) {
                                LoaderException e = new LoaderException("No service defined in Spring context for ");
                                e.setIdentifier(name);
                                throw e;
                            }
                        }
                        type.getDeclaredServices().put(service.getName(), service);
                    } else if (REFERENCE_ELEMENT.equals(qname)) {
View Full Code Here

                appXmlFile = new File(locationFile, APPLICATION_CONTEXT);
                if (appXmlFile.exists()) {
                    return new UrlResource(appXmlFile.toURL());
                }
            } catch (IOException e) {
                throw new LoaderException("Error reading manifest " + manifestFile);
            }
        } else {
            try {
                JarFile jf = new JarFile(locationFile);
                JarEntry je;
View Full Code Here

                              0,
                              count);
            }
            return source.toString();
        } catch (IOException e) {
            LoaderException le = new LoaderException(e);
            le.setIdentifier(resource);
            throw le;
        } finally {
            try {
                is.close();
            } catch (IOException e) {
View Full Code Here

        }
        JavaServiceContract serviceContract;
        try {
            serviceContract = interfaceRegsitry.introspect(interfaceClass, callbackClass);
        } catch (InvalidServiceContractException e) {
            LoaderException le = new LoaderException(e);
            le.setIdentifier(interfaceClass.getName());
            throw le;
        }

        // Set databinding from the SCDL extension <databinding>
        DataType<?> dataType = (DataType<?>) extensions.get(DataType.class);
View Full Code Here

    private CompositeComponent composite;

    public void bootRuntime(URL systemScdl, ClassLoader systemClassLoader, MonitorFactory monitor)
        throws TuscanyException {
        if (systemScdl == null) {
            throw new LoaderException("Null system SCDL URL");
        }

        XMLInputFactory xmlFactory = XMLInputFactory.newInstance("javax.xml.stream.XMLInputFactory", systemClassLoader);
        Bootstrapper bootstrapper = new DefaultBootstrapper(monitor, xmlFactory);
        Deployer bootDeployer = bootstrapper.createDeployer();
View Full Code Here

                Thread.currentThread().setContextClassLoader(cl);
                Class<?> factoryClass = cl.loadClass(factoryName);
                // FIXME: We require the SDO to provide an API to register static types in a given TypeHelper
                SDOUtil.registerStaticTypes(factoryClass);
            } catch (ClassNotFoundException e) {
                throw new LoaderException(e.getMessage(), e);
            } finally {
                Thread.currentThread().setContextClassLoader(oldCL);
            }
        }
    }
View Full Code Here

    @Deprecated
    public CompositeComponent bootApplication(String name, URL appScdl) throws TuscanyException {
        ClassLoader applicationLoader = getApplicationLoader();

        if (appScdl == null) {
            throw new LoaderException("No application scdl found");
        }

        // create a ComponentDefinition to represent the component we are going to deploy
        CompositeImplementation impl = new CompositeImplementation();
        impl.setScdlLocation(appScdl);
View Full Code Here

                if (uri.isAbsolute()) {
                    wsdlURL = uri.toURL();
                }
                wsdlURL = deploymentContext.getClassLoader().getResource(location);
                if (null == wsdlURL) {
                    LoaderException loaderException = new LoaderException("WSDL location error");
                    loaderException.setResourceURI(location);
                    throw loaderException;
                }
                InputStream xsdInputStream = wsdlURL.openStream();
                try {
                    XSDHelper xsdHelper = SDOUtil.createXSDHelper(typeHelper);
                    xsdHelper.define(xsdInputStream, wsdlURL.toExternalForm());
                } finally {
                    xsdInputStream.close();
                }
            } catch (IOException e) {
                LoaderException sfe = new LoaderException(e.getMessage());
                sfe.setResourceURI(location);
                throw sfe;
            }
        }
    }
View Full Code Here

TOP

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

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.