Package org.apache.tuscany.spi.loader

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


        if (name == null) {
            // allow "class" as well as seems to be a common mistake
            name = reader.getAttributeValue(null, "class");
        }
        if (name == null) {
            throw new InvalidValueException("interface name not supplied");
        }
        Class<?> interfaceClass = LoaderUtil.loadClass(name, deploymentContext.getClassLoader());

        name = reader.getAttributeValue(null, "callbackInterface");
        Class<?> callbackClass = (name != null) ? LoaderUtil.loadClass(name, deploymentContext.getClassLoader()) : null;
View Full Code Here


                         DeploymentContext deploymentContext) throws XMLStreamException, LoaderException {
        assert DATA_BINDING.equals(reader.getName());
        String name = reader.getAttributeValue(null, "name");
        LoaderUtil.skipToEndElement(reader);
        if (name == null) {
            throw new InvalidValueException("The 'name' attrbiute is required");
        }
        DataType dataType = new DataType<Class>(name, Object.class, Object.class);
        return dataType;
    }
View Full Code Here

            DeploymentContext deploymentContext) throws XMLStreamException, LoaderException {
        assert INTERFACE_WSDL.equals(reader.getName());

        String interfaceURI = reader.getAttributeValue(null, "interface");
        if (interfaceURI == null) {
            throw new InvalidValueException("interface");
        }

        String callbackURI = reader.getAttributeValue(null, "callbackInterface");
        String wsdlLocation = reader.getAttributeValue(WSDLI, WSDLI_LOCATION);
       
View Full Code Here

                    }
                    if (source.charAt(0) == '$') {
                        String name = source.substring(1, index);
                        Property<?> compositeProp = parent.getProperties().get(name);
                        if (compositeProp == null) {
                            InvalidValueException ex =
                                new InvalidValueException(
                                                          "The 'source' cannot be resolved to a composite property");
                            ex.addContextName(source);
                            throw ex;
                        }
                        Document document = compositeProp.getDefaultValue();
                        // Adding /value because the document root is "value"
                        String path = source.substring(index);
                        String xpath = null;
                        if ("/".equals(path)) {
                            // trailing / is not legal for xpath
                            xpath = "/value";
                        } else {
                            xpath = "/value" + path;
                        }

                        // FIXME: How to deal with namespaces?
                        node = evaluate(null, document, xpath);
                        propValue.setValue(node);
                        Property<?> prop =
                            (Property<?>)componentDefinition.getImplementation().getComponentType()
                                .getProperties().get(propValue.getName());
                        propValue
                            .setValueFactory(new SimplePropertyObjectFactory(prop, propValue.getValue()));
                    } else {
                        InvalidValueException ex =
                            new InvalidValueException("The 'source' has an invalid value");
                        ex.addContextName(source);
                        throw ex;
                    }
                } catch (Exception e) {
                    throw new LoaderException(e);
                }
View Full Code Here

        impl.setName(name);
        if (scdlLocation != null) {
            try {
                impl.setScdlLocation(new URL(deploymentContext.getScdlLocation(), scdlLocation));
            } catch (MalformedURLException e) {
                InvalidValueException ive = new InvalidValueException(scdlLocation, e);
                ive.setIdentifier(name);
                throw ive;
            }
            impl.setClassLoader(deploymentContext.getClassLoader());
        } else if (jarLocation != null) {
            URL jarUrl;
            try {
                jarUrl = new URL(deploymentContext.getScdlLocation(), jarLocation);
            } catch (MalformedURLException e) {
                InvalidValueException ive = new InvalidValueException(jarLocation, e);
                ive.setIdentifier(name);
                throw ive;
            }
            try {
                impl.setScdlLocation(new URL("jar:" + jarUrl.toExternalForm() + "!/META-INF/sca/default.scdl"));
            } catch (MalformedURLException e) {
View Full Code Here

                    componentDefinition.setInitLevel(0);
                } else {
                    try {
                        componentDefinition.setInitLevel(Integer.valueOf(initLevel));
                    } catch (NumberFormatException e) {
                        InvalidValueException ive = new InvalidValueException(initLevel, e);
                        ive.setIdentifier("initValue");
                        ive.addContextName(name);
                        throw ive;
                    }
                }
            }
View Full Code Here

TOP

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

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.