Package org.apache.tuscany.spi.component

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


    }

    public <T> T locateService(Class<T> serviceInterface, String name) {
        SCAObject target = children.get(name);
        if (target == null) {
            TargetNotFoundException e = new TargetNotFoundException(name);
            e.addContextName(getName());
            throw e;
        }
        return serviceInterface.cast(target.getServiceInstance());
    }
View Full Code Here


    }

    public <T> T locateSystemService(Class<T> serviceInterface, String name) {
        SCAObject object = systemChildren.get(name);
        if (object == null) {
            TargetNotFoundException e = new TargetNotFoundException(name);
            e.addContextName(getName());
            throw e;
        }
        return serviceInterface.cast(object.getServiceInstance());
    }
View Full Code Here

    }

    public Object getServiceInstance(String name) throws TargetException {
        SCAObject context = children.get(name);
        if (context == null) {
            TargetNotFoundException e = new TargetNotFoundException(name);
            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

    }

    public Object getSystemServiceInstance(String name) throws TargetException {
        SCAObject target = systemChildren.get(name);
        if (target == null) {
            TargetNotFoundException e = new TargetNotFoundException(name);
            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

    public Object getTargetService() throws TargetException {
        Class<?> interfaze = serviceContract.getInterfaceClass();
        Object service = component.resolveSystemInstance(interfaze);
        if (service == null && required) {
            TargetNotFoundException e = new TargetNotFoundException("Autowire target not found");
            e.setIdentifier(interfaze.getName());
            throw e;
        }
        return service;
    }
View Full Code Here

    }

    public Object getServiceInstance(String name) throws TargetException {
        InboundWire wire = serviceWires.get(name);
        if (wire == null) {
            TargetNotFoundException e = new TargetNotFoundException(name);
            e.addContextName(getName());
            throw e;
        }
        return wireService.createProxy(wire);
    }
View Full Code Here

TOP

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

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.