Examples of InvocationChain


Examples of org.apache.tuscany.sca.invocation.InvocationChain

    public void start() {

        RuntimeComponentService componentService = (RuntimeComponentService) service;
        RuntimeWire wire = componentService.getRuntimeWire(binding);
        InvocationChain chain = wire.getInvocationChains().get(0);
       
        // Register with the hosting server
        String uri = binding.getURI();
        EchoServer.getServer().register(uri, new EchoServiceListener(chain.getHeadInvoker(), messageFactory));
    }
View Full Code Here

Examples of org.apache.tuscany.sca.invocation.InvocationChain

    /**
     * Add specific rest interceptor to invocation chain
     */
    public void configure() {

        InvocationChain bindingChain = endpoint.getBindingInvocationChain();

        if (wfProvider != null) {
            Interceptor interceptor = wfProvider.createInterceptor();
            if (interceptor != null) {
                bindingChain.addInterceptor(Phase.SERVICE_BINDING_WIREFORMAT, interceptor);
            }
        }

        if (wfResponseProvider != null) {
            Interceptor interceptor = wfResponseProvider.createInterceptor();
            if (interceptor != null) {
                bindingChain.addInterceptor(Phase.SERVICE_BINDING_WIREFORMAT, interceptor);
            }

        }

        if (osProvider != null) {
            Interceptor interceptor = osProvider.createInterceptor();
            if (interceptor != null) {
                bindingChain.addInterceptor(Phase.SERVICE_BINDING_OPERATION_SELECTOR, interceptor);
            }
        }

    }
View Full Code Here

Examples of org.apache.tuscany.sca.invocation.InvocationChain

        }

    }

    public void start() {
        InvocationChain bindingChain = endpoint.getBindingInvocationChain();

        application = registerWithJAXRS();
        if (application != null) {
            return;
        }

        // Get the invokers for the supported operations
        Servlet servlet = null;
        Invoker bindingInvoker = bindingChain.getHeadInvoker();
        bindingListenerServlet = new RESTBindingListenerServlet(binding, bindingInvoker, messageFactory);
        for (InvocationChain invocationChain : endpoint.getInvocationChains()) {

            Operation operation = invocationChain.getTargetOperation();
            Invoker serviceInvoker = invocationChain.getHeadInvoker();
View Full Code Here

Examples of org.apache.tuscany.sca.invocation.InvocationChain

     */
    public void configure() {
       
        if (widget) return;

        InvocationChain bindingChain = endpoint.getBindingInvocationChain();

        if(osProvider != null) {
            bindingChain.addInterceptor(Phase.SERVICE_BINDING_OPERATION_SELECTOR, osProvider.createInterceptor());   
        }

        if (wfProvider != null) {
            bindingChain.addInterceptor(Phase.SERVICE_BINDING_WIREFORMAT, wfProvider.createInterceptor());
        }

    }
View Full Code Here

Examples of org.apache.tuscany.sca.invocation.InvocationChain

            return invokeObjectMethod(method, args);
        }
        if (wire == null) {
            throw new ServiceRuntimeException("No runtime wire is available");
        }
        InvocationChain chain = getInvocationChain(method, wire);
        if (chain == null) {
            throw new IllegalArgumentException("No matching operation is found: " + method);
        }

        // send the invocation down the wire
View Full Code Here

Examples of org.apache.tuscany.sca.invocation.InvocationChain

    protected synchronized InvocationChain getInvocationChain(Method method, RuntimeWire wire) {
        if (fixedWire && chains.containsKey(method)) {
            return chains.get(method);
        }
        InvocationChain found = null;
        for (InvocationChain chain : wire.getInvocationChains()) {
            Operation operation = chain.getSourceOperation();
            if (operation.isDynamic()) {
                operation.setName(method.getName());
                found = chain;
View Full Code Here

Examples of org.apache.tuscany.sca.invocation.InvocationChain

                        + " is found in reference "
                        + wireSource.getComponent().getURI()
                        + "#"
                        + reference.getName());
                }
                InvocationChain chain = new InvocationChainImpl(operation, targetOperation);
                if (operation.isNonBlocking()) {
                    addNonBlockingInterceptor(reference, refBinding, chain);
                }
                addBindingInterceptor(reference, refBinding, chain, operation);
                chains.add(chain);
            }
        } else {
            // It's the service wire
            RuntimeComponentService service = (RuntimeComponentService)wireTarget.getContract();
            RuntimeComponent serviceComponent = wireTarget.getComponent();
            for (Operation operation : sourceContract.getInterface().getOperations()) {
                Operation targetOperation = interfaceContractMapper.map(targetContract.getInterface(), operation);
                if (targetOperation == null) {
                    throw new ServiceRuntimeException("No matching operation for " + operation.getName()
                        + " is found in service "
                        + serviceComponent.getURI()
                        + "#"
                        + service.getName());
                }
                InvocationChain chain = new InvocationChainImpl(operation, targetOperation);
                addImplementationInterceptor(serviceComponent, service, chain, targetOperation);
                chains.add(chain);
            }
        }
        wireProcessor.process(this);
View Full Code Here

Examples of org.apache.tuscany.sca.invocation.InvocationChain

        return invoke(wire, operation, msg);
    }

    public Object invoke(RuntimeWire wire, Operation operation, Message msg) throws InvocationTargetException {
        RuntimeWire runtimeWire = wire == null ? this.wire : wire;
        InvocationChain chain = runtimeWire.getInvocationChain(operation);
        return invoke(chain, msg, runtimeWire);
    }
View Full Code Here

Examples of org.apache.tuscany.sca.invocation.InvocationChain

        RuntimeComponentReference ref = (RuntimeComponentReference)wire.getSource().getContract();
        Binding binding = wire.getSource().getBinding();
        wire.getTarget().setInterfaceContract(ref.getBindingProvider(binding).getBindingInterfaceContract());

        //FIXME: can we use the same code as JDKInvocationHandler to select the chain?
        InvocationChain chain = getInvocationChain(method, wire);
        if (chain == null) {
            throw new IllegalArgumentException("No matching operation is found: " + method);
        }

        try {
View Full Code Here

Examples of org.apache.tuscany.sca.invocation.InvocationChain

        }
        return bindingInvocationChain;
    }

    public InvocationChain getInvocationChain(Operation operation) {
        InvocationChain cached = invocationChainMap.get(operation);
        if (cached == null) {
            for (InvocationChain chain : getInvocationChains()) {
                Operation op = chain.getSourceOperation();
               
                // We used to check compatibility here but this is now validated when the
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.