Package org.apache.tuscany.sca.invocation

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


    }

    protected synchronized InvocationChain getInvocationChain(Method method, RuntimeWire wire) {
        if (fixedWire) {
            InvocationChain chain = chains.get(method);
            if (chain != null) {
                return chain;
            }
        }
        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


    public Invoker getInvoker(Binding binding, Operation operation) {
        RuntimeWire wire = getRuntimeWire(binding);
        if (wire == null) {
            return null;
        }
        InvocationChain chain = wire.getInvocationChain(operation);
        return chain == null ? null : chain.getHeadInvoker();
    }
View Full Code Here

        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

            }
        }

        setEndpoint(((CallbackReferenceImpl)callableReference).getResolvedEndpoint());

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

        try {
View Full Code Here

            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);
        }

        Object result = invoke(chain, args, wire, source);

        Operation operation = chain.getSourceOperation();
        if (operation != null && operation.getInterface().isRemotable()) {
            List<DataType> inputTypes = operation.getInputType().getLogical();
            // Returned Holder data <T> are placed back in Holder<T>.
            for (int i = 0, size = inputTypes.size(); i < size; i++) {
                if (operation.getParameterModes().get(i) != ParameterMode.IN) {
View Full Code Here

    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

        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

    /*
     * Adds JMS specific interceptors to the binding chain
     */
    public void configureBindingChain(RuntimeWire runtimeWire) {
       
        InvocationChain bindingChain = runtimeWire.getBindingInvocationChain();
       
        // add transport interceptor
        bindingChain.addInterceptor(Phase.SERVICE_BINDING_TRANSPORT,
                                    new TransportServiceInterceptor(jmsBinding,
                                                                    jmsResourceFactory,
                                                                    runtimeWire) );

        // add operation selector interceptor
        bindingChain.addInterceptor(operationSelectorProvider.getPhase(),
                                    operationSelectorProvider.createInterceptor());

        // add operationProperties interceptor after operation selector
        bindingChain.addInterceptor(Phase.SERVICE_BINDING_OPERATION_SELECTOR,
                                    new OperationPropertiesInterceptor(jmsBinding, runtimeWire));

        // add callback destination interceptor after operation selector
        bindingChain.addInterceptor(Phase.SERVICE_BINDING_WIREFORMAT,
                                    new CallbackDestinationInterceptor(runtimeWire));

        // add request wire format
        bindingChain.addInterceptor(requestWireFormatProvider.getPhase(),
                                    requestWireFormatProvider.createInterceptor());
       
        // add response wire format, but only add it if it's different from the request
        if (!jmsBinding.getRequestWireFormat().equals(jmsBinding.getResponseWireFormat())){
            bindingChain.addInterceptor(responseWireFormatProvider.getPhase(),
                                        responseWireFormatProvider.createInterceptor());
        }
    }
View Full Code Here

     * set up the reference binding wire with the right set of jms reference
     * interceptors
     */
    public void configureBindingChain(RuntimeWire runtimeWire) {
       
        InvocationChain bindingChain = runtimeWire.getBindingInvocationChain();
       
        // add transport interceptor
        bindingChain.addInterceptor(Phase.REFERENCE_BINDING_TRANSPORT,
                                    new TransportReferenceInterceptor(jmsBinding,
                                                                      jmsResourceFactory,
                                                                      runtimeWire) );
       
        // add request wire format
        bindingChain.addInterceptor(requestWireFormatProvider.getPhase(),
                                    requestWireFormatProvider.createInterceptor());
       
        // add response wire format, but only add it if it's different from the request
        if (!jmsBinding.getRequestWireFormat().equals(jmsBinding.getResponseWireFormat())){
            bindingChain.addInterceptor(responseWireFormatProvider.getPhase(),
                                        responseWireFormatProvider.createInterceptor());
        }
       
        // add the header processor that comes after the wire formatter but before the
        // policy interceptors
        bindingChain.addInterceptor(Phase.REFERENCE_BINDING_WIREFORMAT,
                                    new HeaderReferenceInterceptor(jmsBinding,
                                                                   jmsResourceFactory,
                                                                   runtimeWire) );
    }   
View Full Code Here

     * Add specific http interceptor to invocation chain
     * @param runtimeWire
     */
    public void configureBindingChain(RuntimeWire runtimeWire) {

        InvocationChain bindingChain = runtimeWire.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

TOP

Related Classes of org.apache.tuscany.sca.invocation.InvocationChain

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.