Package org.apache.tuscany.spi.component

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


    }

    public Object getServiceInstance() throws TargetException {
        Service service = services.get(0);
        if (service == null) {
            throw new TargetException("Component has no services");
        }
        return service.getServiceInstance();
    }
View Full Code Here


        this.targetName = targetName;
    }

    public Object getTargetService() throws TargetException {
        if (targetWire == null) {
            throw new TargetException("No target wire connected to source wire");
        }
        return interfaze.cast(targetWire.getTargetService());
    }
View Full Code Here

    public Object getTargetService() throws TargetException {
        if (targetWire != null) {
            // optimized, no interceptors or handlers on either end
            return targetWire.getTargetService();
        }
        throw new TargetException("Target wire not optimized");
    }
View Full Code Here

            } else if (Object.class.equals(method.getDeclaringClass())
                && "hashCode".equals(method.getName())) {
                return hashCode();
                // TODO beter hash algorithm
            }
            TargetException e = new TargetException("Operation not configured");
            e.setIdentifier(method.getName());
            throw e;
        }
        OutboundInvocationChain chain = holder.chain;
        TargetInvoker invoker;

        if (holder.cachedInvoker == null) {
            assert chain != null;
            if (chain.getTargetInvoker() == null) {
                TargetException e = new TargetException("No target invoker configured for operation");
                e.setIdentifier(chain.getOperation().getName());
                throw e;
            }
            if (chain.getTargetInvoker().isCacheable()) {
                // clone and store the invoker locally
                holder.cachedInvoker = (TargetInvoker) chain.getTargetInvoker().clone();
View Full Code Here

            } else if (Object.class.equals(method.getDeclaringClass())
                && "hashCode".equals(method.getName())) {
                return hashCode();
                // TODO beter hash algorithm
            }
            TargetException e = new TargetException("Operation not configured");
            e.setIdentifier(method.getName());
            throw e;
        }
        InboundInvocationChain chain = holder.chain;
        TargetInvoker invoker;
        if (holder.cachedInvoker == null) {
            assert chain != null;
            if (chain.getTargetInvoker() == null) {
                TargetException e = new TargetException("No target invoker configured for operation");
                e.setIdentifier(chain.getOperation().getName());
                throw e;
            }
            if (chain.getTargetInvoker().isCacheable()) {
                // clone and store the invoker locally
                holder.cachedInvoker = (TargetInvoker) chain.getTargetInvoker().clone();
View Full Code Here

    public Object getTargetService() throws TargetException {
        if (targetWire != null) {
            // optimized, no interceptors or handlers on either end
            return targetWire.getTargetService();
        }
        throw new TargetException("Target wire not optimized");
    }
View Full Code Here

    public Object invokeTarget(final Object object) throws InvocationTargetException {
        if (bean == null) {
            try {
                bean = springContext.getBean(beanName);
            } catch (BeansException e) {
                throw new TargetException(e);
            }
        }
        try {
            if (object != null && !object.getClass().isArray()) {
                return method.invoke(bean, object);
View Full Code Here

    @SuppressWarnings("unchecked")
    public Object getServiceInstance(String service) throws TargetException {
        InboundWire wire = getInboundWire(service);
        if (wire == null) {
            TargetException e = new TargetException("ServiceDefinition not found"); // TODO better error message
            e.setIdentifier(service);
            throw e;
        }
        return wireService.createProxy(wire);
    }
View Full Code Here

    }

    public Object getServiceInstance(String service) throws TargetException {
        InboundWire wire = getInboundWire(service);
        if (wire == null) {
            TargetException e = new TargetException("ServiceDefinition not found"); // TODO better error message
            e.setIdentifier(service);
            throw e;
        }
        return wireService.createProxy(wire);
    }
View Full Code Here

    public void init(Object instance) throws TargetException {
        if (initInvoker != null) {
            try {
                initInvoker.invokeEvent(instance);
            } catch (ObjectCallbackException e) {
                TargetException t = new TargetException("Error initializing component instance", e);
                t.setIdentifier(getName());
                throw t;
            }
        }
    }
View Full Code Here

TOP

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

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.