Package org.apache.tuscany.spi.component

Examples of org.apache.tuscany.spi.component.IllegalTargetException


            e.addContextName(getName());
            throw e;
        } else if (context instanceof Service) {
            return context.getServiceInstance();
        } else {
            IllegalTargetException e = new IllegalTargetException("Target must be a service");
            e.setIdentifier(name);
            e.addContextName(getName());
            throw e;
        }
    }
View Full Code Here


            e.addContextName(getName());
            throw e;
        } else if (target instanceof Service) {
            return target.getServiceInstance();
        } else {
            IllegalTargetException e = new IllegalTargetException("Target must be a service");
            e.setIdentifier(name);
            e.addContextName(getName());
            throw e;
        }
    }
View Full Code Here

        if (context != null) {
            try {
                if (context instanceof AtomicComponent || context instanceof Reference || context instanceof Service) {
                    return instanceInterface.cast(context.getServiceInstance());
                } else {
                    IllegalTargetException e = new IllegalTargetException("Autowire target must be a system "
                        + "service, atomic component, or reference");
                    e.setIdentifier(instanceInterface.getName());
                    e.addContextName(getName());
                    throw e;
                }
            } catch (CoreRuntimeException e) {
                e.addContextName(getName());
                throw e;
            }
        } else {
            try {
                if (CompositeComponent.class.isAssignableFrom(instanceInterface)) {
                    return instanceInterface.cast(this);
                }
                // resolve to parent
                if (getParent() == null) {
                    return null;
                }
                return getParent().resolveInstance(instanceInterface);
            } catch (AutowireResolutionException e) {
                e.addContextName(getName());
                throw e;
            }
        }
    }
View Full Code Here

        if (context != null) {
            try {
                if (context instanceof AtomicComponent || context instanceof Reference || context instanceof Service) {
                    return instanceInterface.cast(context.getServiceInstance());
                } else {
                    IllegalTargetException e = new IllegalTargetException("Autowire target must be a system "
                        + "service, atomic component, or reference");
                    e.setIdentifier(instanceInterface.getName());
                    e.addContextName(getName());
                    throw e;
                }
            } catch (CoreRuntimeException e) {
                e.addContextName(getName());
                throw e;
            }
        } else {
            try {
                // resolve to parent
                if (getParent() != null) {
                    return getParent().resolveSystemInstance(instanceInterface);
                } else {
                    return null;
                }
            } catch (AutowireResolutionException e) {
                e.addContextName(getName());
                throw e;
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.spi.component.IllegalTargetException

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.