Examples of TargetException


Examples of org.apache.tuscany.core.context.TargetException

        if (cachedTargetInstance != null) {
            if (destroyInvoker != null) {
                try {
                    destroyInvoker.invokeEvent(cachedTargetInstance);
                } catch (ObjectCallbackException e) {
                    TargetException te = new TargetException(e.getCause());
                    te.setIdentifier(getName());
                    throw te;
                }
            }
        }
        lifecycleState = STARTED;
View Full Code Here

Examples of org.apache.tuscany.core.context.TargetException

                    cachedTargetInstance = instance;  // cache the instance
                    return cachedTargetInstance;
                }
            } catch (ObjectCreationException e) {
                lifecycleState = ERROR;
                TargetException te = new TargetException("Error creating component instance", e);
                te.setIdentifier(getName());
                throw te;
            }
        }

    }
View Full Code Here

Examples of org.apache.tuscany.core.context.TargetException

    }

    public Object getInstance(QualifiedName qName) throws TargetException {
        Context context = getContext(qName.getPartName());
        if (context == null) {
            TargetException e = new TargetException("Target not found");
            e.setIdentifier(qName.getQualifiedName());
            throw e;
        }
        return context.getInstance(qName);
    }
View Full Code Here

Examples of org.apache.tuscany.core.context.TargetException

    public Object invokeTarget(Object payload) throws InvocationTargetException {
        if (context == null) {
            InstanceContext iContext = container.getContext(esName);
            if (!(iContext instanceof ExternalServiceContext)) {
                TargetException te = new TargetException("Unexpected target context type");
                te.setIdentifier(iContext.getClass().getName());
                te.addContextName(iContext.getName());
                throw te;
            }
            context = (ExternalServiceContext) iContext;
        }
        ExternalJbiServiceClient client = (ExternalJbiServiceClient) context.getImplementationInstance(true);
View Full Code Here

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

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

        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

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

    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

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

            } 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

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

            } 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

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

    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
TOP
Copyright © 2018 www.massapi.com. 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.