Package org.apache.tuscany.spi.loader

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


                    break;
                case END_ELEMENT:
                    if (SERVICE.equals(reader.getName())) {
                        if (binding != null) {
                            if (target == null) {
                                InvalidReferenceException e = new InvalidReferenceException("No target for service ");
                                e.setIdentifier(name);
                                throw e;
                            }
                            URI targetURI;
                            try {
                                targetURI = new URI(target);
                            } catch (URISyntaxException e) {
                                InvalidReferenceException ire = new InvalidReferenceException(target);
                                ire.setIdentifier(name);
                                throw ire;
                            }

                            // FIXME need a way to specify "remotable" on a service
                            return new BoundServiceDefinition<Binding>(name,
                                                                       serviceContract,
                                                                       false,
                                                                       binding,
                                                                       targetURI);
                        } else if (target != null) {
                            URI targetURI;
                            try {
                                targetURI = new URI(target);
                            } catch (URISyntaxException e) {
                                InvalidReferenceException ire = new InvalidReferenceException(target);
                                ire.setIdentifier(name);
                                throw ire;
                            }
                           
                            return new BindlessServiceDefinition(name, serviceContract, false, targetURI);
                        } else {
View Full Code Here


        String name = reader.getAttributeValue(null, "name");
        String text = reader.getElementText();
        String target = text != null ? text.trim() : null;

        if (name == null || target == null) {
            InvalidReferenceException le = new InvalidReferenceException();
            le.setIdentifier(target);
            throw le;
        }

        ReferenceTarget referenceTarget = new ReferenceTarget();
        referenceTarget.setReferenceName(name);
        try {
            referenceTarget.addTarget(new URI(target));
        } catch (URISyntaxException e) {
            InvalidReferenceException le = new InvalidReferenceException(e);
            le.setIdentifier(target);
            throw le;
        }
        componentDefinition.add(referenceTarget);
    }
View Full Code Here

TOP

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

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.