Examples of RuntimeWire


Examples of org.apache.tuscany.sca.runtime.RuntimeWire

    public Object invoke(Operation operation, Message msg) throws InvocationTargetException {
        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.runtime.RuntimeWire

        if (basicAuthenticationPolicy != null) {
            Axis2BindingBasicAuthenticationConfigurator.parseHTTPHeader(inMC, msg, basicAuthenticationPolicy);
        }
       
        // find the runtime wire and invoke it with the message
        RuntimeWire wire = ((RuntimeComponentService)contract).getRuntimeWire(getBinding());
        Object response =  wire.invoke(op, msg);
       
        return response;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.RuntimeWire

        }
        return null;
    }

    public RuntimeWire getRuntimeWire(Binding binding, InterfaceContract interfaceContract) {
        RuntimeWire wire = getRuntimeWire(binding);
        if (wire == null) {
            return null;
        }
        if (interfaceContract != null && interfaceContract != wire.getSource().getInterfaceContract()) {
            try {
                // FIXME: [rfeng] We could avoid clone() using a better comparison of the two interface contracts
                wire = (RuntimeWire)wire.clone();
                wire.getSource().setInterfaceContract(interfaceContract);
                wire.rebuild();
            } catch (CloneNotSupportedException e) {
                throw new ServiceRuntimeException(e);
            }
        }
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.RuntimeWire

            return null;
        }
    }

    public InvocationChain getInvocationChain(Binding binding, InterfaceContract interfaceContract, Operation operation) {
        RuntimeWire wire = getRuntimeWire(binding);
        if (wire == null) {
            return null;
        }
        if (interfaceContract != null && interfaceContract != wire.getSource().getInterfaceContract()) {
            try {
                // FIXME: [rfeng] We could avoid clone() using a better comparison of the two interface contracts
                wire = (RuntimeWire)wire.clone();
                wire.getSource().setInterfaceContract(interfaceContract);
                wire.rebuild();
            } catch (CloneNotSupportedException e) {
                throw new ServiceRuntimeException(e);
            }
        }
        return wire.getInvocationChain(operation);
    }
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.RuntimeWire

        }
        return from.getReferenceParameters().getCallbackReference();
    }

    private RuntimeWire cloneAndBind(RuntimeWire wire) {
        RuntimeWire boundWire = null;
        if (resolvedEndpoint != null) {
            boundWire = ((RuntimeWireImpl2)wire).lookupCache(resolvedEndpoint);
            if (boundWire != null) {
                return boundWire;
            }
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.RuntimeWire

        this.businessInterface = (Class<B>) ji.getJavaClass();
       
        // We need to re-create the callback wire. We need to do this on a clone of the Service
        // wire since we need to change some details on it.
        // FIXME: Is this the best way to do this?
        final RuntimeWire cbWire = ((RuntimeComponentService) targetService).getRuntimeWires().get(0);
        try {
            this.wire = (RuntimeWireImpl2) cbWire.clone();
        } catch (CloneNotSupportedException e) {
            throw new IOException(e.toString());
        }

        // Setup the reference on the cloned wire
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.RuntimeWire

        if (Object.class == method.getDeclaringClass()) {
            return invokeObjectMethod(method, args);
        }

        // obtain a dedicated wire to be used for this callback invocation
        RuntimeWire wire = ((CallbackReferenceImpl)callableReference).getCallbackWire();
        if (wire == null) {
            //FIXME: need better exception
            throw new ServiceRuntimeException("No callback wire found");
        }

        // set the conversational state based on the interface that
        // is specified for the reference that this wire belongs to
        initConversational(wire);

        // set the conversation id into the conversation object. This is
        // a special case for callbacks as, unless otherwise set manually,
        // the callback should use the same conversation id as was received
        // on the incoming call to this component
        if (conversational) {

            if (conversation == null || conversation.getState() == ConversationState.ENDED) {
                conversation = null;
            }
            Object convID = conversation == null ? null : conversation.getConversationID();

            // create a conversation id if one doesn't exist
            // already, i.e. the conversation is just starting
            if (convID == null) {
                convID = ((CallbackReferenceImpl)callableReference).getConvID();
                if (convID != null) {
                    conversation = ((RuntimeWireImpl2)wire).getConversationManager().getConversation(convID);
                    if (callableReference != null) {
                        ((CallableReferenceImpl)callableReference).attachConversation(conversation);
                    }
                }
            }
        }

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

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

        try {
            return invoke(chain, args, wire, wire.getSource());
        } catch (InvocationTargetException e) {
            Throwable t = e.getCause();
            if (t instanceof NoRegisteredCallbackException) {
                throw t;
            }
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.RuntimeWire

    public Object invoke(Operation operation, Message msg) throws InvocationTargetException {
        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.runtime.RuntimeWire

            }
            endpoint.setInterfaceContract(targetService.getInterfaceContract().makeUnidirectional(false));
            endpointReference.setInterfaceContract(getServiceBindingInterfaceContract(service, endpoint.getBinding()));
           
            // create the wire
            RuntimeWire wire = new RuntimeWireImpl2(false,
                                                    endpointReference,
                                                    endpoint,
                                                    interfaceContractMapper,
                                                    workScheduler,
                                                    wireProcessor,
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.RuntimeWire

            wireTarget.setURI(serviceBinding.getURI());
        }
*/       

        // create the wire
        RuntimeWire wire = new RuntimeWireImpl2(true,
                                                endpointReference,
                                                endpoint,
                                                interfaceContractMapper,
                                                workScheduler,
                                                wireProcessor,
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.