Examples of InvocationChain


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

    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

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

            }
        }

        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

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

            throw new RuntimeException("Missing operation header");
        }
        if (wire == null) {
            throw new RuntimeException("Missing wire");
        }
        InvocationChain chain = null;
        for (InvocationChain ch : wire.getInvocationChains()) {
            // We may want to use more than just the op name
            if(ch.getTargetOperation().getName().equals(opHeader)) {
                chain = ch;
                break;
View Full Code Here

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

        EndpointReference target = wire.getTarget();
        if (target != null) {
            RuntimeComponentService service = (RuntimeComponentService)target.getContract();
            if (service != null) { // not a callback wire
                SCABinding scaBinding = service.getBinding(SCABinding.class);
                InvocationChain chain =
                    service.getInvocationChain(scaBinding, wire.getSource().getInterfaceContract(), operation);
                return chain == null ? null : new SCABindingInvoker(chain);
            }
        }
        return null;
View Full Code Here

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

    /*
     * set up the reference binding wire with the right set of ws reference
     * interceptors
     */
    public void configure() {
        InvocationChain bindingChain = endpointReference.getBindingInvocationChain();
        
        // add transport interceptor
        bindingChain.addInterceptor(Phase.REFERENCE_BINDING_TRANSPORT,
                                    new TransportReferenceInterceptor());
       
    }
View Full Code Here

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

        Endpoint target = endpointReference.getTargetEndpoint();
        if (target != null) {
            RuntimeComponentService service = (RuntimeComponentService) target.getService();
            if (service != null) { // not a callback wire
                               
                InvocationChain chain = ((RuntimeEndpoint) target).getInvocationChain(operation);

                boolean passByValue = false;
                Operation targetOp = chain.getTargetOperation();
                if (!operation.getInterface().isRemotable()) {
                    if (interfaceContractMapper.isCompatibleByReference(operation, targetOp, Compatibility.SUBSET)) {
                        passByValue = false;
                    }
                } else {
                    Reference ref = endpointReference.getReference().getReference();
                    // The spec says both ref and service needs to
                    // allowsPassByReference
                    boolean allowsPBR = (endpointReference.getReference().isAllowsPassByReference() || (ref != null && ref.isAllowsPassByReference())) && chain.allowsPassByReference();

                    if (allowsPBR && interfaceContractMapper.isCompatibleByReference(operation, targetOp, Compatibility.SUBSET)) {
                        passByValue = false;
                    } else if (interfaceContractMapper.isCompatibleWithoutUnwrapByValue(operation, targetOp, Compatibility.SUBSET)) {
                        passByValue = true;
View Full Code Here

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

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

        // 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, endpoint));

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

        bindingChain.addInterceptor(Phase.SERVICE_BINDING_WIREFORMAT, new HeaderServiceInterceptor(registry, jmsBinding));

        // add async response interceptor after header interceptor
        bindingChain.addInterceptor(Phase.SERVICE_BINDING_WIREFORMAT,
                                    new AsyncResponseDestinationInterceptor(endpoint, registry) );

        // 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

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

     * set up the reference binding wire with the right set of jms reference
     * interceptors
     */
    public void configure() {
       
        InvocationChain bindingChain = endpointReference.getBindingInvocationChain();
       
        // add transport interceptor
        bindingChain.addInterceptor(Phase.REFERENCE_BINDING_TRANSPORT,
                                    new TransportReferenceInterceptor(jmsBinding,
                                                                      jmsResourceFactory,
                                                                      endpointReference) );
       
        // 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(extensions,
                                                                   jmsBinding,
                                                                   jmsResourceFactory,
                                                                   endpointReference) );
    }
View Full Code Here

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

        return body;
    }


    public Message invoke(Operation operation, Message msg) {
        InvocationChain chain = invocable.getInvocationChain(operation);
        return invoke(chain, msg);
    }
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.