Package org.apache.tuscany.spi.component

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


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


    }

    public Object invoke(Object proxy, Operation operation, Object[] args) throws Throwable {
        ChainHolder holder = chains.get(operation);
        if (holder == null) {
            TargetException e = new TargetException("Operation not configured");
            e.setIdentifier(operation.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

        if (serviceInterfaces.size() == 0) {
            return getTargetInstance();
        } else if (serviceInterfaces.size() == 1) {
            return getTargetInstance();
        } else {
            throw new TargetException("Component must have exactly one service");
        }
    }
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

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.