Package org.apache.tuscany.core.context

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


    public Object invoke(Object msg) {
        if (msg!=null && msg.getClass().isArray() && Array.getLength(msg) == 1){
            return Array.get(msg,0);
        }else{
            throw new TargetException("This binding only understands operations with a single parameter");
        }
    }
View Full Code Here


                    cachedTargetInstance = 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

                        return (T) o;
                    }
                }
                ctx = ctx.getParent();
            } while (ctx != null);
            TargetException e = new TargetException("Target reference not found");
            e.setIdentifier(targetQualifiedName.getQualifiedName());
            throw e;
        }
    }
View Full Code Here

    public Object invokeTarget(Object payload) throws InvocationTargetException {
        if (context == null) {
            Context 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;
        }
        ExternalWebServiceClient client = (ExternalWebServiceClient)context.getHandler();
View Full Code Here

        if (scope == null) {
            return null;
        }
        Context ctx = scope.getContext(qName.getPortName());
        if (!(ctx instanceof EntryPointContext)) {
            TargetException e = new TargetException("Target not an entry point");
            e.setIdentifier(qName.getQualifiedName());
            e.addContextName(name);
            throw e;
        }
        return ctx.getInstance(null);
    }
View Full Code Here

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

    public Object invokeTarget(Object payload) throws InvocationTargetException {
        if (context == null) {
            Context 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;
        }
View Full Code Here

    public Object getInstance(QualifiedName qName) throws TargetException {
        try {
            return targetWireFactory.createProxy();
            // TODO do we cache the proxy, (assumes stateful capabilities will be provided in an interceptor)
        } catch (ProxyCreationException e) {
            TargetException te = new TargetException(e);
            te.addContextName(getName());
            throw te;
        }
    }
View Full Code Here

    public Object getInstance(QualifiedName qName) throws TargetException {
        if (proxy == null) {
            try {
                proxy = sourceWireFactory.createProxy();
            } catch (ProxyCreationException e) {
                TargetException te = new TargetException(e);
                te.addContextName(getName());
                throw te;
            }
        }
        return proxy;
    }
View Full Code Here

    }

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

TOP

Related Classes of org.apache.tuscany.core.context.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.