Package org.apache.tuscany.sca.core.assembly

Examples of org.apache.tuscany.sca.core.assembly.EndpointReferenceImpl


        EndpointReference from = null;
        ReferenceParameters parameters = null;
        if (callbackAddress != null ||
            callbackID != null ||
            conversationID != null) {
            from = new EndpointReferenceImpl(null);
            parameters = from.getReferenceParameters();
            msg.setFrom(from);
        }

        // set the reference parameters into the "From" EPR
        if (callbackAddress != null) {
            parameters.setCallbackReference(new EndpointReferenceImpl(callbackAddress));
        }
        if (callbackID != null) {
            parameters.setCallbackID(callbackID);
        }
        if (conversationID != null) {
View Full Code Here


                } catch(Exception ex) {
                    // do nothing
                }
            }
           
            serviceEPR = new EndpointReferenceImpl(endpointURL);
        }
       
        return serviceEPR;
    }
View Full Code Here

    public EndpointReference getCallbackEndpoint(){
        if (callbackEPR == null) {
            if (reference.getCallbackService() != null) {
                for (Binding callbackBinding : reference.getCallbackService().getBindings()) {
                    if (callbackBinding instanceof SCABinding) {
                        callbackEPR = new EndpointReferenceImpl(reference.getName() + "/" + callbackBinding.getName());
                        continue;
                    }
                }
            }   
        }
View Full Code Here

        try {
            JMSBindingContext context = msg.getBindingContext();
            javax.jms.Message requestJMSMsg = context.getJmsMsg();
            context.setJmsSession(context.getJmsResourceFactory().createSession());
           
            EndpointReference from = new EndpointReferenceImpl(null);
            msg.setFrom(from);
            from.setCallbackEndpoint(new EndpointReferenceImpl("/")); // TODO: whats this for?
            ReferenceParameters parameters = from.getReferenceParameters();
   
            String conversationID = requestJMSMsg.getStringProperty(JMSBindingConstants.CONVERSATION_ID_PROPERTY);
            if (conversationID != null) {
                parameters.setConversationID(conversationID);
            }
View Full Code Here

                }
   
                if (callbackdestName != null) {
                    // append "jms:" to make it an absolute uri so the invoker can determine it came in on the request
                    // as otherwise the invoker should use the uri from the service callback binding
                    parameters.setCallbackReference(new EndpointReferenceImpl("jms:" + callbackdestName));
                }
   
                String callbackID = jmsMsg.getStringProperty(JMSBindingConstants.CALLBACK_ID_PROPERTY);
                if (callbackID != null) {
                    parameters.setCallbackID(callbackID);
View Full Code Here

        return operation;
    }

    protected void setHeaderProperties(Message requestJMSMsg, MessageImpl tuscanyMsg, Operation operation) throws JMSException {

        EndpointReference from = new EndpointReferenceImpl(null);
        tuscanyMsg.setFrom(from);
        from.setCallbackEndpoint(new EndpointReferenceImpl("/")); // TODO: whats this for?
        ReferenceParameters parameters = from.getReferenceParameters();

        String conversationID = requestJMSMsg.getStringProperty(JMSBindingConstants.CONVERSATION_ID_PROPERTY);
        if (conversationID != null) {
            parameters.setConversationID(conversationID);
        }

        if (service.getInterfaceContract().getCallbackInterface() != null) {

            String callbackdestName = requestJMSMsg.getStringProperty(JMSBindingConstants.CALLBACK_Q_PROPERTY);
            if (callbackdestName == null && operation.isNonBlocking()) {
                // if the request has a replyTo but this service operation is oneway but the service uses callbacks
                // then use the replyTo as the callback destination
                Destination replyTo = requestJMSMsg.getJMSReplyTo();
                if (replyTo != null) {
                    callbackdestName = (replyTo instanceof Queue) ? ((Queue)replyTo).getQueueName() : ((Topic)replyTo).getTopicName();
                }
            }

            if (callbackdestName != null) {
                // append "jms:" to make it an absolute uri so the invoker can determine it came in on the request
                // as otherwise the invoker should use the uri from the service callback binding
                parameters.setCallbackReference(new EndpointReferenceImpl("jms:" + callbackdestName));
            }

            String callbackID = requestJMSMsg.getStringProperty(JMSBindingConstants.CALLBACK_ID_PROPERTY);
            if (callbackID != null) {
                parameters.setCallbackID(callbackID);
View Full Code Here

    private EndpointReference from;
    private EndpointReference to;

    public MessageImpl() {
        this.from = new EndpointReferenceImpl("/");
        this.to = new EndpointReferenceImpl("/");
    }
View Full Code Here

            // Use the interface contract of the reference on the component type
            Reference componentTypeRef = reference.getReference();
            InterfaceContract sourceContract =
                componentTypeRef == null ? reference.getInterfaceContract() : componentTypeRef.getInterfaceContract();
            sourceContract = sourceContract.makeUnidirectional(false);
            EndpointReference epr = new EndpointReferenceImpl(component, reference, binding, sourceContract);
            ReferenceParameters parameters = getReferenceParameters();
            epr.setReferenceParameters(parameters);
            return epr;
        } catch (Exception e) {
            throw new ServiceRuntimeException(e);
        }       
    }
View Full Code Here

        final Component targetComponent = super.resolveComponentURI(uri);
        final ComponentService targetService = super.resolveServiceURI(uri, targetComponent);
        final InterfaceContract targetServiceIfaceContract = targetService.getInterfaceContract();

        // Re-create the resolved Endpoint
        this.resolvedEndpoint = new EndpointReferenceImpl(
                (RuntimeComponent) targetComponent, targetService, null,
                targetServiceIfaceContract);

        // Copy the Java Interface from the Service
        final JavaInterface ji = (JavaInterface) targetServiceIfaceContract.getInterface();
View Full Code Here

        // Use the interface contract of the reference on the component type
        Reference componentTypeRef = reference.getReference();
        InterfaceContract sourceContract =
            componentTypeRef == null ? reference.getInterfaceContract() : componentTypeRef.getInterfaceContract();
        sourceContract = sourceContract.makeUnidirectional(false);
        EndpointReference epr = new EndpointReferenceImpl(component, reference, binding, sourceContract);
        ReferenceParameters parameters = getReferenceParameters();
        epr.setReferenceParameters(parameters);
        return epr;
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.core.assembly.EndpointReferenceImpl

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.